我正在尝试从 Kubernetes 作业生成 Kubernetes 机密。秘密是 TLS 证书,对于弹性搜索传输,我尝试了这项工作:
apiVersion: batch/v1
kind: Job
metadata:
name: conso-security-tls-gen-certs
spec:
template:
spec:
containers:
- name: generator
volumeMounts:
- name: certs
mountPath: "/certs"
image: "docker.elastic.co/elasticsearch/elasticsearch:7.4.2"
command: ["/bin/sh", "-c"]
args:
- "bin/elasticsearch-certutil ca (...) --silent -out /certs/bundle.p12"
restartPolicy: Never
volumes:
- name: certs
secret:
secretName: conso-security-tls-certs
backoffLimit: 4
但正如https://github.com/kubernetes/kubernetes/issues/62099所说,卷/certs
是只读的。有没有办法像这样创建/编辑这个秘密?