-
Hello. I have a chart here: https://github.com/open-component-model/ocm-controller/tree/main/deploy The chart has a cert-manager dependency and creates certificates for the deployments. To avoid creating the certificate too early, a job is created that checks if cert-manager is up and running: {{- if index .Values "cert-manager" "enabled" }}
apiVersion: batch/v1
kind: Job
metadata:
name: wait-for-cert-manager
namespace: cert-manager
labels:
app: {{ .Release.Name }}-wait-for-cert-manager
annotations:
"helm.sh/hook": post-install,post-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
spec:
template:
spec:
serviceAccountName: wait-for-cert-manager-sa
containers:
- name: wait-for-cert-manager
image: bitnami/kubectl:latest
command:
- /bin/sh
- -c
- |
kubectl wait --for=condition=Available=True Deployment/cert-manager -n cert-manager --timeout=60s
kubectl wait --for=condition=Available=True Deployment/cert-manager-webhook -n cert-manager --timeout=60s
kubectl wait --for=condition=Available=True Deployment/cert-manager-cainjector -n cert-manager --timeout=60s
restartPolicy: OnFailure
{{- end}} Install it with the following command:
This launches a Job that will wait for CertManager to be available before applying the I'm trying to use a HelmRelease like this to replicate this behaviour: apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: ocm
namespace: default
spec:
interval: 30m
install:
disableWait: true
chartRef:
kind: OCIRepository
name: ocm-controller
releaseName: ocm-controller
values:
cert-manager:
enabled: true
But it keeps failing the helm release. If I add I'm stuck at this point trying to figure out how to proceed. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You don’t need such a job, Flux dependsOn does it for you. See here an example repo: https://github.com/fluxcd/flux2-kustomize-helm-example |
Beta Was this translation helpful? Give feedback.
Yep, that was it. I had to put it into its own folder. :)