环境:openshift 11
获取key
代码语言:javascript复制[root@192-168-3-114 ~]# ETCDCTL_API=3 etcdctl --cert="/etc/etcd/peer.crt" --key=/etc/etcd/peer.key --cacert="/etc/etcd/ca.crt" --endpoints="https://192.168.3.112:2379,
https://192.168.3.113:2379,
https://192.168.3.114:2379" get "/" --keys-only --prefix=true
查看当前的pod
获取pod数据
代码语言:javascript复制[root@192-168-3-114 ~]# ETCDCTL_API=3 etcdctl --cert="/etc/etcd/peer.crt" --key=/etc/etcd/peer.key --cacert="/etc/etcd/ca.crt" --endpoints="https://192.168.3.112:2379,
https://192.168.3.113:2379,
https://192.168.3.114:2379" get "/kubernetes.io/pods/heidsoft/nginx-deployment-54d9db4cd7-fb69g" -w fields | grep Value
pod 数据
参考:
https://medium.com/opsguru/securing-kubernetes-secrets-how-to-efficiently-secure-access-to-etcd-and-protect-your-secrets-b147791da768