Why can’t I re-apply a statefulset?

Spread the love
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  
  •  

I have a StatefulSet. I apply it through kustomize – fine. I apply it again – it gives me an error, which I understand (it doesnt like the volumeClaims), but I don’t really understand how to “fix” this. Do I need to keep my StatefulSet out of kustomize, delete it, and re-apply it separately for my workflow? My yaml: apiVersion: apps/v1 kind: StatefulSet metadata: name: rabbitmq labels: app: rabbitmq annotations: linkerd.io/inject: enabled spec: selector: matchLabels: app: rabbitmq serviceName: rabbitmq replicas: 3 template: metadata: labels: app: rabbitmq app.kubernetes.io/name: rabbitmq app.kubernetes.io/instance: rabbitmq-replica app.kubernetes.io/version: “3.7-management” app.kubernetes.io/component: queue app.kubernetes.io/part-of: api app.kubernetes.io/managed-by: kustomize spec: serviceAccountName: rabbitmq terminationGracePeriodSeconds: 10 nodeSelector: # Use Linux nodes in a mixed OS kubernetes cluster. # Learn more at https://kubernetes.io/docs/reference/kubernetes-api/labels-annotations-taints/#kubernetes-io-os kubernetes.io/os: linux containers: – name: replica image: quoter/rabbitmq:1.0 imagePullPolicy: Never lifecycle: postStart: exec: command: – /bin/sh – -c – > until rabbitmqctl –erlang-cookie ${RABBITMQ_ERLANG_COOKIE} await_startup; do sleep 1; done; rabbitmqctl –erlang-cookie ${RABBITMQ_ERLANG_COOKIE} set_policy ha-two “” ‘{“ha-mode”:”exactly”, “ha-params”: 3, “ha-sync-mode”: “automatic”}’ volumeMounts: – name: rabbitmq-pv-claim mountPath: /var/lib/rabbitmq env: – name: MY_POD_NAME valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.name – name: MY_POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace – name: RABBITMQ_USE_LONGNAME value: “true” – name: K8S_SERVICE_NAME value: rabbitmq – name: RABBITMQ_NODENAME value: [email protected]$(MY_POD_NAME).$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local – name: K8S_HOSTNAME_SUFFIX value: .$(K8S_SERVICE_NAME).$(MY_POD_NAMESPACE).svc.cluster.local – name: RABBITMQ_ERLANG_COOKIE value: “mycookie” ports: – containerPort: 5672 name: rabbitmq – containerPort: 15672 name: rabbitmqadmin updateStrategy: rollingUpdate: partition: 0 type: RollingUpdate volumeClaimTemplates: – metadata: name: rabbitmq-pv-claim spec: accessModes: [ “ReadWriteOnce” ] resources: requests: storage: 5Gi volumeMode: Filesystem My error: `The StatefulSet “rabbitmq” is invalid: spec: Forbidden: updates to statefulset spec for fields other than ‘replicas’, ‘template’, and ‘updateStrategy’ are forbidden` Clearly it doesn’t like the `selector`, `serviceName`, and `volumeClaimTemplates` portion of our YAML. But every other type of Kind (Deployment, Pod, Daemonsets, Service, etc) I’ve been able to apply and re-apply without fail. I’ve seen some Github Issues with the same error but they’re close with a closed, merged in PR. We are on the latest version of Kuberenetes and we are trying this in Minikube v1.11.0. We do use `skaffold run` to build the images, and it does add a bunch of Skaffold annotations to this – could that be an issue as well here? submitted by /u/thehealthywindow [link] [comments]

X ITM Cloud News

Patricia

Leave a Reply

Next Post

Bootstrap Networking, Ingress, and Observability for a new Kubernetes Cluster

Thu Jul 30 , 2020
Spread the love           submitted by /u/keevans94 [link] [comments] X ITM Cloud News
X- ITM

Cloud Computing – Consultancy – Development – Hosting – APIs – Legacy Systems

X-ITM Technology helps our customers across the entire enterprise technology stack with differentiated industry solutions. We modernize IT, optimize data architectures, and make everything secure, scalable and orchestrated across public, private and hybrid clouds.

This image has an empty alt attribute; its file name is x-itmdc.jpg

The enterprise technology stack includes ITO; Cloud and Security Services; Applications and Industry IP; Data, Analytics and Engineering Services; and Advisory.

Watch an animation of  X-ITM‘s Enterprise Technology Stack

We combine years of experience running mission-critical systems with the latest digital innovations to deliver better business outcomes and new levels of performance, competitiveness and experiences for our customers and their stakeholders.

X-ITM invests in three key drivers of growth: People, Customers and Operational Execution.

The company’s global scale, talent and innovation platforms serve 6,000 private and public-sector clients in 70 countries.

X-ITM’s extensive partner network helps drive collaboration and leverage technology independence. The company has established more than 200 industry-leading global Partner Network relationships, including 15 strategic partners: Amazon Web Services, AT&T, Dell Technologies, Google Cloud, HCL, HP, HPE, IBM, Micro Focus, Microsoft, Oracle, PwC, SAP, ServiceNow and VMware

.

X ITM