diff --git a/prepare-etcd-secret/Chart.yaml b/prepare-etcd-secret/Chart.yaml index ee3dcb50..981af916 100644 --- a/prepare-etcd-secret/Chart.yaml +++ b/prepare-etcd-secret/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.2.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/prepare-etcd-secret/templates/job-secret.yaml b/prepare-etcd-secret/templates/job-secret.yaml index 2d3e0156..eea8d62c 100644 --- a/prepare-etcd-secret/templates/job-secret.yaml +++ b/prepare-etcd-secret/templates/job-secret.yaml @@ -17,17 +17,36 @@ spec: - -c - | kubectl create secret generic etcd-client-cert \ + --namespace {{ .Release.Namespace }} \ + {{- if eq .Values.deployer "tks" }} --from-file=etcd-ca=/ssl/{{ .Values.etcd.certfile }} \ --from-file=etcd-client=/ssl/{{ .Values.etcd.client_certfile }} \ - --from-file=etcd-client-key=/ssl/{{ .Values.etcd.client_keyfile }} \ - --namespace {{ .Release.Namespace }} + --from-file=etcd-client-key=/ssl/{{ .Values.etcd.client_keyfile }} + {{- else if eq .Values.deployer "tacoplay" }} + --from-file=etcd-ca=/ssl/{{ .Values.etcd.tacoplay_certfile }} \ + --from-file=etcd-client=/ssl/member-${MY_NODE_NAME}.pem \ + --from-file=etcd-client-key=/ssl/member-${MY_NODE_NAME}-key.pem + env: + - name: MY_NODE_NAME + valueFrom: + fieldRef: + fieldPath: spec.nodeName + {{- else }} + --wrong-value-for-deployer + {{- end }} volumeMounts: - name: ssldir mountPath: /ssl volumes: - name: ssldir hostPath: + {{- if eq .Values.deployer "tks" }} path: {{ .Values.etcd.certdir }} + {{- else if eq .Values.deployer "tacoplay" }} + path: {{ .Values.etcd.tacoplay_certdir }} + {{- else }} + wrong-value-for-deployer: recheck + {{- end }} type: Directory {{- with .Values.nodeSelector }} nodeSelector: diff --git a/prepare-etcd-secret/values.yaml b/prepare-etcd-secret/values.yaml index 39b13cc5..416959d4 100644 --- a/prepare-etcd-secret/values.yaml +++ b/prepare-etcd-secret/values.yaml @@ -2,10 +2,14 @@ # This is a YAML-formatted file. # Declare variables to be passed into your templates. etcd: + # For TKS # certdir: /etc/kubernetes/pki/etcd certfile: ca.crt client_certfile: peer.crt client_keyfile: peer.key + # For Tacoplay # + tacoplay_certdir: /etc/ssl/etcd/ssl + tacoplay_certfile: ca.pem image: repository: k8s.gcr.io/hyperkube @@ -31,3 +35,7 @@ tolerations: [] #- key: "node-role.kubernetes.io/master" # effect: "NoSchedule" # operator: "Exists" + + +# Valid values: 'tks' or 'tacoplay' +deployer: "tks"