Browse Source

Update HTK Path - OSH Infra

Updated configurations to point to openstack-helm-infra
for reference to helm-toolkit as helm-toolkit has been
removed from the openstack-helm repo [0]

Also aligned with changes to the keystone user set up in
OSH using Helm ToolKit so as to get pass Helm Lint.

[0] https://review.openstack.org/#/c/558065/

Change-Id: I10645c907565df4fd7920ae6ef0615348517f969
Anthony Lin 11 months ago
parent
commit
8060aa9783

+ 1
- 1
charts/promenade/templates/configmap-etc.yaml View File

@@ -27,7 +27,7 @@ limitations under the License.
27 27
 {{- tuple "identity" "internal" "api" . | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup"| set .Values.conf.promenade.keystone_authtoken "auth_url" | quote | trunc 0 -}}
28 28
 {{- end -}}
29 29
 
30
-{{- $userIdentity := .Values.endpoints.identity.auth.user -}}
30
+{{- $userIdentity := .Values.endpoints.identity.auth.promenade -}}
31 31
 
32 32
 {{- if empty .Values.conf.promenade.keystone_authtoken.project_name -}}
33 33
 {{- set .Values.conf.promenade.keystone_authtoken "project_name" $userIdentity.project_name | quote | trunc 0 -}}

+ 4
- 55
charts/promenade/templates/job-ks-endpoints.yaml View File

@@ -11,61 +11,10 @@
11 11
 # distributed under the License is distributed on an "AS IS" BASIS,
12 12
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 13
 # See the License for the specific language governing permissions and
14
-# limitations under the License. */}}
14
+# limitations under the License.
15
+*/}}
15 16
 
16 17
 {{- if .Values.manifests.job_ks_endpoints }}
