简体   繁体   中英

Helm chart to use secrets from cert-manager

I want to automate the use a certificate, that is created by cert-manager as documented here , in a Helm chart.For example, the YAML below.

---
apiVersion: v1
kind: Pod
metadata:
  name: mypod
  labels:
    app: mypod
spec:
  containers:
    - name: mypod
      image: repo/image:0.0.0
      imagePullPolicy: Always
      volumeMounts:
        - name: certs
          mountPath: /etc/certs
          readOnly: true
      ports:
        - containerPort: 4443
          protocol: TCP
  volumes:
    - name: certs
      secret:
        secretName: as_created_by_cert-manager

How do I submit the YAML for getting a Certificate from cert-manager and then plugin the generated Secret into the Pod YAML above, in a Helm chart?

I am posting David's comment as a community wiki answer as requested by the OP:

You should be able to write the YAML for the Certificate in the same chart, typically in its own file. I'd expect it would work to create them together, the generated Pod would show up as "Pending" in kubectl get pods output until cert-manager actually creates the matching Secret. – David Maze

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM