Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: datastore resource object hook #39

Merged
merged 3 commits into from
Aug 25, 2023

Conversation

prometherion
Copy link
Member

Fixes #38.

The hook list was wrong, causing a deletion of the DataStore upon an update, or a rollback.

version: 0.3.0
version: 0.4.0
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A minor change is required since the Datastore manifest will be part of the managed resources, as the opposite for the RBAC-related one (Role, Rolebinding, ServiceAccount).

Comment on lines +5 to +7
annotations:
"helm.sh/hook": pre-install
"helm.sh/hook-weight": "5"
Copy link
Member Author

@prometherion prometherion Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ConfigMap containing the CSR data is required only upon installation.

Comment on lines -6 to -8
annotations:
"helm.sh/hook": post-install,post-upgrade,post-rollback
"helm.sh/hook-weight": "5"
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To avoid the Datastore from being delete upon every upgrade, or rollback, the hooks must be removed.

kubectl --namespace={{ .Release.Namespace }} create secret tls {{ include "etcd.clientSecretName" . }} --key=/certs/root-client-key.pem --cert=/certs/root-client.pem &&
kubectl --namespace={{ .Release.Namespace }} rollout status sts/{{ include "etcd.stsName" . }} --timeout=300s
kubectl --namespace={{ .Release.Namespace }} create secret tls {{ include "etcd.clientSecretName" . }} --key=/certs/root-client-key.pem --cert=/certs/root-client.pem
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Statefulset rollout check has been moved to the etcd_job_preinstall_2.yaml job since the StatefulSet resource will be created once the pre-install phase has been completed.

@@ -24,7 +24,6 @@ spec:
{{- toYaml .Values.podAnnotations | nindent 8 }}
{{- end }}
spec:
serviceAccountName: {{ include "etcd.serviceAccountName" . }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The etcd cluster didn't ever need a SA since there's no interaction with the Kubernetes API Server.

@prometherion prometherion merged commit 29339cf into clastix:master Aug 25, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to perform helm upgrade
1 participant