Skip to content
Snippets Groups Projects
Commit 103f9252 authored by Adriaan de Beer's avatar Adriaan de Beer
Browse files

AT-47 ska- prefix in all template files

parent 21278e91
No related branches found
No related tags found
No related merge requests found
...@@ -15,3 +15,9 @@ charts/ska-tango-images/Chart.lock ...@@ -15,3 +15,9 @@ charts/ska-tango-images/Chart.lock
charts/repository/* charts/repository/*
charts/tango-base/charts/* charts/tango-base/charts/*
charts/tango-base/Chart.lock charts/tango-base/Chart.lock
charts/ska-tango-base/secrets/tls.crt
charts/ska-tango-base/secrets/tls.key
charts/ska-tango-base/charts/tango-util-0.1.0.tgz
charts/ska-tango-base/charts/*
charts/ska-tango-base/Chart.lock
\ No newline at end of file
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
{{/* {{/*
Expand the name of the chart. Expand the name of the chart.
*/}} */}}
{{- define "tango-base.name" -}} {{- define "ska-tango-base.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
{{/* {{/*
...@@ -14,7 +14,7 @@ Create a default fully qualified app name. ...@@ -14,7 +14,7 @@ Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name. If release name contains chart name it will be used as a full name.
*/}} */}}
{{- define "tango-base.fullname" -}} {{- define "ska-tango-base.fullname" -}}
{{- if .Values.fullnameOverride -}} {{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}} {{- else -}}
...@@ -29,9 +29,9 @@ If release name contains chart name it will be used as a full name. ...@@ -29,9 +29,9 @@ If release name contains chart name it will be used as a full name.
{{/* {{/*
Common labels Common labels
*/}} */}}
{{- define "tango-base.labels" }} {{- define "ska-tango-base.labels" }}
app: {{ template "tango-base.name" . }} app: {{ template "ska-tango-base.name" . }}
chart: {{ template "tango-base.chart" . }} chart: {{ template "ska-tango-base.chart" . }}
release: {{ .Release.Name }} release: {{ .Release.Name }}
heritage: {{ .Release.Service }} heritage: {{ .Release.Service }}
system: {{ .Values.system }} system: {{ .Values.system }}
...@@ -40,6 +40,6 @@ telescope: {{ .Values.telescope }} ...@@ -40,6 +40,6 @@ telescope: {{ .Values.telescope }}
{{/* {{/*
Create chart name and version as used by the chart label. Create chart name and version as used by the chart label.
*/}} */}}
{{- define "tango-base.chart" -}} {{- define "ska-tango-base.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}} {{- end -}}
...@@ -72,7 +72,7 @@ spec: ...@@ -72,7 +72,7 @@ spec:
- --sleep={{$sleep}} - --sleep={{$sleep}}
- -- - --
- /usr/local/bin/wait-for-it.sh - /usr/local/bin/wait-for-it.sh
- {{ template "tango-base.name" . }}-{{ .Values.tangodb.component }}:3306 - {{ template "ska-tango-base.name" . }}-{{ .Values.tangodb.component }}:3306
- --timeout=60 - --timeout=60
- --strict - --strict
- -- - --
...@@ -82,7 +82,7 @@ spec: ...@@ -82,7 +82,7 @@ spec:
- giop:tcp::10000 - giop:tcp::10000
env: env:
- name: MYSQL_HOST - name: MYSQL_HOST
value: "{{ template "tango-base.name" . }}-{{ .Values.tangodb.component }}:3306" value: "{{ template "ska-tango-base.name" . }}-{{ .Values.tangodb.component }}:3306"
- name: MYSQL_DATABASE - name: MYSQL_DATABASE
value: "{{ .Values.tangodb.db.db }}" value: "{{ .Values.tangodb.db.db }}"
- name: MYSQL_USER - name: MYSQL_USER
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
apiVersion: networking.k8s.io/v1 apiVersion: networking.k8s.io/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: rest-api-{{ template "tango-base.name" . }}-{{ .Release.Name }} name: rest-api-{{ template "ska-tango-base.name" . }}-{{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
...@@ -24,7 +24,7 @@ spec: ...@@ -24,7 +24,7 @@ spec:
pathType: Prefix pathType: Prefix
backend: backend:
service: service:
name: {{ template "tango-base.name" . }}-{{ .Values.tangorest.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.tangorest.component }}
port: port:
number: 8080 number: 8080
{{ else }} {{ else }}
...@@ -32,7 +32,7 @@ spec: ...@@ -32,7 +32,7 @@ spec:
apiVersion: extensions/v1 apiVersion: extensions/v1
kind: Ingress kind: Ingress
metadata: metadata:
name: rest-api-{{ template "tango-base.name" . }}-{{ .Release.Name }} name: rest-api-{{ template "ska-tango-base.name" . }}-{{ .Release.Name }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
...@@ -52,7 +52,7 @@ spec: ...@@ -52,7 +52,7 @@ spec:
pathType: Prefix pathType: Prefix
backend: backend:
service: service:
name: {{ template "tango-base.name" . }}-{{ .Values.tangorest.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.tangorest.component }}
port: port:
number: 8080 number: 8080
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.itango.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.itango.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.jive.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.jive.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
apiVersion: v1 apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.logviewer.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.logviewer.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.tangorest.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.tangorest.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
...@@ -32,7 +32,7 @@ spec: ...@@ -32,7 +32,7 @@ spec:
apiVersion: apps/v1 apiVersion: apps/v1
kind: Deployment kind: Deployment
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.tangorest.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.tangorest.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
kind: PersistentVolume kind: PersistentVolume
apiVersion: v1 apiVersion: v1
metadata: metadata:
name: {{ template "tango-base.name" . }}-tangodb-storage name: {{ template "ska-tango-base.name" . }}-tangodb-storage
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
...@@ -20,14 +20,14 @@ spec: ...@@ -20,14 +20,14 @@ spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
hostPath: hostPath:
path: {{ template "tango-base.name" . }}-tangodb-storage-{{ .Release.Name }}/ path: {{ template "ska-tango-base.name" . }}-tangodb-storage-{{ .Release.Name }}/
{{ end }} {{ end }}
--- ---
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: {{ template "tango-base.name" . }}-tangodb-storage name: {{ template "ska-tango-base.name" . }}-tangodb-storage
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 4 }}
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.tangodb.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.tangodb.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
component: {{ .Values.tangodb.component }} component: {{ .Values.tangodb.component }}
...@@ -31,7 +31,7 @@ spec: ...@@ -31,7 +31,7 @@ spec:
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.tangodb.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.tangodb.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
component: {{ .Values.tangodb.component }} component: {{ .Values.tangodb.component }}
...@@ -49,7 +49,7 @@ spec: ...@@ -49,7 +49,7 @@ spec:
domain: {{ .Values.tangodb.domain }} domain: {{ .Values.tangodb.domain }}
intent: {{ .Values.tangodb.intent }} intent: {{ .Values.tangodb.intent }}
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 6 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 6 }}
serviceName: {{ template "tango-base.name" . }}-{{ .Values.tangodb.component }} serviceName: {{ template "ska-tango-base.name" . }}-{{ .Values.tangodb.component }}
replicas: 1 replicas: 1
template: template:
metadata: metadata:
...@@ -111,7 +111,7 @@ spec: ...@@ -111,7 +111,7 @@ spec:
{{ if .Values.tangodb.use_pv }} {{ if .Values.tangodb.use_pv }}
- name: data - name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ template "tango-base.name" . }}-tangodb-storage claimName: {{ template "ska-tango-base.name" . }}-tangodb-storage
{{ end }} {{ end }}
{{- with .Values.nodeSelector }} {{- with .Values.nodeSelector }}
nodeSelector: nodeSelector:
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.vnc.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.vnc.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
component: {{ .Values.vnc.component }} component: {{ .Values.vnc.component }}
...@@ -40,7 +40,7 @@ spec: ...@@ -40,7 +40,7 @@ spec:
apiVersion: apps/v1 apiVersion: apps/v1
kind: StatefulSet kind: StatefulSet
metadata: metadata:
name: {{ template "tango-base.name" . }}-{{ .Values.vnc.component }} name: {{ template "ska-tango-base.name" . }}-{{ .Values.vnc.component }}
namespace: {{ .Release.Namespace }} namespace: {{ .Release.Namespace }}
labels: labels:
component: {{ .Values.vnc.component }} component: {{ .Values.vnc.component }}
...@@ -58,7 +58,7 @@ spec: ...@@ -58,7 +58,7 @@ spec:
domain: {{ .Values.vnc.domain }} domain: {{ .Values.vnc.domain }}
intent: {{ .Values.vnc.intent }} intent: {{ .Values.vnc.intent }}
{{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 6 }} {{ toYaml (coalesce .Values.global.labels .Values.labels "label:none") | indent 6 }}
serviceName: {{ template "tango-base.name" . }}-{{ .Values.vnc.component }} serviceName: {{ template "ska-tango-base.name" . }}-{{ .Values.vnc.component }}
replicas: {{ .Values.vnc.replicas }} replicas: {{ .Values.vnc.replicas }}
template: template:
metadata: metadata:
......
...@@ -44,8 +44,8 @@ Below there is an example of a values file that can be used with the tango-util ...@@ -44,8 +44,8 @@ Below there is an example of a values file that can be used with the tango-util
deviceServers: deviceServers:
theexample: theexample:
name: "theexample-{{.Release.Name}}" name: "theexample-{{.Release.Name}}"
function: tango-example-powersupply function: ska-tango-example-powersupply
domain: tango-example domain: ska-tango-example
instances: ["test"] instances: ["test"]
polling: 1000 polling: 1000
entrypoints: entrypoints:
...@@ -134,7 +134,7 @@ The device server configuration, like the above one, needs to be added to the va ...@@ -134,7 +134,7 @@ The device server configuration, like the above one, needs to be added to the va
file: "data/theexample.yaml" file: "data/theexample.yaml"
Fields explained: Fields explained:
- **file** : This field specifies the path of the device server configuration block as shown above. Note:. This file should be included in a `data folder <https://gitlab.com/ska-telescope/tango-example/-/tree/master/charts/tango-example/data>`__ inside the chart. - **file** : This field specifies the path of the device server configuration block as shown above. Note:. This file should be included in a `data folder <https://gitlab.com/ska-telescope/ska-tango-example/-/tree/master/charts/ska-tango-example/data>`__ inside the chart.
- **polling** : This field is referenced in the above device server configuration block. In fact the tango-util device server definition template some of the field composing it (like the properties). In the above example the *polled_attr* property of the *test/motor/1* device takes its value from this field. As a consequence, this field allows us to change the value of the *polled_attr* property in the parent chart. - **polling** : This field is referenced in the above device server configuration block. In fact the tango-util device server definition template some of the field composing it (like the properties). In the above example the *polled_attr* property of the *test/motor/1* device takes its value from this field. As a consequence, this field allows us to change the value of the *polled_attr* property in the parent chart.
- **instances** : If **instances** has values ​​in the value file, this takes precedence over the data file **instances** field. - **instances** : If **instances** has values ​​in the value file, this takes precedence over the data file **instances** field.
...@@ -145,8 +145,8 @@ The helm template multidevice-config creates a ConfigMap which contains the gene ...@@ -145,8 +145,8 @@ The helm template multidevice-config creates a ConfigMap which contains the gene
How to use the defined helm named template How to use the defined helm named template
++++++++++++++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++++++++++++++
A example on how to set up your k8s namespace with the helm named templates, described in the beginning of this `section <#the-tango-util-helm-chart>`_, can be seen on `tango-example <https://gitlab.com/ska-telescope/tango-example>`_ repository. A example on how to set up your k8s namespace with the helm named templates, described in the beginning of this `section <#the-tango-util-helm-chart>`_, can be seen on `ska-tango-example <https://gitlab.com/ska-telescope/ska-tango-example>`_ repository.
This templates are called by the below `template <https://gitlab.com/ska-telescope/tango-example/-/blob/master/charts/tango-example/templates/deviceservers.yaml>`_ present on the tango-example repository: This templates are called by the below `template <https://gitlab.com/ska-telescope/ska-tango-example/-/blob/master/charts/ska-tango-example/templates/deviceservers.yaml>`_ present on the ska-tango-example repository:
.. code-block:: console .. code-block:: console
:linenos: :linenos:
...@@ -160,19 +160,19 @@ This templates are called by the below `template <https://gitlab.com/ska-telesco ...@@ -160,19 +160,19 @@ This templates are called by the below `template <https://gitlab.com/ska-telesco
{{- $filedeviceserver := $.Files.Get $deviceserver.file | fromYaml }} {{- $filedeviceserver := $.Files.Get $deviceserver.file | fromYaml }}
{{- $_ := set $filedeviceserver "instances" (coalesce $localchart.Values.global.instances $deviceserver.instances $filedeviceserver.instances) }} {{- $_ := set $filedeviceserver "instances" (coalesce $localchart.Values.global.instances $deviceserver.instances $filedeviceserver.instances) }}
{{- $context := dict "name" $key "deviceserver" $filedeviceserver "image" $deviceserver.image "local" $localchart }} {{- $context := dict "name" $key "deviceserver" $filedeviceserver "image" $deviceserver.image "local" $localchart }}
{{ template "tango-util.multidevice-config.tpl" $context }} {{ template "ska-tango-util.multidevice-config.tpl" $context }}
{{ template "tango-util.multidevice-sacc-role.tpl" $context }} {{ template "ska-tango-util.multidevice-sacc-role.tpl" $context }}
{{ template "tango-util.multidevice-job.tpl" $context }} {{ template "ska-tango-util.multidevice-job.tpl" $context }}
{{ template "tango-util.multidevice-svc.tpl" $context }} {{ template "ska-tango-util.multidevice-svc.tpl" $context }}
{{- else }} {{- else }}
{{- $_ := set $deviceserver "instances" (coalesce $localchart.Values.global.instances $deviceserver.instances) }} {{- $_ := set $deviceserver "instances" (coalesce $localchart.Values.global.instances $deviceserver.instances) }}
{{- $context := dict "name" $key "deviceserver" $deviceserver "image" $deviceserver.image "local" $localchart }} {{- $context := dict "name" $key "deviceserver" $deviceserver "image" $deviceserver.image "local" $localchart }}
{{ template "tango-util.multidevice-config.tpl" $context }} {{ template "ska-tango-util.multidevice-config.tpl" $context }}
{{ template "tango-util.multidevice-sacc-role.tpl" $context }} {{ template "ska-tango-util.multidevice-sacc-role.tpl" $context }}
{{ template "tango-util.multidevice-job.tpl" $context }} {{ template "ska-tango-util.multidevice-job.tpl" $context }}
{{ template "tango-util.multidevice-svc.tpl" $context }} {{ template "ska-tango-util.multidevice-svc.tpl" $context }}
{{- end }} {{- end }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment