Last active
February 26, 2021 18:43
-
-
Save xsqian/d26eeda3da9ce2035010e6ad83a00346 to your computer and use it in GitHub Desktop.
get the kubernetes secret and print on terminal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kubectl -n kube-system describe secret $(kubectl -n kube-system get secret | grep admin-user | awk '{print $1}') | |
export CLUSTER_IP=$(kubectl get services/webapp1-clusterip-svc -o go-template='{{(index .spec.clusterIP)}}') | |
echo CLUSTER_IP=$CLUSTER_IP | |
curl $CLUSTER_IP:80 | |
sed -i 's/HOSTIP/172.17.0.16/g' externalip.yaml | |
export LoadBalancerIP=$(kubectl get services/webapp1-loadbalancer-svc -o go-template='{{(index .status.loadBalancer.ingress 0).ip}}') | |
echo LoadBalancerIP=$LoadBalancerIP | |
curl $LoadBalancerIP |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment