Last active
March 14, 2018 11:16
-
-
Save bdpiprava/879b87fd6134090c9e4fb5f4ff14fd5f to your computer and use it in GitHub Desktop.
This file contains 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
##!/bin/bash | |
namespace="${1:-gocd}" | |
echo "" | |
echo "" | |
ingress_name=$(kubectl get ingress --namespace $namespace -o jsonpath='{.items[0].metadata.name}') | |
echo "GoCD server public IP: $(kubectl --namespace $namespace get ingress $ingress_name -o jsonpath='{.status.loadBalancer.ingress[0].ip}')" | |
echo "" | |
echo "" | |
echo "Plugin settings" | |
echo "===========================================================================" | |
echo -e " 1. GoCD server URL: https://$(kubectl --namespace $namespace get service $ingress_name -o jsonpath='{.spec.clusterIP}'):8154/go \n\n" | |
echo "" | |
echo "" | |
echo " 2. Cluster IP : $(kubectl cluster-info)" | |
echo "" | |
echo "" | |
echo " 3. OAuth Token : $(kubectl --namespace=$namespace get secret -o jsonpath='{.items[1].data.token} ' | base64 --decode)" | |
echo "" | |
echo "" | |
echo " 4. Ca Cert Data : $(kubectl --namespace=$namespace get secret -o jsonpath='{.items[1].data.ca\.crt}' | base64 --decode)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
GoCD namespace
$ curl https://gist.githubusercontent.com/bdpiparva/879b87fd6134090c9e4fb5f4ff14fd5f/raw/cluster-info.sh | bash
Custom namespace
curl https://gist.githubusercontent.com/bdpiparva/879b87fd6134090c9e4fb5f4ff14fd5f/raw/cluster-info.sh | bash -s foo