summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Birley <pete@port.direct>2018-08-22 21:37:06 -0500
committerPete Birley <pete@port.direct>2018-08-22 21:53:33 -0500
commit582c4d8b2077849ec4dae04ebcb71ab9ed955821 (patch)
tree67896580dca146c0748cb17cef6c08316d7bec06
parentc585c525bc8f50bf0e5d8b2e7b5108ae4456d6fb (diff)
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>
Notes
Notes (review): Code-Review+1: Steve Wilkerson <wilkers.steve@gmail.com> Code-Review+2: Scott Hussey <sthussey@att.com> Code-Review+2: Aaron Sheffield <ajs@sheffieldfamily.net> Workflow+1: Aaron Sheffield <ajs@sheffieldfamily.net> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 12 Sep 2018 13:01:35 +0000 Reviewed-on: https://review.openstack.org/595398 Project: openstack/airship-maas Branch: refs/heads/master
-rw-r--r--charts/maas/templates/job-bootstrap-admin-user.yaml5
-rw-r--r--charts/maas/templates/job-db-init.yaml7
-rw-r--r--charts/maas/templates/job-db-sync.yaml7
-rw-r--r--charts/maas/templates/job-export-api-key.yaml16
-rw-r--r--charts/maas/templates/job-import.yaml5
-rw-r--r--charts/maas/templates/statefulset-rack.yaml5
-rw-r--r--charts/maas/templates/statefulset-region.yaml5
-rw-r--r--charts/maas/values.yaml92
-rwxr-xr-xtools/helm_tk.sh8
9 files changed, 72 insertions, 78 deletions
diff --git a/charts/maas/templates/job-bootstrap-admin-user.yaml b/charts/maas/templates/job-bootstrap-admin-user.yaml
index fcdff9f..f890827 100644
--- a/charts/maas/templates/job-bootstrap-admin-user.yaml
+++ b/charts/maas/templates/job-bootstrap-admin-user.yaml
@@ -16,9 +16,8 @@ limitations under the License.
16*/}} 16*/}}
17 17
18{{- $envAll := . }} 18{{- $envAll := . }}
19{{- $dependencies := .Values.dependencies.bootstrap_admin_user }}
20{{- $serviceAccountName := "maas-bootstrap-admin-user" }} 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---
23apiVersion: batch/v1 22apiVersion: batch/v1
24kind: Job 23kind: Job
@@ -35,7 +34,7 @@ spec:
35 nodeSelector: 34 nodeSelector:
36 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} 35 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 initContainers: 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 containers: 38 containers:
40 - name: maas-bootstrap-admin-user 39 - name: maas-bootstrap-admin-user
41 image: {{ .Values.images.tags.bootstrap }} 40 image: {{ .Values.images.tags.bootstrap }}
diff --git a/charts/maas/templates/job-db-init.yaml b/charts/maas/templates/job-db-init.yaml
index 6a6090e..d8d265f 100644
--- a/charts/maas/templates/job-db-init.yaml
+++ b/charts/maas/templates/job-db-init.yaml
@@ -16,9 +16,8 @@ limitations under the License.
16*/}} 16*/}}
17 17
18{{- $envAll := . }} 18{{- $envAll := . }}
19{{- $dependencies := .Values.dependencies.db_init }}
20{{- $serviceAccountName := "maas-db-init" }} 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---
23apiVersion: batch/v1 22apiVersion: batch/v1
24kind: Job 23kind: Job
@@ -35,12 +34,12 @@ spec:
35 nodeSelector: 34 nodeSelector:
36 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} 35 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 initContainers: 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 containers: 38 containers:
40 - name: maas-db-init 39 - name: maas-db-init
41 image: {{ .Values.images.tags.db_init | quote }} 40 image: {{ .Values.images.tags.db_init | quote }}
42 imagePullPolicy: {{ .Values.images.pull_policy | quote }} 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 env: 43 env:
45 - name: ROOT_DB_USER 44 - name: ROOT_DB_USER
46 valueFrom: 45 valueFrom:
diff --git a/charts/maas/templates/job-db-sync.yaml b/charts/maas/templates/job-db-sync.yaml
index b491908..8e9e1b4 100644
--- a/charts/maas/templates/job-db-sync.yaml
+++ b/charts/maas/templates/job-db-sync.yaml
@@ -16,9 +16,8 @@ limitations under the License.
16*/}} 16*/}}
17 17
18{{- $envAll := . }} 18{{- $envAll := . }}
19{{- $dependencies := .Values.dependencies.db_sync }}
20{{- $serviceAccountName := "maas-db-sync" }} 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---
23apiVersion: batch/v1 22apiVersion: batch/v1
24kind: Job 23kind: Job
@@ -35,12 +34,12 @@ spec:
35 nodeSelector: 34 nodeSelector:
36 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} 35 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 initContainers: 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 containers: 38 containers:
40 - name: maas-db-sync 39 - name: maas-db-sync
41 image: {{ .Values.images.tags.db_sync }} 40 image: {{ .Values.images.tags.db_sync }}
42 imagePullPolicy: {{ .Values.images.pull_policy }} 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 command: 43 command:
45 - /tmp/db-sync.sh 44 - /tmp/db-sync.sh
46 volumeMounts: 45 volumeMounts:
diff --git a/charts/maas/templates/job-export-api-key.yaml b/charts/maas/templates/job-export-api-key.yaml
index ffbee36..ae065be 100644
--- a/charts/maas/templates/job-export-api-key.yaml
+++ b/charts/maas/templates/job-export-api-key.yaml
@@ -16,25 +16,19 @@ limitations under the License.
16*/}} 16*/}}
17 17
18{{- $envAll := . }} 18{{- $envAll := . }}
19{{- $dependencies := .Values.dependencies.export_api_key }}
20{{- $initMounts := .Values.pod.mounts.export_api_key.export_api_key }} 19{{- $initMounts := .Values.pod.mounts.export_api_key.export_api_key }}
21{{- $serviceAccountName := "maas-export-api-key" }} 20{{- $serviceAccountName := "maas-export-api-key" }}
22--- 21{{ tuple $envAll "export_api_key" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23apiVersion: v1
24kind: ServiceAccount
25metadata:
26 name: {{ $serviceAccountName }}
27 namespace: {{ $envAll.Release.Namespace }}
28--- 22---
29apiVersion: rbac.authorization.k8s.io/v1beta1 23apiVersion: rbac.authorization.k8s.io/v1beta1
30kind: RoleBinding 24kind: RoleBinding
31metadata: 25metadata:
32 name: {{ $envAll.Release.Name }}-{{ $serviceAccountName }} 26 name: {{ $envAll.Release.Name }}-{{ $serviceAccountName }}-job
33 namespace: {{ $envAll.Release.Namespace }} 27 namespace: {{ $envAll.Release.Namespace }}
34roleRef: 28roleRef:
35 apiGroup: rbac.authorization.k8s.io 29 apiGroup: rbac.authorization.k8s.io
36 kind: Role 30 kind: Role
37 name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }} 31 name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}}-job
38subjects: 32subjects:
39 - kind: ServiceAccount 33 - kind: ServiceAccount
40 name: {{ $serviceAccountName }} 34 name: {{ $serviceAccountName }}
@@ -43,7 +37,7 @@ subjects:
43apiVersion: rbac.authorization.k8s.io/v1beta1 37apiVersion: rbac.authorization.k8s.io/v1beta1
44kind: Role 38kind: Role
45metadata: 39metadata:
46 name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }} 40 name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}}-job
47 namespace: {{ $envAll.Release.Namespace }} 41 namespace: {{ $envAll.Release.Namespace }}
48rules: 42rules:
49 - apiGroups: 43 - apiGroups:
@@ -84,7 +78,7 @@ spec:
84 nodeSelector: 78 nodeSelector:
85 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} 79 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
86 initContainers: 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 containers: 82 containers:
89 - name: exporter 83 - name: exporter
90 image: {{ .Values.images.tags.export_api_key }} 84 image: {{ .Values.images.tags.export_api_key }}
diff --git a/charts/maas/templates/job-import.yaml b/charts/maas/templates/job-import.yaml
index eaba01a..b925827 100644
--- a/charts/maas/templates/job-import.yaml
+++ b/charts/maas/templates/job-import.yaml
@@ -16,9 +16,8 @@ limitations under the License.
16*/}} 16*/}}
17 17
18{{- $envAll := . }} 18{{- $envAll := . }}
19{{- $dependencies := .Values.dependencies.import_resources }}
20{{- $serviceAccountName := "maas-import-resources" }} 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---
23apiVersion: batch/v1 22apiVersion: batch/v1
24kind: Job 23kind: Job
@@ -35,7 +34,7 @@ spec:
35 nodeSelector: 34 nodeSelector:
36 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} 35 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
37 initContainers: 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 containers: 38 containers:
40 - name: region-import-resources 39 - name: region-import-resources
41 image: {{ .Values.images.tags.maas_region }} 40 image: {{ .Values.images.tags.maas_region }}
diff --git a/charts/maas/templates/statefulset-rack.yaml b/charts/maas/templates/statefulset-rack.yaml
index 1abdb10..a127ff8 100644
--- a/charts/maas/templates/statefulset-rack.yaml
+++ b/charts/maas/templates/statefulset-rack.yaml
@@ -20,12 +20,11 @@ limitations under the License.
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 -}} 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{{- end -}} 21{{- end -}}
22{{- $envAll := . }} 22{{- $envAll := . }}
23{{- $dependencies := .Values.dependencies.rack_controller }}
24{{- $serviceAccountName := "maas-rack" }} 23{{- $serviceAccountName := "maas-rack" }}
25{{- $mounts_maas_rack := .Values.pod.mounts.maas_rack }} 24{{- $mounts_maas_rack := .Values.pod.mounts.maas_rack }}
26{{- $mounts_maas_rack_init := .Values.pod.mounts.maas_rack.init_container }} 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---
30apiVersion: apps/v1beta1 29apiVersion: apps/v1beta1
31kind: StatefulSet 30kind: StatefulSet
@@ -52,7 +51,7 @@ spec:
52 hostNetwork: true 51 hostNetwork: true
53 dnsPolicy: ClusterFirst 52 dnsPolicy: ClusterFirst
54 initContainers: 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 containers: 55 containers:
57 - name: maas-rack 56 - name: maas-rack
58 image: {{ .Values.images.tags.maas_rack }} 57 image: {{ .Values.images.tags.maas_rack }}
diff --git a/charts/maas/templates/statefulset-region.yaml b/charts/maas/templates/statefulset-region.yaml
index b1f5222..266af26 100644
--- a/charts/maas/templates/statefulset-region.yaml
+++ b/charts/maas/templates/statefulset-region.yaml
@@ -14,12 +14,11 @@
14# limitations under the License. */}} 14# limitations under the License. */}}
15{{- if .Values.manifests.region_statefulset }} 15{{- if .Values.manifests.region_statefulset }}
16{{- $envAll := . }} 16{{- $envAll := . }}
17{{- $dependencies := .Values.dependencies.region_controller }}
18{{- $serviceAccountName := "maas-region" }} 17{{- $serviceAccountName := "maas-region" }}
19{{- $mounts_maas_region := .Values.pod.mounts.maas_region.maas_region }} 18{{- $mounts_maas_region := .Values.pod.mounts.maas_region.maas_region }}
20{{- $mounts_maas_region_init := .Values.pod.mounts.maas_region.init_container }} 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---
24apiVersion: apps/v1beta1 23apiVersion: apps/v1beta1
25kind: StatefulSet 24kind: StatefulSet
@@ -42,7 +41,7 @@ spec:
42 nodeSelector: 41 nodeSelector:
43 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} 42 {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
44 initContainers: 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 containers: 45 containers:
47{{- if .Values.conf.cache.enabled }} 46{{- if .Values.conf.cache.enabled }}
48 - name: maas-cache 47 - name: maas-cache
diff --git a/charts/maas/values.yaml b/charts/maas/values.yaml
index 4c36805..af66de2 100644
--- a/charts/maas/values.yaml
+++ b/charts/maas/values.yaml
@@ -18,49 +18,50 @@
18# Declare variables to be passed into your templates. 18# Declare variables to be passed into your templates.
19 19
20dependencies: 20dependencies:
21 rack_controller: 21 static:
22 jobs: 22 rack_controller:
23 - maas-db-sync 23 jobs:
24 services: 24 - maas-db-sync
25 - service: maas_region_ui 25 services:
26 endpoint: internal 26 - service: maas_region_ui
27 region_controller: 27 endpoint: internal
28 jobs: 28 region_controller:
29 - maas-db-sync 29 jobs:
30 services: 30 - maas-db-sync
31 - service: maas_db 31 services:
32 endpoint: internal 32 - service: maas_db
33 db_init: 33 endpoint: internal
34 services: 34 db_init:
35 - service: maas_db 35 services:
36 endpoint: internal 36 - service: maas_db
37 db_sync: 37 endpoint: internal
38 jobs: 38 db_sync:
39 - maas-db-init 39 jobs:
40 bootstrap_admin_user: 40 - maas-db-init
41 jobs: 41 bootstrap_admin_user:
42 - maas-db-sync 42 jobs:
43 services: 43 - maas-db-sync
44 - service: maas_region_ui 44 services:
45 endpoint: internal 45 - service: maas_region_ui
46 - service: maas_db 46 endpoint: internal
47 endpoint: internal 47 - service: maas_db
48 import_resources: 48 endpoint: internal
49 jobs: 49 import_resources:
50 - maas-db-sync 50 jobs:
51 services: 51 - maas-db-sync
52 - service: maas_region_ui 52 services:
53 endpoint: internal 53 - service: maas_region_ui
54 - service: maas_db 54 endpoint: internal
55 endpoint: internal 55 - service: maas_db
56 export_api_key: 56 endpoint: internal
57 jobs: 57 export_api_key:
58 - maas-db-sync 58 jobs:
59 services: 59 - maas-db-sync
60 - service: maas_region_ui 60 services:
61 endpoint: internal 61 - service: maas_region_ui
62 - service: maas_db 62 endpoint: internal
63 endpoint: internal 63 - service: maas_db
64 endpoint: internal
64 65
65manifests: 66manifests:
66 region_statefulset: true 67 region_statefulset: true
@@ -79,6 +80,11 @@ images:
79 maas_cache: quay.io/attcomdev/sstream-cache:latest 80 maas_cache: quay.io/attcomdev/sstream-cache:latest
80 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1 81 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
81 pull_policy: IfNotPresent 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
83jobs: 89jobs:
84 import_boot_resources: 90 import_boot_resources:
diff --git a/tools/helm_tk.sh b/tools/helm_tk.sh
index 6caf555..9e0043e 100755
--- a/tools/helm_tk.sh
+++ b/tools/helm_tk.sh
@@ -16,9 +16,9 @@
16# Script to setup helm-toolkit and helm dep up the shipyard chart 16# Script to setup helm-toolkit and helm dep up the shipyard chart
17# 17#
18HELM=$1 18HELM=$1
19HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm"} 19HTK_REPO=${HTK_REPO:-"https://github.com/openstack/openstack-helm-infra"}
20HTK_PATH=${HTK_PATH:-""} 20HTK_PATH=${HTK_PATH:-""}
21HTK_STABLE_COMMIT=${HTK_COMMIT:-"f902cd14fac7de4c4c9f7d019191268a6b4e9601"} 21HTK_STABLE_COMMIT=${HTK_COMMIT:-"master"}
22DEP_UP_LIST=${DEP_UP_LIST:-"maas"} 22DEP_UP_LIST=${DEP_UP_LIST:-"maas"}
23 23
24if [[ ! -z $(echo $http_proxy) ]] 24if [[ ! -z $(echo $http_proxy) ]]
@@ -59,8 +59,8 @@ fi
59 59
60mkdir -p build 60mkdir -p build
61pushd build 61pushd build
62git clone $HTK_REPO || true 62git clone $HTK_REPO ./htk-repo || true
63pushd openstack-helm/$HTK_PATH 63pushd ./htk-repo/$HTK_PATH
64git reset --hard "${HTK_STABLE_COMMIT}" 64git reset --hard "${HTK_STABLE_COMMIT}"
65 65
66helm_serve 66helm_serve