chore: save libvirt certs to pod-tmp
diff --git a/charts/libvirt/templates/bin/_cert-init.sh.tpl b/charts/libvirt/templates/bin/_cert-init.sh.tpl
index 1e4bec3..6a8886e 100644
--- a/charts/libvirt/templates/bin/_cert-init.sh.tpl
+++ b/charts/libvirt/templates/bin/_cert-init.sh.tpl
@@ -42,3 +42,7 @@
kubectl -n ${POD_NAMESPACE} wait --for=condition=Ready --timeout=300s \
certificate/${POD_NAME}-${TYPE}
+
+kubectl -n ${POD_NAMESPACE} get secret ${POD_NAME}-${TYPE} -o jsonpath='{.data.tls\.crt}' | base64 -d > /tmp/${POD_NAME}-${TYPE}.crt
+kubectl -n ${POD_NAMESPACE} get secret ${POD_NAME}-${TYPE} -o jsonpath='{.data.tls\.key}' | base64 -d > /tmp/${POD_NAME}-${TYPE}.key
+kubectl -n ${POD_NAMESPACE} get secret ${POD_NAME}-${TYPE} -o jsonpath='{.data.ca\.crt}' | base64 -d > /tmp/${POD_NAME}-${TYPE}.ca.crt
diff --git a/charts/libvirt/templates/daemonset-libvirt.yaml b/charts/libvirt/templates/daemonset-libvirt.yaml
index 81940f4..0eca106 100644
--- a/charts/libvirt/templates/daemonset-libvirt.yaml
+++ b/charts/libvirt/templates/daemonset-libvirt.yaml
@@ -98,6 +98,8 @@
fieldRef:
fieldPath: status.podIP
volumeMounts:
+ - name: pod-tmp
+ mountPath: /tmp
- name: libvirt-bin
mountPath: /tmp/cert-init.sh
subPath: cert-init.sh
@@ -129,6 +131,8 @@
fieldRef:
fieldPath: status.podIP
volumeMounts:
+ - name: pod-tmp
+ mountPath: /tmp
- name: libvirt-bin
mountPath: /tmp/cert-init.sh
subPath: cert-init.sh