2 Copyright (c) 2019 AT&T Intellectual Property.
3 Copyright (c) 2019 Nokia.
5 Licensed under the Apache License, Version 2.0 (the "License");
6 you may not use this file except in compliance with the License.
7 You may obtain a copy of the License at
9 http://www.apache.org/licenses/LICENSE-2.0
11 Unless required by applicable law or agreed to in writing, software
12 distributed under the License is distributed on an "AS IS" BASIS,
13 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 See the License for the specific language governing permissions and
15 limitations under the License.
17 {{- if .Values.global }}
18 {{- $kubeapiServerEndpoint := .Values.global.k8sAPIHost }}
19 {{- if .Values.global.tillers }}
21 {{- range keys .Values.global.tillers }}
23 {{- with index $topCtx.Values.global.tillers . }}
24 {{- $img := .image.tillerTLSSecrets }}
25 {{- $tillerSecret := default "tiller-secret" .secret.tillerSecretName }}
26 {{- $helmSecret := default "helm-secret" .secret.helmSecretName }}
27 {{- $serviceAccountName := default "tiller" .serviceAccount }}
28 {{- $nameSpace := .nameSpace }}
29 {{- $deployNameSpace := .deployNameSpace }}
30 {{- $img := .image.tillerTLSSecrets }}
31 {{- $ctx := dict "ctx" $topCtx "key" $key }}
32 {{- if .secret.create }}
33 {{- $serviceAccountName := randAlpha 6 | lower | printf "tiller-secret-creator-%s" }}
38 name: {{ $serviceAccountName }}
39 namespace: {{ $deployNameSpace }}
41 apiVersion: rbac.authorization.k8s.io/v1beta1
44 name: {{ $serviceAccountName }}-secret-create
45 namespace: {{ $deployNameSpace }}
48 resources: ["secrets"]
49 verbs: ["create", "get", "patch"]
51 apiVersion: rbac.authorization.k8s.io/v1beta1
54 name: {{ $serviceAccountName }}-secret-create
55 namespace: {{ $deployNameSpace }}
57 apiGroup: rbac.authorization.k8s.io
59 name: {{ $serviceAccountName }}-secret-create
61 - kind: ServiceAccount
62 name: {{ $serviceAccountName }}
63 namespace: {{ $deployNameSpace }}
68 name: tiller-secret-generator
69 namespace: {{ $deployNameSpace }}
73 serviceAccountName: {{ $serviceAccountName }}
76 {{- if $img.repositoryCred }}
77 - name: {{ $img.repositoryCred }}
79 - name: {{ include "common.repositoryCred" $topCtx }}
82 - name: tiller-secret-generator
83 image: {{ if $img.repository }}{{- $img.repository -}}/{{ else }} {{ include "common.repository" $topCtx -}}/{{- end -}}{{- $img.name -}}{{- if $img.tag -}} : {{- $img.tag -}} {{- end }}
84 imagePullPolicy: {{ default "IfNotPresent" $img.pullPolicy }}
87 value: {{ tuple $tillerSecret $helmSecret | join " " }}
88 - name: TILLER_KEY_NAME
89 value: {{ $tillerSecret }}.key.pem
90 - name: TILLER_CERT_NAME
91 value: {{ $tillerSecret }}.cert.pem
93 value: {{ $helmSecret }}.key.pem
94 - name: HELM_CERT_NAME
95 value: {{ $helmSecret }}.cert.pem
97 value: {{ default ( include "common.servicename.tiller" $ctx ) .hostname }}
98 - name: CLUSTER_SERVER
99 value: {{ default "https://kubernetes.default.svc.cluster.local/" $kubeapiServerEndpoint }}