Skip to content

Instantly share code, notes, and snippets.

@bdpiprava
Last active March 14, 2018 11:16
Show Gist options
  • Save bdpiprava/879b87fd6134090c9e4fb5f4ff14fd5f to your computer and use it in GitHub Desktop.
Save bdpiprava/879b87fd6134090c9e4fb5f4ff14fd5f to your computer and use it in GitHub Desktop.
##!/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)"
@bdpiprava
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment