Kubernetes use private images

Private images cannot be used directly by default

The general practice is to create a secret of docker registry type first

kubectl create secret docker-registry regsecret --docker-username=dockername --docker-password=password --docker-email=helloworld@lizhe.name

Modify in deployment

    spec:
      imagePullSecrets:
      - name: regsecret
      containers:
      - image: lizhepac/privateimage
        imagePullPolicy: Always
        name: private
        resources: {}
Send a Message