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>
This commit is contained in:
Pete Birley 2018-08-22 21:37:06 -05:00
parent c585c525bc
commit 582c4d8b20
9 changed files with 72 additions and 78 deletions

View File

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

View File

@ -16,9 +16,8 @@ limitations under the License.
*/}} */}}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.db_init }}
{{- $serviceAccountName := "maas-db-init" }} {{- $serviceAccountName := "maas-db-init" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "db_init" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
@ -35,12 +34,12 @@ spec:
nodeSelector: nodeSelector:
{{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
initContainers: initContainers:
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "db_init" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
- name: maas-db-init - name: maas-db-init
image: {{ .Values.images.tags.db_init | quote }} image: {{ .Values.images.tags.db_init | quote }}
imagePullPolicy: {{ .Values.images.pull_policy | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.db_init | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll "db_init" | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: ROOT_DB_USER - name: ROOT_DB_USER
valueFrom: valueFrom:

View File

@ -16,9 +16,8 @@ limitations under the License.
*/}} */}}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.db_sync }}
{{- $serviceAccountName := "maas-db-sync" }} {{- $serviceAccountName := "maas-db-sync" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "db_sync" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
@ -35,12 +34,12 @@ spec:
nodeSelector: nodeSelector:
{{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
initContainers: initContainers:
{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "db_sync" list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
- name: maas-db-sync - name: maas-db-sync
image: {{ .Values.images.tags.db_sync }} image: {{ .Values.images.tags.db_sync }}
imagePullPolicy: {{ .Values.images.pull_policy }} imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.jobs.db_sync | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll "db_sync" | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
command: command:
- /tmp/db-sync.sh - /tmp/db-sync.sh
volumeMounts: volumeMounts:

View File

@ -16,25 +16,19 @@ limitations under the License.
*/}} */}}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.export_api_key }}
{{- $initMounts := .Values.pod.mounts.export_api_key.export_api_key }} {{- $initMounts := .Values.pod.mounts.export_api_key.export_api_key }}
{{- $serviceAccountName := "maas-export-api-key" }} {{- $serviceAccountName := "maas-export-api-key" }}
--- {{ tuple $envAll "export_api_key" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ $serviceAccountName }}
namespace: {{ $envAll.Release.Namespace }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding kind: RoleBinding
metadata: metadata:
name: {{ $envAll.Release.Name }}-{{ $serviceAccountName }} name: {{ $envAll.Release.Name }}-{{ $serviceAccountName }}-job
namespace: {{ $envAll.Release.Namespace }} namespace: {{ $envAll.Release.Namespace }}
roleRef: roleRef:
apiGroup: rbac.authorization.k8s.io apiGroup: rbac.authorization.k8s.io
kind: Role kind: Role
name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }} name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}}-job
subjects: subjects:
- kind: ServiceAccount - kind: ServiceAccount
name: {{ $serviceAccountName }} name: {{ $serviceAccountName }}
@ -43,7 +37,7 @@ subjects:
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role kind: Role
metadata: metadata:
name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }} name: {{ $envAll.Release.Name }}-{{ $envAll.Release.Namespace }}-{{ $serviceAccountName }}}-job
namespace: {{ $envAll.Release.Namespace }} namespace: {{ $envAll.Release.Namespace }}
rules: rules:
- apiGroups: - apiGroups:
@ -84,7 +78,7 @@ spec:
nodeSelector: nodeSelector:
{{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
initContainers: initContainers:
{{ tuple $envAll $dependencies $initMounts | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "export_api_key" $initMounts | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
- name: exporter - name: exporter
image: {{ .Values.images.tags.export_api_key }} image: {{ .Values.images.tags.export_api_key }}

View File

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

View File

@ -20,12 +20,11 @@ limitations under the License.
{{- 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 -}} {{- 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 -}}
{{- end -}} {{- end -}}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.rack_controller }}
{{- $serviceAccountName := "maas-rack" }} {{- $serviceAccountName := "maas-rack" }}
{{- $mounts_maas_rack := .Values.pod.mounts.maas_rack }} {{- $mounts_maas_rack := .Values.pod.mounts.maas_rack }}
{{- $mounts_maas_rack_init := .Values.pod.mounts.maas_rack.init_container }} {{- $mounts_maas_rack_init := .Values.pod.mounts.maas_rack.init_container }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "rack_controller" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1beta1
kind: StatefulSet kind: StatefulSet
@ -52,7 +51,7 @@ spec:
hostNetwork: true hostNetwork: true
dnsPolicy: ClusterFirst dnsPolicy: ClusterFirst
initContainers: initContainers:
{{ tuple $envAll $dependencies $mounts_maas_rack_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "rack_controller" $mounts_maas_rack_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
- name: maas-rack - name: maas-rack
image: {{ .Values.images.tags.maas_rack }} image: {{ .Values.images.tags.maas_rack }}

View File

@ -14,12 +14,11 @@
# limitations under the License. */}} # limitations under the License. */}}
{{- if .Values.manifests.region_statefulset }} {{- if .Values.manifests.region_statefulset }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.region_controller }}
{{- $serviceAccountName := "maas-region" }} {{- $serviceAccountName := "maas-region" }}
{{- $mounts_maas_region := .Values.pod.mounts.maas_region.maas_region }} {{- $mounts_maas_region := .Values.pod.mounts.maas_region.maas_region }}
{{- $mounts_maas_region_init := .Values.pod.mounts.maas_region.init_container }} {{- $mounts_maas_region_init := .Values.pod.mounts.maas_region.init_container }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "region_controller" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: apps/v1beta1 apiVersion: apps/v1beta1
kind: StatefulSet kind: StatefulSet
@ -42,7 +41,7 @@ spec:
nodeSelector: nodeSelector:
{{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }} {{ .Values.labels.region.node_selector_key }}: {{ .Values.labels.region.node_selector_value }}
initContainers: initContainers:
{{ tuple $envAll $dependencies $mounts_maas_region_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "region_controller" $mounts_maas_region_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
{{- if .Values.conf.cache.enabled }} {{- if .Values.conf.cache.enabled }}
- name: maas-cache - name: maas-cache

View File

@ -18,49 +18,50 @@
# Declare variables to be passed into your templates. # Declare variables to be passed into your templates.
dependencies: dependencies:
rack_controller: static:
jobs: rack_controller:
- maas-db-sync jobs:
services: - maas-db-sync
- service: maas_region_ui services:
endpoint: internal - service: maas_region_ui
region_controller: endpoint: internal
jobs: region_controller:
- maas-db-sync jobs:
services: - maas-db-sync
- service: maas_db services:
endpoint: internal - service: maas_db
db_init: endpoint: internal
services: db_init:
- service: maas_db services:
endpoint: internal - service: maas_db
db_sync: endpoint: internal
jobs: db_sync:
- maas-db-init jobs:
bootstrap_admin_user: - maas-db-init
jobs: bootstrap_admin_user:
- maas-db-sync jobs:
services: - maas-db-sync
- service: maas_region_ui services:
endpoint: internal - service: maas_region_ui
- service: maas_db endpoint: internal
endpoint: internal - service: maas_db
import_resources: endpoint: internal
jobs: import_resources:
- maas-db-sync jobs:
services: - maas-db-sync
- service: maas_region_ui services:
endpoint: internal - service: maas_region_ui
- service: maas_db endpoint: internal
endpoint: internal - service: maas_db
export_api_key: endpoint: internal
jobs: export_api_key:
- maas-db-sync jobs:
services: - maas-db-sync
- service: maas_region_ui services:
endpoint: internal - service: maas_region_ui
- service: maas_db endpoint: internal
endpoint: internal - service: maas_db
endpoint: internal
manifests: manifests:
region_statefulset: true region_statefulset: true
@ -79,6 +80,11 @@ images:
maas_cache: quay.io/attcomdev/sstream-cache:latest maas_cache: quay.io/attcomdev/sstream-cache:latest
dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1 dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
pull_policy: IfNotPresent pull_policy: IfNotPresent
local_registry:
# TODO(portdirect): this chart does not yet support local image cacheing
active: false
exclude:
- dep_check
jobs: jobs:
import_boot_resources: import_boot_resources:

View File

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