17
-{{- $envAll := . }}
18
-{{- $dependencies := .Values.dependencies.ks_endpoints }}
19
-{{- $serviceAccountName := "promenade-ks-endpoints" }}
20
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
21
----
22
-apiVersion: batch/v1
23
-kind: Job
24
-metadata:
25
-  name: promenade-ks-endpoints
26
-spec:
27
-  template:
28
-    metadata:
29
-      labels:
30
-{{ tuple $envAll "promenade" "ks-endpoints" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
31
-    spec:
32
-      serviceAccountName: {{ $serviceAccountName }}
33
-      restartPolicy: OnFailure
34
-      nodeSelector:
35
-        {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
36
-      initContainers:
37
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
38
-      containers:
39
-{{- range $key1, $osServiceType := tuple "kubernetesprovisioner" }}
40
-{{- range $key2, $osServiceEndPoint := tuple "admin" "internal" "public" }}
41
-        - name: {{ $osServiceType }}-ks-endpoints-{{ $osServiceEndPoint }}
42
-          image: {{ $envAll.Values.images.tags.ks_endpoints }}
43
-          imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
44
-{{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_endpoints | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
45
-          command:
46
-            - /tmp/ks-endpoints.sh
47
-          volumeMounts:
48
-            - name: ks-endpoints-sh
49
-              mountPath: /tmp/ks-endpoints.sh
50
-              subPath: ks-endpoints.sh
51
-              readOnly: true
52
-          env:
53
-{{- with $env := dict "ksUserSecret" $envAll.Values.secrets.identity.admin }}
54
-{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }}
55
-{{- end }}
56
-            - name: OS_SVC_ENDPOINT
57
-              value: {{ $osServiceEndPoint }}
58
-            - name: OS_SERVICE_NAME
59
-              value: {{ tuple $osServiceType $envAll | include "helm-toolkit.endpoints.keystone_endpoint_name_lookup" }}
60
-            - name: OS_SERVICE_TYPE
61
-              value: {{ $osServiceType }}
62
-            - name: OS_SERVICE_ENDPOINT
63
-              value: {{ tuple $osServiceType $osServiceEndPoint "api" $envAll | include "helm-toolkit.endpoints.keystone_endpoint_uri_lookup" }}
64
-{{- end }}
65
-{{- end }}
66
-      volumes:
67
-        - name: ks-endpoints-sh
68
-          configMap:
69
-            name: promenade-bin
70
-            defaultMode: 0555
18
+{{- $ksServiceJob := dict "envAll" . "serviceName" "promenade" "serviceTypes" ( tuple "kubernetesprovisioner" ) -}}
19
+{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_endpoints" }}
71 20
 {{- end -}}

+ 13
- 59
charts/promenade/templates/job-ks-service.yaml View File

@@ -1,66 +1,20 @@
1 1
 {{/*
2
-# copyright (c) 2017 at&t intellectual property. all rights reserved.
2
+# Copyright (c) 2017 AT&T Intellectual Property. All rights reserved.
3 3
 #
4
-# licensed under the apache license, version 2.0 (the "license");
5
-# you may not use this file except in compliance with the license.
6
-# you may obtain a copy of the license at
4
+# Licensed under the Apache License, Version 2.0 (the "License");
5
+# you may not use this file except in compliance with the License.
6
+# You may obtain a copy of the License at
7 7
 #
8
-#     http://www.apache.org/licenses/license-2.0
8
+#     http://www.apache.org/licenses/LICENSE-2.0
9 9
 #
10
-# unless required by applicable law or agreed to in writing, software
11
-# distributed under the license is distributed on an "as is" basis,
12
-# without warranties or conditions of any kind, either express or implied.
13
-# see the license for the specific language governing permissions and
14
-# limitations under the license. */}}
10
+# Unless required by applicable law or agreed to in writing, software
11
+# distributed under the License is distributed on an "AS IS" BASIS,
12
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
+# See the License for the specific language governing permissions and
14
+# limitations under the License.
15
+*/}}
15 16
 
16 17
 {{- if .Values.manifests.job_ks_service -}}
17
-
18
-{{- $envAll := . }}
19
-{{- $ksAdminSecret := .Values.secrets.identity.admin }}
20
-{{- $dependencies := .Values.dependencies.ks_service }}
21
-{{- $serviceAccountName := "promenade-ks-service" }}
22
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
23
----
24
-apiVersion: batch/v1
25
-kind: Job
26
-metadata:
27
-  name: promenade-ks-service
28
-spec:
29
-  template:
30
-    metadata:
31
-      labels:
32
-{{ tuple $envAll "promenade" "ks-service" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
33
-    spec:
34
-      serviceAccountName: {{ $serviceAccountName }}
35
-      restartPolicy: OnFailure
36
-      nodeSelector:
37
-        {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
38
-      initContainers:
39
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
40
-      containers:
41
-{{- range $key1, $osServiceType := tuple "kubernetesprovisioner" }}
42
-        - name: {{ $osServiceType }}-ks-service-registration
43
-          image: {{ $envAll.Values.images.tags.ks_service }}
44
-          imagePullPolicy: {{ $envAll.Values.images.pull_policy }}
45
-          command:
46
-            - /tmp/ks-service.sh
47
-          volumeMounts:
48
-            - name: ks-service-sh
49
-              mountPath: /tmp/ks-service.sh
50
-              subPath: ks-service.sh
51
-              readOnly: true
52
-          env:
53
-{{- with $env := dict "ksUserSecret" $ksAdminSecret }}
54
-{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }}
55
-{{- end }}
56
-            - name: OS_SERVICE_NAME
57
-              value: {{ tuple $osServiceType $envAll | include "helm-toolkit.endpoints.keystone_endpoint_name_lookup" }}
58
-            - name: OS_SERVICE_TYPE
59
-              value: {{ $osServiceType }}
60
-{{- end }}
61
-      volumes:
62
-        - name: ks-service-sh
63
-          configMap:
64
-            name: promenade-bin
65
-            defaultMode: 0555
18
+{{- $ksServiceJob := dict "envAll" . "serviceName" "promenade" "serviceTypes" ( tuple "kubernetesprovisioner" ) -}}
19
+{{ $ksServiceJob | include "helm-toolkit.manifests.job_ks_service" }}
66 20
 {{- end -}}

+ 4
- 55
charts/promenade/templates/job-ks-user.yaml View File

@@ -11,61 +11,10 @@
11 11
 # distributed under the License is distributed on an "AS IS" BASIS,
12 12
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 13
 # See the License for the specific language governing permissions and
14
-# limitations under the License. */}}
14
+# limitations under the License.
15
+*/}}
15 16
 
16 17
 {{- if .Values.manifests.job_ks_user }}
17
-
18
-{{- $ksAdminSecret := .Values.secrets.identity.admin }}
19
-{{- $ksUserSecret := .Values.secrets.identity.user }}
20
-{{- $envAll := . }}
21
-{{- $dependencies := .Values.dependencies.ks_user }}
22
-{{- $serviceAccountName := "promenade-ks-user" }}
23
-{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
24
----
25
-apiVersion: batch/v1
26
-kind: Job
27
-metadata:
28
-  name: promenade-ks-user
29
-spec:
30
-  template:
31
-    metadata:
32
-      labels:
33
-{{ tuple $envAll "promenade" "ks-user" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
34
-    spec:
35
-      serviceAccountName: {{ $serviceAccountName }}
36
-      restartPolicy: OnFailure
37
-      nodeSelector:
38
-        {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
39
-      initContainers:
40
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
41
-      containers:
42
-        - name: promenade-ks-user
43
-          image: {{ .Values.images.tags.ks_user }}
44
-          imagePullPolicy: {{ .Values.images.pull_policy }}
45
-{{ tuple $envAll $envAll.Values.pod.resources.jobs.ks_user | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
46
-          command:
47
-            - /tmp/ks-user.sh
48
-          volumeMounts:
49
-            - name: ks-user-sh
50
-              mountPath: /tmp/ks-user.sh
51
-              subPath: ks-user.sh
52
-              readOnly: true
53
-          env:
54
-{{- with $env := dict "ksUserSecret" $ksAdminSecret }}
55
-{{- include "helm-toolkit.snippets.keystone_openrc_env_vars" $env | indent 12 }}
56
-{{- end }}
57
-            - name: SERVICE_OS_SERVICE_NAME
58
-              value: {{ $envAll.Values.endpoints.kubernetesprovisioner.name | quote }}
59
-            - name: SERVICE_OS_DOMAIN_NAME
60
-              value: {{ $envAll.Values.endpoints.identity.auth.user.project_domain_name | quote }}
61
-{{- with $env := dict "ksUserSecret" $ksUserSecret }}
62
-{{- include "helm-toolkit.snippets.keystone_user_create_env_vars" $env | indent 12 }}
63
-{{- end }}
64
-            - name: SERVICE_OS_ROLE
65
-              value: {{ $envAll.Values.endpoints.identity.auth.user.role | quote }}
66
-      volumes:
67
-        - name: ks-user-sh
68
-          configMap:
69
-            name: promenade-bin
70
-            defaultMode: 0555
18
+{{- $ksUserJob := dict "envAll" . "serviceName" "promenade" -}}
19
+{{ $ksUserJob | include "helm-toolkit.manifests.job_ks_user" }}
71 20
 {{- end -}}

+ 1
- 1
charts/promenade/templates/secret-keystone-env.yaml View File

@@ -13,7 +13,7 @@
13 13
 */}}
14 14
 {{- if .Values.manifests.secret_keystone }}
15 15
 {{- $envAll := . }}
16
-{{- range $key1, $userClass := tuple "admin" "user" }}
16
+{{- range $key1, $userClass := tuple "admin" "promenade" }}
17 17
 {{- $secretName := index $envAll.Values.secrets.identity $userClass }}
18 18
 ---
19 19
 apiVersion: v1

+ 2
- 2
charts/promenade/templates/tests/test-promenade-api.yaml View File

@@ -17,7 +17,7 @@
17 17
 Test that the API is up and the health endpoint returns a 2XX code */}}
18 18
 {{- if .Values.manifests.test_promenade_api }}
19 19
 {{- $envAll := . }}
20
-{{- $dependencies := .Values.dependencies.test }}
20
+{{- $mounts_promenade_api_init := .Values.pod.mounts.promenade_api.init_container }}
21 21
 ---
22 22
 apiVersion: v1
23 23
 kind: Pod
@@ -28,7 +28,7 @@ metadata:
28 28
 spec:
29 29
   restartPolicy: Never
30 30
   initContainers:
31
-{{ tuple $envAll $dependencies list | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 4 }}
31
+{{ tuple $envAll "test" $mounts_promenade_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
32 32
   containers:
33 33
     - name: "{{ .Release.Name }}-api-test"
34 34
       env:

+ 35
- 23
charts/promenade/values.yaml View File

@@ -33,19 +33,23 @@ conf:
33 33
 
34 34
 images:
35 35
   tags:
36
-    dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.2.1
37 36
     promenade: quay.io/attcomdev/promenade:latest
38 37
     ks_user: docker.io/openstackhelm/heat:newton
39 38
     ks_service: docker.io/openstackhelm/heat:newton
40 39
     ks_endpoints: docker.io/openstackhelm/heat:newton
41
-  pull_policy: IfNotPresent
42
-
43
-dependencies:
44
-  test:
45
-    services:
46
-      - service: promenade-api
40
+    dep_check: quay.io/stackanetes/kubernetes-entrypoint:v0.3.1
41
+    image_repo_sync: docker.io/docker:17.07.0
42
+  pull_policy: "IfNotPresent"
43
+  local_registry:
44
+    active: false
45
+    exclude:
46
+      - dep_check
47
+      - image_repo_sync
47 48
 
48 49
 labels:
50
+  job:
51
+    node_selector_key: ucp-control-plane
52
+    node_selector_value: enabled
49 53
   node_selector_key: ucp-control-plane
50 54
   node_selector_value: enabled
51 55
 
@@ -69,32 +73,36 @@ network:
69 73
       public: true
70 74
 
71 75
 dependencies:
72
-  ks_user:
73
-    services:
74
-    - service: identity
75
-      endpoint: internal
76
-  ks_service:
77
-    services:
78
-    - service: identity
79
-      endpoint: internal
80
-  ks_endpoints:
81
-    jobs:
82
-    - promenade-ks-service
83
-    services:
84
-    - service: identity
85
-      endpoint: internal
76
+  static:
77
+    test:
78
+      services:
79
+        - service: promenade-api
80
+    ks_user:
81
+      services:
82
+      - service: identity
83
+        endpoint: internal
84
+    ks_service:
85
+      services:
86
+      - service: identity
87
+        endpoint: internal
88
+    ks_endpoints:
89
+      jobs:
90
+      - promenade-ks-service
91
+      services:
92
+      - service: identity
93
+        endpoint: internal
86 94
 
87 95
 secrets:
88 96
   identity:
89 97
     admin: promenade-keystone-admin
90
-    user: promenade-keystone-user
98
+    promenade: promenade-keystone-user
91 99
 
92 100
 endpoints:
93 101
   cluster_domain_suffix: cluster.local
94 102
   identity:
95 103
     name: keystone
96 104
     auth:
97
-      user:
105
+      promenade:
98 106
         region_name: RegionOne
99 107
         role: admin
100 108
         project_name: service
@@ -145,6 +153,10 @@ pod:
145 153
         default: preferredDuringSchedulingIgnoredDuringExecution
146 154
       topologyKey:
147 155
         default: kubernetes.io/hostname
156
+  mounts:
157
+    promenade_api:
158
+      init_container: null
159
+      promenade_api:
148 160
   env:
149 161
     promenade_api:
150 162
 #      - name: http_proxy

+ 1
- 1
examples/basic/armada-resources.yaml View File

@@ -111,7 +111,7 @@ data:
111 111
   values: {}
112 112
   source:
113 113
     type: git
114
-    location: https://git.openstack.org/openstack/openstack-helm
114
+    location: https://git.openstack.org/openstack/openstack-helm-infra
115 115
     subpath: helm-toolkit
116 116
     reference: master
117 117
   dependencies: []

+ 1
- 1
examples/complete/armada-resources.yaml View File

@@ -151,7 +151,7 @@ data:
151 151
   values: {}
152 152
   source:
153 153
     type: git
154
-    location: https://git.openstack.org/openstack/openstack-helm
154
+    location: https://git.openstack.org/openstack/openstack-helm-infra
155 155
     subpath: helm-toolkit
156 156
     reference: master
157 157
   dependencies: []

+ 1
- 1
tools/gate/config-templates/bootstrap-armada-config.yaml View File

@@ -106,7 +106,7 @@ data:
106 106
   values: {}
107 107
   source:
108 108
     type: git
109
-    location: https://git.openstack.org/openstack/openstack-helm
109
+    location: https://git.openstack.org/openstack/openstack-helm-infra
110 110
     subpath: helm-toolkit
111 111
     reference: master
112 112
   dependencies: []

+ 2
- 2
tools/helm_tk.sh View File

@@ -58,8 +58,8 @@ ${HELM} repo add local http://localhost:8879/charts
58 58
 
59 59
 {
60 60
     cd "${SERVE_DIR}"
61
-    git clone --depth 1 https://git.openstack.org/openstack/openstack-helm.git || true
62
-    cd openstack-helm
61
+    git clone --depth 1 https://git.openstack.org/openstack/openstack-helm-infra.git || true
62
+    cd openstack-helm-infra
63 63
 
64 64
     make helm-toolkit
65 65
 }

Loading…
Cancel
Save