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 proxy & | |
| echo "Entering the namespace details: " | |
| read ns | |
| cat<<EOF >./ns.json | |
| { | |
| "apiVersion": "v1", | |
| "kind": "Namespace", | |
| "metadata": { |
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
| SERVICE_ACCOUNT_DIR="/var/run/secrets/kubernetes.io/serviceaccount" | |
| KUBERNETES_SERVICE_SCHEME=$(case $KUBERNETES_SERVICE_PORT in 80|8080|8081) echo "http";; *) echo "https"; esac) | |
| KUBERNETES_SERVER_URL="$KUBERNETES_SERVICE_SCHEME"://"$KUBERNETES_SERVICE_HOST":"$KUBERNETES_SERVICE_PORT" | |
| KUBERNETES_CLUSTER_CA_FILE="$SERVICE_ACCOUNT_DIR"/ca.crt | |
| KUBERNETES_NAMESPACE=$(cat "$SERVICE_ACCOUNT_DIR"/namespace) | |
| KUBERNETES_USER_TOKEN=$(cat "$SERVICE_ACCOUNT_DIR"/token) | |
| KUBERNETES_CONTEXT="inCluster" | |
| mkdir -p "$HOME"/.kube | |
| cat << EOF > "$HOME"/.kube/config |