How to Figure Out Which Certs Are Used for the Service in Kubernetes

Planted .

Open the manifest file (usually under /etc/kubernetes/manifests/)

The different files will be listed there, as an example:

pec:
  containers:
  - command:
    - etcd
    - --advertise-client-urls=https://192.168.76.153:2379
    - --cert-file=/etc/kubernetes/pki/etcd/server.crt
    - --client-cert-auth=true
    - --data-dir=/var/lib/etcd
    - --feature-gates=InitialCorruptCheck=true
    - --initial-advertise-peer-urls=https://192.168.76.153:2380
    - --initial-cluster=controlplane=https://192.168.76.153:2380
    - --key-file=/etc/kubernetes/pki/etcd/server.key
    - --listen-client-urls=https://127.0.0.1:2379,https://192.168.76.153:2379
    - --listen-metrics-urls=http://127.0.0.1:2381
    - --listen-peer-urls=https://192.168.76.153:2380
    - --name=controlplane
    - --peer-cert-file=/etc/kubernetes/pki/etcd/peer.crt
    - --peer-client-cert-auth=true
    - --peer-key-file=/etc/kubernetes/pki/etcd/peer.key
    - --peer-trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt
    - --snapshot-count=10000
    - --trusted-ca-file=/etc/kubernetes/pki/etcd/ca.crt
    - --watch-progress-notify-interval=5s

Then you can just read the cert using openssl.

Updated . Thoughts? Email me.