diff --git a/charts/argo/templates/_workflow-crd.json b/charts/argo/templates/_workflow-crd.json new file mode 100644 index 00000000..ef26b415 --- /dev/null +++ b/charts/argo/templates/_workflow-crd.json @@ -0,0 +1,19 @@ +{{- define "workflow-crd-json" }} +{ + "apiVersion": "apiextensions.k8s.io/v1beta1", + "kind": "CustomResourceDefinition", + "metadata": { + "name": "workflows.argoproj.io" + }, + "spec": { + "group": "argoproj.io", + "names": { + "kind": "Workflow", + "plural": "workflows", + "shortNames": ["wf"] + }, + "scope": "Namespaced", + "version": "v1alpha1" + } +} +{{- end}} \ No newline at end of file diff --git a/charts/argo/templates/apply-workflow-crd-job.yaml b/charts/argo/templates/apply-workflow-crd-job.yaml new file mode 100644 index 00000000..313a05f2 --- /dev/null +++ b/charts/argo/templates/apply-workflow-crd-job.yaml @@ -0,0 +1,18 @@ +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ .Release.Name }}-apply-workflow-crd + annotations: + helm.sh/hook: pre-install + helm.sh/hook-delete-policy: hook-succeeded +spec: + backoffLimit: 5 + activeDeadlineSeconds: 100 + template: + spec: + containers: + - name: kubectl-apply + image: lachlanevenson/k8s-kubectl + command: ["/bin/sh"] + args: ["-c", 'echo ''{{- include "workflow-crd-json" .}}'' | kubectl apply -f -'] + restartPolicy: Never \ No newline at end of file diff --git a/charts/argo/templates/workflow-crd.yaml b/charts/argo/templates/workflow-crd.yaml deleted file mode 100644 index aaf95780..00000000 --- a/charts/argo/templates/workflow-crd.yaml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: apiextensions.k8s.io/v1beta1 -kind: CustomResourceDefinition -metadata: - name: workflows.argoproj.io -spec: - group: argoproj.io - names: - kind: Workflow - plural: workflows - shortNames: - - wf - scope: Namespaced - version: v1alpha1 \ No newline at end of file