diff --git a/charts/ska-tango-images/Chart.yaml b/charts/ska-tango-images/Chart.yaml index 5364bceb0ce1a2dac7e0e9b75d5fea253877dd06..bacd88923ff79da55a9297233bd6aeabfac95141 100644 --- a/charts/ska-tango-images/Chart.yaml +++ b/charts/ska-tango-images/Chart.yaml @@ -2,10 +2,10 @@ apiVersion: v2 appVersion: "1.0" description: A Helm chart for deploying the TANGO base system on Kubernetes name: ska-tango-images -version: 0.1.11 +version: 0.1.0 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png dependencies: - name: tango-base - version: 0.2.12 + version: 0.2.13 repository: file://../tango-base condition: tango-base.enabled,global.sub-system.tango-base.enabled \ No newline at end of file diff --git a/charts/tango-base/Chart.yaml b/charts/tango-base/Chart.yaml index f17849dc209779435a8abbf1ac47d27b66bfef2e..a37b8c8e78d7cc8ad00a0949d02249e35bb2f1b1 100644 --- a/charts/tango-base/Chart.yaml +++ b/charts/tango-base/Chart.yaml @@ -2,9 +2,9 @@ apiVersion: v2 appVersion: "1.0" description: A Helm chart for deploying the TANGO base system on Kubernetes name: tango-base -version: 0.2.12 +version: 0.2.13 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png dependencies: - name: tango-util - version: 0.2.8 + version: 0.2.9 repository: file://../tango-util diff --git a/charts/tango-util/Chart.yaml b/charts/tango-util/Chart.yaml index fed31b98dbc62d99c10c2387e417dd13c86bb450..0bdc4e074ce9cd3a759b4e38ef3a72200b3314c6 100644 --- a/charts/tango-util/Chart.yaml +++ b/charts/tango-util/Chart.yaml @@ -2,8 +2,8 @@ apiVersion: v2 description: A Helm chart library of utilities for TANGO deployents name: tango-util type: library -appVersion: 0.2.8 -version: 0.2.8 +appVersion: 0.2.9 +version: 0.2.9 icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png maintainers: - name: Matteo Di Carlo diff --git a/charts/tango-util/templates/_configuration.yaml b/charts/tango-util/templates/_configuration.yaml index e8938ecce53158307740994ce6f2327b6ee33965..cb585c8625fa237f9d629d9732af029e49e52b81 100644 --- a/charts/tango-util/templates/_configuration.yaml +++ b/charts/tango-util/templates/_configuration.yaml @@ -5,6 +5,39 @@ {{ $default_tango_host := printf "%s-%s" "databaseds-tango-base-" .Release.Name }} {{ $tango_host := tpl (coalesce .Values.global.tango_host .Values.tango_host $default_tango_host | toString) . }} {{ $itango := coalesce .Values.global.itango .Values.itango}} +--- +apiVersion: v1 +kind: ServiceAccount +metadata: + name: {{ .Values.subsystem }}-sa-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} + +--- +kind: RoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ .Values.subsystem }}-role-bind-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +subjects: +- kind: ServiceAccount + name: {{ .Values.subsystem }}-sa-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: {{ .Values.subsystem }}-role-{{ .Release.Name }} + apiGroup: rbac.authorization.k8s.io +--- + +kind: Role +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: {{ .Values.subsystem }}-role-{{ .Release.Name }} + namespace: {{ .Release.Namespace }} +rules: +- apiGroups: ["", "batch", "apps"] + resources: ["jobs"] + verbs: ["list", "get", "watch"] + --- # Device Server configurations apiVersion: v1 @@ -105,4 +138,4 @@ spec: name: {{ .Values.subsystem }}-configuration-{{ .Release.Name }} restartPolicy: Never -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/tango-util/templates/_deviceserver.yaml b/charts/tango-util/templates/_deviceserver.yaml index 5d46ba552cef5a08d3da98f11695123400921ac1..642b8757c8bab9e49b074184ad5164c1f570d8b7 100644 --- a/charts/tango-util/templates/_deviceserver.yaml +++ b/charts/tango-util/templates/_deviceserver.yaml @@ -62,7 +62,20 @@ spec: annotations: {{ toYaml $annotations | indent 8 }} spec: + {{ if $chart.Values.dsconfig.configuration_file }} + serviceAccountName: {{ $chart.Values.subsystem }}-sa-{{ $chart.Release.Name }} + {{ end }} initContainers: + {{ if $chart.Values.dsconfig.configuration_file }} + - name: wait-for-configuration + image: "bitnami/kubectl:latest" + imagePullPolicy: IfNotPresent + command: + - sh + - -c + args: + - kubectl wait job --for=condition=complete {{ $chart.Values.subsystem }}-configuration-{{ $chart.Release.Name }} {{ if $chart.Values.dsconfig.timeout }} --timeout={{ $chart.Values.dsconfig.timeout }} {{ end }} + {{ end }} {{ if (.deviceserver.depends_on) }} {{ range $index, $device := .deviceserver.depends_on }} {{ if ($device.host) }} @@ -151,4 +164,4 @@ spec: {{ toYaml . | indent 8 }} {{- end }} -{{ end }} \ No newline at end of file +{{ end }}