Updates CA name generation to be configurable allowing the swapping in of a CA. ### Motivation We recently swapped out cert issuers and found that with the current helm chart we were unable to do a hot swap without downtime (via helm) because the CA cert name is not configurable. Being able to change the name of the CA allows us to create a new CA first -> Validate -> then swap over in follow up apply/release. ### Modifications Adds the ability to specify the suffix used to generate the CA name (not the whole name in order to preserve back compatibility regardless of the release name.)
81 lines
2.1 KiB
Smarty
81 lines
2.1 KiB
Smarty
{{/*
|
|
Define the pulsar autorecovery service
|
|
*/}}
|
|
{{- define "pulsar.autorecovery.service" -}}
|
|
{{ template "pulsar.fullname" . }}-{{ .Values.autorecovery.component }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Define the autorecovery hostname
|
|
*/}}
|
|
{{- define "pulsar.autorecovery.hostname" -}}
|
|
${HOSTNAME}.{{ template "pulsar.autorecovery.service" . }}.{{ template "pulsar.namespace" . }}.svc.{{ .Values.clusterDomain }}
|
|
{{- end -}}
|
|
|
|
{{/*
|
|
Define autorecovery zookeeper client tls settings
|
|
*/}}
|
|
{{- define "pulsar.autorecovery.zookeeper.tls.settings" -}}
|
|
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
|
|
/pulsar/keytool/keytool.sh autorecovery {{ template "pulsar.autorecovery.hostname" . }} true;
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Define autorecovery tls certs mounts
|
|
*/}}
|
|
{{- define "pulsar.autorecovery.certs.volumeMounts" -}}
|
|
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
|
|
- name: autorecovery-certs
|
|
mountPath: "/pulsar/certs/autorecovery"
|
|
readOnly: true
|
|
- name: ca
|
|
mountPath: "/pulsar/certs/ca"
|
|
readOnly: true
|
|
{{- if .Values.tls.zookeeper.enabled }}
|
|
- name: keytool
|
|
mountPath: "/pulsar/keytool/keytool.sh"
|
|
subPath: keytool.sh
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Define autorecovery tls certs volumes
|
|
*/}}
|
|
{{- define "pulsar.autorecovery.certs.volumes" -}}
|
|
{{- if and .Values.tls.enabled .Values.tls.zookeeper.enabled }}
|
|
- name: autorecovery-certs
|
|
secret:
|
|
secretName: "{{ .Release.Name }}-{{ .Values.tls.autorecovery.cert_name }}"
|
|
items:
|
|
- key: tls.crt
|
|
path: tls.crt
|
|
- key: tls.key
|
|
path: tls.key
|
|
- name: ca
|
|
secret:
|
|
secretName: "{{ .Release.Name }}-{{ .Values.tls.ca_suffix }}"
|
|
items:
|
|
- key: ca.crt
|
|
path: ca.crt
|
|
{{- if .Values.tls.zookeeper.enabled }}
|
|
- name: keytool
|
|
configMap:
|
|
name: "{{ template "pulsar.fullname" . }}-keytool-configmap"
|
|
defaultMode: 0755
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- end }}
|
|
|
|
{{/*
|
|
Define autorecovery init container : verify cluster id
|
|
*/}}
|
|
{{- define "pulsar.autorecovery.init.verify_cluster_id" -}}
|
|
bin/apply-config-from-env.py conf/bookkeeper.conf;
|
|
{{- include "pulsar.autorecovery.zookeeper.tls.settings" . -}}
|
|
until bin/bookkeeper shell whatisinstanceid; do
|
|
sleep 3;
|
|
done;
|
|
{{- end }}
|