Skip to content

Instantly share code, notes, and snippets.

@xsqian
Last active February 26, 2021 18:43
Show Gist options
  • Save xsqian/d26eeda3da9ce2035010e6ad83a00346 to your computer and use it in GitHub Desktop.
Save xsqian/d26eeda3da9ce2035010e6ad83a00346 to your computer and use it in GitHub Desktop.
get the kubernetes secret and print on terminal
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