diff --git a/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml b/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml index 6167ddbe2..f91b039b8 100644 --- a/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml +++ b/packages/rancher-monitoring/templates/crd-template/templates/jobs.yaml @@ -49,8 +49,12 @@ spec: - -c - > echo "Applying CRDs..."; - kubectl apply -f /etc/config/crd-manifest.yaml; - + mkdir -p /etc/crd-manifest; + base64 -d /etc/config/crd-manifest.tgz > /etc/crd-manifest/crd-manifest.tgz; + tar -xzvf /etc/crd-manifest/crd-manifest.tgz -C /etc/crd-manifest; + rm /etc/crd-manifest/crd-manifest.tgz; + kubectl apply -Rf /etc/crd-manifest; + echo "Waiting for CRDs to be recognized before finishing installation..."; {{- range $path, $_ := (.Files.Glob "crd-manifest/**.yaml") }} @@ -121,7 +125,12 @@ spec: - /bin/sh - -c - > - kubectl delete -f /etc/config/crd-manifest.yaml + echo "Deleting CRDs..."; + mkdir -p /etc/crd-manifest; + base64 -d /etc/config/crd-manifest.tgz > /etc/crd-manifest/crd-manifest.tgz; + tar -xzvf /etc/crd-manifest/crd-manifest.tgz -C /etc/crd-manifest; + rm /etc/crd-manifest/crd-manifest.tgz; + kubectl delete -Rf /etc/crd-manifest; volumeMounts: - name: crd-manifest readOnly: true diff --git a/packages/rancher-monitoring/templates/crd-template/templates/manifest.yaml b/packages/rancher-monitoring/templates/crd-template/templates/manifest.yaml index 31016b6ef..da70c253a 100644 --- a/packages/rancher-monitoring/templates/crd-template/templates/manifest.yaml +++ b/packages/rancher-monitoring/templates/crd-template/templates/manifest.yaml @@ -4,11 +4,5 @@ metadata: name: {{ .Chart.Name }}-manifest namespace: {{ .Release.Namespace }} data: - crd-manifest.yaml: | - {{- $currentScope := . -}} - {{- $crds := (.Files.Glob "crd-manifest/**.yaml") -}} - {{- range $path, $_ := $crds -}} - {{- with $currentScope -}} - {{ .Files.Get $path | nindent 4 }} - --- - {{- end -}}{{- end -}} + crd-manifest.tgz: + {{- .Files.Get "files/crd-manifest.tgz" | b64enc | indent 4 }}