No Declared merge key error when trying to modify a deployment in Kubernetes

0 votes

I have a deployment and wished to modify it a little bit. I've used the following command for it

kubectl -n <namespace> edit deployment <depolyment_name>.

But I just ended up with the following error:

A copy of your changes has been stored to "/tmp/kubectl-edit-hv5dh.yaml"
error: map: map[] does not contain declared merge key: name

Deployment file:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  annotations:
    deployment.kubernetes.io/revision: "1"
    federation.alpha.kubernetes.io/federation-name: fed
  creationTimestamp: 2019-04-01T13:26:40Z
  generation: 1
  labels:
    app: cluster
  name: apiserver
  namespace: system
  resourceVersion: "393140"
  selfLink: /apis/extensions/v1beta1/namespaces/federation-system/deployments/apiserver
  uid: <uid>
spec:
  progressDeadlineSeconds: 600
  replicas: 1
  revisionHistoryLimit: 10
  selector:
    matchLabels:
      app: cluster
      module: apiserver
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 1
    type: RollingUpdate
  template:
    metadata:
      annotations:
        federation.alpha.kubernetes.io/federation-name: fed
      creationTimestamp: null
      labels:
        app: cluster
        module: apiserver
      name: apiserver
    spec:
      containers:
      - command:
        - /fcp
        - federation-apiserver
        - --admission-control=NamespaceLifecycle
        - --advertise-address=<master-ip>
        - --bind-address=0.0.0.0
        - --client-ca-file=/etc/federation/apiserver/ca.crt
        - --etcd-servers=http://localhost:2379
        - --secure-port=8443
        - --tls-cert-file=/etc/federation/apiserver/server.crt
        - --tls-private-key-file=/etc/federation/apiserver/server.key
        - --enable-admission-plugins=SchedulingPolicy
        - --admission-control-config-file=/etc/kubernetes/admission/config.yml**
        image: gcr.io/k8s-jkns-e2e-gce-federation/fcp-amd64:v1.9.0-alpha.3
        imagePullPolicy: IfNotPresent
        name: apiserver
        ports:
        - containerPort: 8443
          name: https
          protocol: TCP
        - containerPort: 8080
          name: local
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /etc/federation/apiserver
          name: apiserver-credentials
          readOnly: true
        volumeMounts:
        - mountPath: /etc/kubernetes/admission
          name: admission-config**
      - command:
        - /usr/local/bin/etcd
        - --data-dir
        - /var/etcd/data
        image: gcr.io/google_containers/etcd:3.1.10
        imagePullPolicy: IfNotPresent
        name: etcd
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
      dnsPolicy: ClusterFirst
      imagePullSecrets:
      - {}
      restartPolicy: Always
      schedulerName: scheduler
      securityContext: {}
      terminationGracePeriodSeconds: 30
      volumes:
      - name: credentials
        secret:
          defaultMode: 420
          secretName: credentials
        - name: admission-config
        configMap:
          name: admission**
status:
  availableReplicas: 1
  conditions:
  - lastTransitionTime: 2018-04-01T13:26:40Z
    lastUpdateTime: 2018-04-01T13:26:40Z
    message: Deployment has minimum availability.
    reason: MinimumReplicasAvailable
    status: "True"
    type: Available
  - lastTransitionTime: 2018-04-01T13:26:40Z
    lastUpdateTime: 2018-04-01T13:27:20Z
    message: ReplicaSet "apiserver-8484fd45f8" has successfully progressed.
    reason: NewReplicaSetAvailable
    status: "True"
    type: Progressing
  observedGeneration: 1
  readyReplicas: 1
  replicas: 1
  updatedReplicas: 1​
Jan 4 in Kubernetes by Ali
• 10,380 points
368 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes
I see you have a section in your deployment that uses ImagePullSecrets, delete that part.

ImagePullSecrets has been blocking the merge key you require. This condition has been round-tripping the yaml file thought the editor.
answered Jan 4 by Kim

Related Questions In Kubernetes

0 votes
1 answer

image can't be pulled error when I try to pull a docker image - kubernetes

I think the image is being pulled ...READ MORE

answered Sep 4, 2018 in Kubernetes by Kalgi
• 36,420 points
250 views
0 votes
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17 in Others by anonymous
741 views
+3 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Error in syncing pod - Kubernetes

You are getting this error because all you're ...READ MORE

answered Jan 4 in Kubernetes by Layla
35 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.