建议先关注、点赞、收藏后再阅读。
在使用私有镜像库时,需要进行以下相关配置:
apiVersion: v1
kind: Secret
metadata:
name: private-registry-credentials
namespace: your-namespace
type: kubernetes.io/dockerconfigjson
data:
.dockerconfigjson: <base64-encoded-dockerconfigjson>
private-registry-credentials
:凭据的名称your-namespace
:命名空间<base64-encoded-dockerconfigjson>
:Base64编码的Docker配置文件apiVersion: v1
kind: ServiceAccount
metadata:
name: your-service-account
namespace: your-namespace
annotations:
imagePullSecrets:
- name: private-registry-credentials
your-service-account
:服务账号的名称your-namespace
:命名空间private-registry-credentials
:私有镜像库凭据的名称apiVersion: apps/v1
kind: Deployment
metadata:
name: your-deployment
namespace: your-namespace
spec:
template:
spec:
containers:
- name: your-container
image: private-registry/your-image:tag
imagePullSecrets:
- name: private-registry-credentials
your-deployment
:部署的名称your-namespace
:命名空间your-container
:容器的名称private-registry/your-image:tag
:私有镜像库中的镜像路径和标签private-registry-credentials
:私有镜像库凭据的名称原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。