Making ip addresses of controllers a variable

pull/368/head
Fred Hsu 2018-06-26 18:23:59 -07:00
parent b974042d95
commit 5208cab72e
1 changed files with 6 additions and 1 deletions

View File

@ -322,11 +322,16 @@ cat > kubernetes-csr.json <<EOF
} }
EOF EOF
for i in 0 1 2; do
declare CONTROLLER_${i}=$(gcloud compute instances describe controller-$i \
--format 'value(networkInterfaces[0].networkIP)');
done
cfssl gencert \ cfssl gencert \
-ca=ca.pem \ -ca=ca.pem \
-ca-key=ca-key.pem \ -ca-key=ca-key.pem \
-config=ca-config.json \ -config=ca-config.json \
-hostname=10.32.0.1,10.240.0.10,10.240.0.11,10.240.0.12,${KUBERNETES_PUBLIC_ADDRESS},127.0.0.1,kubernetes.default \ -hostname=10.32.0.1,${CONTROLLER_0},${CONTROLLER_1},${CONTROLLER_2},${KUBERNETES_PUBLIC_ADDRESS},127.0.0.1,kubernetes.default \
-profile=kubernetes \ -profile=kubernetes \
kubernetes-csr.json | cfssljson -bare kubernetes kubernetes-csr.json | cfssljson -bare kubernetes