Browse Source

Chart: Modernise chart

This PS updates the maas chart to support modern helm toolkits.

Change-Id: Id70343afdec622dc84b89b0d7f496e9ef498ea6b
Signed-off-by: Pete Birley <pete@port.direct>
Pete Birley 8 months ago
parent
commit
582c4d8b20

+ 2
- 3
charts/maas/templates/job-bootstrap-admin-user.yaml View File

@@ -16,9 +16,8 @@ limitations under the License.
16 16
 */}}
17 17
 
18 18
 {{- $envAll := . }}
19
-{{- $dependencies := .Values.dependencies.bootstrap_admin_user }}
20 19
 {{- $serviceAccountName := "maas-bootstrap-admin-user" }}
21
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20
+{{ tuple $envAll "bootstrap_admin_user" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
22 21
 ---
23 22
 apiVersion: batch/v1
24 23
 kind: Job
@@ -35,7 +34,7 @@ spec:
35 34
       nodeSelector:
36 35
         {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 36
       initContainers:
38
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
37
+{{ tuple $envAll "bootstrap_admin_user" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
39 38
       containers:
40 39
         - name: maas-bootstrap-admin-user
41 40
           image: {{ .Values.images.tags.bootstrap }}

+ 3
- 4
charts/maas/templates/job-db-init.yaml View File

@@ -16,9 +16,8 @@ limitations under the License.
16 16
 */}}
17 17
 
18 18
 {{- $envAll := . }}
19
-{{- $dependencies := .Values.dependencies.db_init }}
20 19
 {{- $serviceAccountName := "maas-db-init" }}
21
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20
+{{ tuple $envAll "db_init" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
22 21
 ---
23 22
 apiVersion: batch/v1
24 23
 kind: Job
@@ -35,12 +34,12 @@ spec:
35 34
       nodeSelector:
36 35
         {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 36
       initContainers:
38
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
37
+{{ tuple $envAll "db_init" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
39 38
       containers:
40 39
         - name: maas-db-init
41 40
           image: {{ .Values.images.tags.db_init | quote }}
42 41
           imagePullPolicy: {{ .Values.images.pull_policy | quote }}
43
-{{ tuple $envAll $envAll.Values.pod.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
42
+{{ tuple $envAll "db_init" | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
44 43
           env:
45 44
             - name: ROOT_DB_USER
46 45
               valueFrom:

+ 3
- 4
charts/maas/templates/job-db-sync.yaml View File

@@ -16,9 +16,8 @@ limitations under the License.
16 16
 */}}
17 17
 
18 18
 {{- $envAll := . }}
19
-{{- $dependencies := .Values.dependencies.db_sync }}
20 19
 {{- $serviceAccountName := "maas-db-sync" }}
21
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20
+{{ tuple $envAll "db_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
22 21
 ---
23 22
 apiVersion: batch/v1
24 23
 kind: Job
@@ -35,12 +34,12 @@ spec:
35 34
       nodeSelector:
36 35
         {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 36
       initContainers:
38
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
37
+{{ tuple $envAll "db_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
39 38
       containers:
40 39
         - name: maas-db-sync
41 40
           image: {{ .Values.images.tags.db_sync }}
42 41
           imagePullPolicy: {{ .Values.images.pull_policy }}
43
-{{ tuple $envAll $envAll.Values.pod.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
42
+{{ tuple $envAll "db_sync" | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
44 43
           command:
45 44
             - /tmp/db-sync.sh
46 45
           volumeMounts:

+ 5
- 11
charts/maas/templates/job-export-api-key.yaml View File

@@ -16,25 +16,19 @@ limitations under the License.
16 16
 */}}
17 17
 
18 18
 {{- $envAll := . }}
19
-{{- $dependencies := .Values.dependencies.export_api_key }}
20 19
 {{- $initMounts := .Values.pod.mounts.export_api_key.export_api_key }}
21 20
 {{- $serviceAccountName := "maas-export-api-key" }}
22
----
23
-apiVersion: v1
24
-kind: ServiceAccount
25
-metadata:
26
-  name: {{ $serviceAccountName }}
27
-  namespace: {{ $envAll.Release.Namespace }}
21
+{{ tuple $envAll "export_api_key" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
28 22
 ---
29 23
 apiVersion: rbac.authorization.k8s.io/v1beta1
30 24
 kind: RoleBinding
31 25
 metadata:
32
-  name: {{ $envAll.Release.Name }}-{{ $serviceAccountName }}
26
+  name: {{ $envAll.Release.Name }}-{{ $serviceAccountName }}-job
33 27
   namespace: {{ $envAll.Release.Namespace }}
34 28
 roleRef:
35 29
   apiGroup: rbac.authorization.k8s.io
36 30
   kind: Role
37
-  name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}
31
+  name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}}-job
38 32
 subjects:
39 33
   - kind: ServiceAccount
40 34
     name: {{ $serviceAccountName }}
@@ -43,7 +37,7 @@ subjects:
43 37
 apiVersion: rbac.authorization.k8s.io/v1beta1
44 38
 kind: Role
45 39
 metadata:
46
-  name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}
40
+  name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}}-job
47 41
   namespace: {{ $envAll.Release.Namespace }}
48 42
 rules:
49 43
   - apiGroups:
@@ -84,7 +78,7 @@ spec:
84 78
       nodeSelector:
85 79
         {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
86 80
       initContainers:
87
-{{ tuple $envAll $dependencies $initMounts | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
81
+{{ tuple $envAll "export_api_key" $initMounts | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
88 82
       containers:
89 83
         - name: exporter
90 84
           image: {{ .Values.images.tags.export_api_key }}

+ 2
- 3
charts/maas/templates/job-import.yaml View File

@@ -16,9 +16,8 @@ limitations under the License.
16 16
 */}}
17 17
 
18 18
 {{- $envAll := . }}
19
-{{- $dependencies := .Values.dependencies.import_resources }}
20 19
 {{- $serviceAccountName := "maas-import-resources" }}
21
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
20
+{{ tuple $envAll "import_resources" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
22 21
 ---
23 22
 apiVersion: batch/v1
24 23
 kind: Job
@@ -35,7 +34,7 @@ spec:
35 34
       nodeSelector:
36 35
         {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 36
       initContainers:
38
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
37
+{{ tuple $envAll "import_resources" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
39 38
       containers:
40 39
         - name: region-import-resources
41 40
           image: {{ .Values.images.tags.maas_region }}

+ 2
- 3
charts/maas/templates/statefulset-rack.yaml View File

@@ -20,12 +20,11 @@ limitations under the License.
20 20
 {{- tuple "maas_region_ui" "default" "region_ui" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" | set .Values.conf.maas.url "maas_url" | quote | trunc 0 -}}
21 21
 {{- end -}}
22 22
 {{- $envAll := . }}
23
-{{- $dependencies := .Values.dependencies.rack_controller }}
24 23
 {{- $serviceAccountName := "maas-rack" }}
25 24
 {{- $mounts_maas_rack := .Values.pod.mounts.maas_rack }}
26 25
 {{- $mounts_maas_rack_init := .Values.pod.mounts.maas_rack.init_container }}
27 26
 
28
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
27
+{{ tuple $envAll "rack_controller" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
29 28
 ---
30 29
 apiVersion: apps/v1beta1
31 30
 kind: StatefulSet
@@ -52,7 +51,7 @@ spec:
52 51
       hostNetwork: true
53 52
       dnsPolicy: ClusterFirst
54 53
       initContainers:
55
-{{ tuple $envAll $dependencies $mounts_maas_rack_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
54
+{{ tuple $envAll "rack_controller" $mounts_maas_rack_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
56 55
       containers:
57 56
         - name: maas-rack
58 57
           image: {{ .Values.images.tags.maas_rack }}

+ 2
- 3
charts/maas/templates/statefulset-region.yaml View File

@@ -14,12 +14,11 @@
14 14
 # limitations under the License. */}}
15 15
 {{- if .Values.manifests.region_statefulset }}
16 16
 {{- $envAll := . }}
17
-{{- $dependencies := .Values.dependencies.region_controller }}
18 17
 {{- $serviceAccountName := "maas-region" }}
19 18
 {{- $mounts_maas_region := .Values.pod.mounts.maas_region.maas_region }}
20 19
 {{- $mounts_maas_region_init := .Values.pod.mounts.maas_region.init_container }}
21 20
 
22
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
21
+{{ tuple $envAll "region_controller" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23 22
 ---
24 23
 apiVersion: apps/v1beta1
25 24
 kind: StatefulSet
@@ -42,7 +41,7 @@ spec:
42 41
       nodeSelector:
43 42
         {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
44 43
       initContainers:
45
-{{ tuple $envAll $dependencies $mounts_maas_region_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
44
+{{ tuple $envAll "region_controller" $mounts_maas_region_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
46 45
       containers:
47 46
 {{- if .Values.conf.cache.enabled }}
48 47
         - name: maas-cache

+ 49
- 43
charts/maas/values.yaml View File

@@ -18,49 +18,50 @@
18 18
 # Declare variables to be passed into your templates.
19 19
 
20 20
 dependencies:
21
-  rack_controller:
22
-    jobs:
23
-      - maas-db-sync
24
-    services:
25
-      - service: maas_region_ui
26
-        endpoint: internal
27
-  region_controller:
28
-    jobs:
29
-      - maas-db-sync
30
-    services:
31
-      - service: maas_db
32
-        endpoint: internal
33
-  db_init:
34
-    services:
35
-      - service: maas_db
36
-        endpoint: internal
37
-  db_sync:
38
-    jobs:
39
-      - maas-db-init
40
-  bootstrap_admin_user:
41
-    jobs:
42
-      - maas-db-sync
43
-    services:
44
-      - service: maas_region_ui
45
-        endpoint: internal
46
-      - service: maas_db
47
-        endpoint: internal
48
-  import_resources:
49
-    jobs:
50
-      - maas-db-sync
51
-    services:
52
-      - service: maas_region_ui
53
-        endpoint: internal
54
-      - service: maas_db
55
-        endpoint: internal
56
-  export_api_key:
57
-    jobs:
58
-      - maas-db-sync
59
-    services:
60
-      - service: maas_region_ui
61
-        endpoint: internal
62
-      - service: maas_db
63
-        endpoint: internal
21
+  static:
22
+    rack_controller:
23
+      jobs:
24
+        - maas-db-sync
25
+      services:
26
+        - service: maas_region_ui
27
+          endpoint: internal
28
+    region_controller:
29
+      jobs:
30
+        - maas-db-sync
31
+      services:
32
+        - service: maas_db
33
+          endpoint: internal
34
+    db_init:
35
+      services:
36
+        - service: maas_db
37
+          endpoint: internal
38
+    db_sync:
39
+      jobs:
40
+        - maas-db-init
41
+    bootstrap_admin_user:
42
+      jobs:
43
+        - maas-db-sync
44
+      services:
45
+        - service: maas_region_ui
46
+          endpoint: internal
47
+        - service: maas_db
48
+          endpoint: internal
49
+    import_resources:
50
+      jobs:
51
+        - maas-db-sync
52
+      services:
53
+        - service: maas_region_ui
54
+          endpoint: internal
55
+        - service: maas_db
56
+          endpoint: internal
57
+    export_api_key:
58
+      jobs:
59
+        - maas-db-sync
60
+      services:
61
+        - service: maas_region_ui
62
+          endpoint: internal
63
+        - service: maas_db
64
+          endpoint: internal
64 65
 
65 66
 manifests:
66 67
   region_statefulset: true
@@ -79,6 +80,11 @@ images:
79 80
     maas_cache: quay.io/attcomdev/sstream-cache:latest
80 81
     dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
81 82
   pull_policy: IfNotPresent
83
+  local_registry:
84
+    # TODO(portdirect): this chart does not yet support local image cacheing
85
+    active: false
86
+    exclude:
87
+      - dep_check
82 88
 
83 89
 jobs:
84 90
   import_boot_resources:

+ 4
- 4
tools/helm_tk.sh View File

@@ -16,9 +16,9 @@
16 16
 # Script to setup helm-toolkit and helm dep up the shipyard chart
17 17
 #
18 18
 HELM=$1
19
-HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm"}
19
+HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm-infra"}
20 20
 HTK_PATH=${HTK_PATH:-""}
21
-HTK_STABLE_COMMIT=${HTK_COMMIT:-"f902cd14fac7de4c4c9f7d019191268a6b4e9601"}
21
+HTK_STABLE_COMMIT=${HTK_COMMIT:-"master"}
22 22
 DEP_UP_LIST=${DEP_UP_LIST:-"maas"}
23 23
 
24 24
 if [[ ! -z $(echo $http_proxy) ]]
@@ -59,8 +59,8 @@ fi
59 59
 
60 60
 mkdir -p build
61 61
 pushd build
62
-git clone $HTK_REPO || true
63
-pushd openstack-helm/$HTK_PATH
62
+git clone $HTK_REPO ./htk-repo || true
63
+pushd ./htk-repo/$HTK_PATH
64 64
 git reset --hard "${HTK_STABLE_COMMIT}"
65 65
 
66 66
 helm_serve

Loading…
Cancel
Save