jcasc-config.yaml 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. {{- $root := . }}
  2. {{- if .Values.controller.sidecars.configAutoReload.enabled }}
  3. {{- range $key, $val := .Values.controller.JCasC.configScripts }}
  4. {{- if $val }}
  5. ---
  6. apiVersion: v1
  7. kind: ConfigMap
  8. metadata:
  9. name: {{ template "jenkins.casc.configName" (list (printf "config-%s" $key) $ )}}
  10. namespace: {{ template "jenkins.namespace" $root }}
  11. labels:
  12. "app.kubernetes.io/name": {{ template "jenkins.name" $root}}
  13. {{- if $root.Values.renderHelmLabels }}
  14. "helm.sh/chart": "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}"
  15. {{- end }}
  16. "app.kubernetes.io/managed-by": "{{ $.Release.Service }}"
  17. "app.kubernetes.io/instance": "{{ $.Release.Name }}"
  18. "app.kubernetes.io/component": "{{ $.Values.controller.componentName }}"
  19. {{ template "jenkins.fullname" $root }}-jenkins-config: "true"
  20. data:
  21. {{ $key }}.yaml: |-
  22. {{ tpl $val $| indent 4 }}
  23. {{- end }}
  24. {{- end }}
  25. {{- if .Values.controller.JCasC.defaultConfig }}
  26. ---
  27. apiVersion: v1
  28. kind: ConfigMap
  29. metadata:
  30. name: {{ template "jenkins.casc.configName" (list "jcasc-config" $ )}}
  31. namespace: {{ template "jenkins.namespace" $root }}
  32. labels:
  33. "app.kubernetes.io/name": {{ template "jenkins.name" $root}}
  34. {{- if .Values.renderHelmLabels }}
  35. "helm.sh/chart": "{{ $root.Chart.Name }}-{{ $root.Chart.Version }}"
  36. {{- end }}
  37. "app.kubernetes.io/managed-by": "{{ $.Release.Service }}"
  38. "app.kubernetes.io/instance": "{{ $.Release.Name }}"
  39. "app.kubernetes.io/component": "{{ $.Values.controller.componentName }}"
  40. {{ template "jenkins.fullname" $root }}-jenkins-config: "true"
  41. data:
  42. jcasc-default-config.yaml: |-
  43. {{- include "jenkins.casc.defaults" . |nindent 4 }}
  44. {{- end}}
  45. {{- end }}