-
-
Notifications
You must be signed in to change notification settings - Fork 276
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
remove hook to be helm3 compatible, change crd generation, move to crds directory #441
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @21h, thank you for opening this PR!
This will brake helm 2 compatibility. My suggestion is to do as guys from Prometheus operator did. Doing so will be backward compatible.
Those files are generated, so you have to change the script that updates them. See this file.
@AMecea checkout files, I made changes you requested |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @21h !
It's almost done, you have to add a file template/crd.yaml
which will include the CRDs for helm version 2. See this code.
# templates/crds.yaml update | ||
awk 'FNR==1 && NR!=1 {print "---"}{print}' ${CONFIG_PATH}/crds/*.yaml > ${CHART_PATH}/templates/_crds.yaml | ||
yq m -d'*' -i ${CHART_PATH}/templates/_crds.yaml chart-metadata.yaml | ||
yq w -d'*' -i ${CHART_PATH}/templates/_crds.yaml 'metadata.annotations[helm.sh/hook]' crd-install |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the annotations helm,sh/hook=crd-install
should be kept to be backward compatible.
@@ -23,14 +16,8 @@ apiVersion: apiextensions.k8s.io/v1beta1 | |||
kind: CustomResourceDefinition | |||
metadata: | |||
labels: | |||
app: '{{ template "mysql-operator.name" . }}' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest keeping this label to a hardcoded value: app=mysql-operator
Also, please update the chart |
ping @21h 😄 |
I have a doubt.... I have only made the changes to the CRD file and moved it to the crds directory. Do I need to use the script generate_chart_manifests.sh as well? Thanks |
In the logs for the failing backup jobs I see this:
I tried to curl Is mysql-cluster-mysql-0.mysql.mysql:8080 from a Ubuntu container in the same namespace and I could connect. I wonder why the backup job cannot connect to it? |
I found my problem.... Even though I checked out the 0.3.8 tag, the images in the values.yaml are set to "latest", instead of "0.3.8". Changing that fixes the backups. |
crd hook not supported in helm3, tested installation without this hook and all works fine.