I'm not able to edit to add ImagePullSecrets to existing deployment? Any idea wh . . .

Manoj GR:
I’m not able to edit to add ImagePullSecrets to existing deployment?
Any idea why i’m getting error

# deployments.apps "web" was not valid:
# * : Invalid value: "The edited file failed validation": [yaml: line 36: did not find expected key, invalid character 'a' looking 

Below is the format where i tired to add.

Spec:
 40       containers:
 41       - image: <http://myprivateregistry.com:5000/nginx:alpine|myprivateregistry.com:5000/nginx:alpine>
 42         name: nginx
 43         imagePullPolicy: IfNotPresent
 44       - imagePullSecrets:
 45         name: private-reg-cred

Andy Bubune:
vi +36 deployment.yml

Andy Bubune:
Share the what’s in there

Manoj GR:
Below is the deployment spec container section.

spec:
      containers:
      - image: <http://myprivateregistry.com:5000/nginx:alpine|myprivateregistry.com:5000/nginx:alpine>
        imagePullPolicy: IfNotPresent
        name: nginx
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File

Manoj GR:
How do we add ImagePullSecrets to that?

Andy Bubune:
apiVersion: v1
kind: Pod
metadata:
name: private-reg
spec:
containers:

  • name: private-reg-container
    image: <your-private-image>
    imagePullSecrets:
  • name: regcred

Andy Bubune:
Where regcred is you registry secret you created

Andy Bubune:
You don’t need the hyphen(-) infront of imagePullSecrets

Manoj GR:
Thank you