helm / charts

⚠️(OBSOLETE) Curated applications for Kubernetes
Apache License 2.0
15.49k stars 16.8k forks source link

[stable/cockroachdb] CockroachDB rolling update. Init failed #22618

Closed sergeyshaykhullin closed 4 years ago

sergeyshaykhullin commented 4 years ago

Describe the bug cockroach-init change failed when cluster already running

Version of Helm and Kubernetes: 3+ 1.18+

Which chart: stable/cockraochdb

What happened: cockraochdb chart with bumped version failed to apply, but cockraochdb version updated and cluster rolling update happened

What you expected to happen: Init job is not applied on already running cluster when bump version

How to reproduce it (as minimally and precisely as possible): Deploy cockroachdb cluster, change image: tag: ... and apply again

Anything else we need to know: Ansible playbook error logs

fatal: [node1]: FAILED! => {"changed": false, "command": "/usr/local/bin/helm --namespace=cockroachdb --version=3.0.7 upgrade -i --reset-values -f=/tmp/tmprmdspxy9.yml cockroachdb stable/cockroachdb", "msg": "Failure when executing Helm command. Exited 1.\nstdout: \nstderr: Error: UPGRADE FAILED: cannot patch \"cockroachdb-init\" with kind Job: Job.batch \"cockroachdb-init\" is invalid: spec.template: Invalid value: core.PodTemplateSpec{ObjectMeta:v1.ObjectMeta{Name:\"\", GenerateName:\"\", Namespace:\"\", SelfLink:\"\", UID:\"\", ResourceVersion:\"\", Generation:0, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:0, loc:(*time.Location)(nil)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string{\"app.kubernetes.io/component\":\"init\", \"app.kubernetes.io/instance\":\"cockroachdb\", \"app.kubernetes.io/name\":\"cockroachdb\", \"controller-uid\":\"2a9781ad-1ed1-4099-9b89-14edc9dad859\", \"job-name\":\"cockroachdb-init\"}, Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Finalizers:[]string(nil), ClusterName:\"\", ManagedFields:[]v1.ManagedFieldsEntry(nil)}, Spec:core.PodSpec{Volumes:[]core.Volume(nil), InitContainers:[]core.Container(nil), Containers:[]core.Container{core.Container{Name:\"cluster-init\", Image:\"cockroachdb/cockroach:v20.1.1\", Command:[]string{\"/bin/bash\", \"-c\", \"while true; do initOUT=$(set -x; /cockroach/cockroach init --insecure --host=cockroachdb-0.cockroachdb:26257 2>&1); initRC=\\\"$?\\\"; echo $initOUT; [[ \\\"$initRC\\\" == \\\"0\\\" ]] && exit 0; [[ \\\"$initOUT\\\" == *\\\"cluster has already been initialized\\\"* ]] && exit 0; sleep 5; done\"}, Args:[]string(nil), WorkingDir:\"\", Ports:[]core.ContainerPort(nil), EnvFrom:[]core.EnvFromSource(nil), Env:[]core.EnvVar(nil), Resources:core.ResourceRequirements{Limits:core.ResourceList(nil), Requests:core.ResourceList(nil)}, VolumeMounts:[]core.VolumeMount(nil), VolumeDevices:[]core.VolumeDevice(nil), LivenessProbe:(*core.Probe)(nil), ReadinessProbe:(*core.Probe)(nil), StartupProbe:(*core.Probe)(nil), Lifecycle:(*core.Lifecycle)(nil), TerminationMessagePath:\"/dev/termination-log\", TerminationMessagePolicy:\"File\", ImagePullPolicy:\"IfNotPresent\", SecurityContext:(*core.SecurityContext)(nil), Stdin:false, StdinOnce:false, TTY:false}}, EphemeralContainers:[]core.EphemeralContainer(nil), RestartPolicy:\"OnFailure\", TerminationGracePeriodSeconds:(*int64)(0xc00bf4fa20), ActiveDeadlineSeconds:(*int64)(nil), DNSPolicy:\"ClusterFirst\", NodeSelector:map[string]string(nil), ServiceAccountName:\"\", AutomountServiceAccountToken:(*bool)(nil), NodeName:\"\", SecurityContext:(*core.PodSecurityContext)(0xc00ff41f80), ImagePullSecrets:[]core.LocalObjectReference(nil), Hostname:\"\", Subdomain:\"\", Affinity:(*core.Affinity)(nil), SchedulerName:\"default-scheduler\", Tolerations:[]core.Toleration(nil), HostAliases:[]core.HostAlias(nil), PriorityClassName:\"\", Priority:(*int32)(nil), PreemptionPolicy:(*core.PreemptionPolicy)(nil), DNSConfig:(*core.PodDNSConfig)(nil), ReadinessGates:[]core.PodReadinessGate(nil), RuntimeClassName:(*string)(nil), Overhead:core.ResourceList(nil), EnableServiceLinks:(*bool)(nil), TopologySpreadConstraints:[]core.TopologySpreadConstraint(nil)}}: field is immutable\n"}
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Any further update will cause the issue/pull request to no longer be considered stale. Thank you for your contributions.

scottrigby commented 4 years ago

stable/cockroachdb source code has moved to a new home. See https://github.com/helm/charts/pull/23000 @sergeyshaykhullin Please re-open your issue there if it's still applicable