Kubernetes pod 内获取所在节点IP
程序员文章站
2022-03-07 13:28:24
...
etcdctl --endpoints=https://10.0.23.72:2379,https://10.0.23.83:2379,https://10.0.23.87:2379 --cert-file=/etc/ssl/k8s/etcd.pem --key-file=/etc/ssl/k8s/etcd-key.pem --ca-file=/etc/ssl/k8s/etcd-root-ca.pem get /kube-centos/network/subnets/10.252.9.0-24 |sed 's/.*"PublicIP":"\([^"]\+\)".*/\1/'
注: 10.252.9.0 是容器IP所在的网段,比较容易获得
上一篇: IBM MQ8.0的新特性
下一篇: WPF 单例启动模式