当尝试从configMap文件中的环境变量中导出值(CONSUL_DNS_SERVICE_HOST)时,我收到错误消息-PSB
# From my container:
> printenv CONSUL_DNS_SERVICE_HOST
10.100.180.151
> kubectl -n kube-system get configmap coredns -o yaml
apiVersion: v1
data:
Corefile: |
.:53 {
errors
log
health
kubernetes cluster.local 10.0.0.0/24
rewrite name . .default.svc.cluster.local
prometheus :9153
proxy . /etc/resolv.conf
cache 30
reload
}
consul:53 {
log
errors
cache 30
proxy . "$(printenv CONSUL_DNS_SERVICE_HOST)"
> kubectl logs --tail=20 -f coredns-7bcbfc4774-4n9p7 -n kube-system
2019/01/10 11:15:59 plugin/proxy: not an IP address or file: "$(printenv CONSUL_DNS_SERVICE_HOST)"
我找不到方法来检索CONSUL_DNS_SERVICE_HOST的IP
谢谢