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.common }}
18 {{- $kubeapiServerEndpoint := .Values.common.k8sAPIHost }}
19 {{- if .Values.common.tillers }}
21 {{- range keys .Values.common.tillers }}
23 {{- with index $topCtx.Values.common.tillers . }}
24 {{- $img := .image.tillerTLSSecrets }}
25 {{- $imgPullPolicy := .imagePullPolicy }}
26 {{- $tillerSecret := default "tiller-secret" .secret.tillerSecretName }}
27 {{- $helmSecret := default "helm-secret" .secret.helmSecretName }}
28 {{- $serviceAccountName := default "tiller" .serviceAccount }}
29 {{- $nameSpace := .nameSpace }}
30 {{- $deployNameSpace := .deployNameSpace }}
31 {{- $img := .image.tillerTLSSecrets }}
32 {{- $ctx := dict "ctx" $topCtx "key" $key }}
33 {{- if .secret.create }}
34 {{- $serviceAccountName := randAlpha 6 | lower | printf "tiller-secret-creator-%s" }}
39 name: {{ $serviceAccountName }}
40 namespace: {{ $deployNameSpace }}
42 apiVersion: rbac.authorization.k8s.io/v1beta1
45 name: {{ $serviceAccountName }}-secret-create
46 namespace: {{ $deployNameSpace }}
49 resources: ["secrets"]
50 verbs: ["create", "get", "patch"]
52 apiVersion: rbac.authorization.k8s.io/v1beta1
55 name: {{ $serviceAccountName }}-secret-create
56 namespace: {{ $deployNameSpace }}
58 apiGroup: rbac.authorization.k8s.io
60 name: {{ $serviceAccountName }}-secret-create
62 - kind: ServiceAccount
63 name: {{ $serviceAccountName }}
64 namespace: {{ $deployNameSpace }}
69 name: tiller-secret-generator
70 namespace: {{ $deployNameSpace }}
74 serviceAccountName: {{ $serviceAccountName }}
76 {{- $newctx := dict "ctx" $topCtx "defaultregistry" $img.registry }}
78 - name: {{ include "common.dockerregistry.credential" $newctx }}
80 - name: tiller-secret-generator
81 image: {{ include "common.dockerregistry.url" $newctx }}/{{- $img.name -}}:{{- $img.tag }}
82 {{- $newctx := dict "ctx" $topCtx "defaultpullpolicy" $imgPullPolicy }}
83 imagePullPolicy: {{ include "common.dockerregistry.pullpolicy" $newctx }}
86 value: {{ tuple $tillerSecret $helmSecret | join " " }}
87 - name: TILLER_KEY_NAME
88 value: {{ $tillerSecret }}.key.pem
89 - name: TILLER_CERT_NAME
90 value: {{ $tillerSecret }}.cert.pem
92 value: {{ $helmSecret }}.key.pem
93 - name: HELM_CERT_NAME
94 value: {{ $helmSecret }}.cert.pem
96 value: {{ default ( include "common.servicename.tiller" $ctx ) .hostname }}
97 - name: CLUSTER_SERVER
98 value: {{ default "https://kubernetes.default.svc.cluster.local/" $kubeapiServerEndpoint }}