Created
February 12, 2019 19:16
-
-
Save jonbcampos/ef4e0d8b3e7cfc3dab78ad3cdd04d13b to your computer and use it in GitHub Desktop.
spinnaker-install-base-service
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
# login into GCP | |
gcloud auth login | |
# set project id that your cluster belongs to | |
gcloud config set project <your-gcp-project-id> | |
# login to kubectl | |
gcloud auth application-default login | |
# download kubeconfig to local computer from a cluster by name | |
gcloud container clusters get-credentials <your-cluster-name> --zone <your-cluster-zone> | |
# get kubeconfig context | |
CONTEXT=$(kubectl config current-context) | |
# this service account uses the ClusterAdmin role -- this is not necessary, more restrictive roles can by applied. | |
kubectl apply --context $CONTEXT -f https://spinnaker.io/downloads/kubernetes/service-account.yml | |
# get service token | |
TOKEN=$(kubectl get secret --context $CONTEXT \ | |
$(kubectl get serviceaccount spinnaker-service-account \ | |
--context $CONTEXT \ | |
-n spinnaker \ | |
-o jsonpath='{.secrets[0].name}') \ | |
-n spinnaker \ | |
-o jsonpath='{.data.token}' | base64 --decode) | |
# set credentials | |
kubectl config set-credentials ${CONTEXT}-token-user --token $TOKEN | |
# set context | |
kubectl config set-context $CONTEXT --user ${CONTEXT}-token-user | |
# enable kubernetes | |
hal config provider kubernetes enable | |
# add in provider account | |
hal config provider kubernetes account add spinnaker-account --provider-version v2 --context ${CONTEXT} | |
# finally enable artifacts | |
hal config features edit --artifacts true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment