第一步,在可以访问 Etcd SSL 证书的机器上创建 Secert:
kubectl create secret generic prome-etcd-cert --from-file=/etc/etcd/ssl/etcd.pem --from-file=/etc/etcd/ssl/etcd-key.pem -n arms-prom
第二步,kubectl edit deployment -narms-prom arms-prometheus-ack-arms-prometheus 编辑 Prometheus Agent 工作负载,完成 SSL 证书注入:
volumeMounts:- name: sslmountPath: /sslvolumes:- name: sslsecret:secretName: prome-etcd-cert
第三步,编辑采集任务配置,使用注入的 SSL 证书实现采集:
- job_name: 'etcd'scheme: httpstls_config:insecure_skip_verify: truecert_file: /ssl/etcd.pemkey_file: /ssl/etcd-key.pemstatic_configs:- targets: ['172.16.66.89:2379','172.16.66.90:2379','172.16.66.91:2379']