- Runs only on Linux or Mac
- Following tools needs to be installed in local machine and available via
PATH
- gcloud SDK
- kubectl (
gcloud components install kubectl
) - terraform
- helm CLI
credential
: Contents of a file that contains terraform service account private key in JSON format. Default filename is account.json. Refer below installation steps to generate key fileproject
: The ID of the GCP projectzone
: Compute engine zone where GKE cluster needs to be createdgcs_location
: Cloud storage bucket location for storing spinnaker dataBy default Nearline storage class is configured. Ensure correct location is configured based on the configured
zone
-
terraform
uses Service Usage API, this API needs to be enabled manually https://console.developers.google.com/apis/library/serviceusage.googleapis.com -
Create service account for
terraform
gcloud iam service-accounts create terraform --display-name "terraform" gcloud iam service-accounts keys create account.json --iam-account terraform@$(gcloud info --format='value(config.project)').iam.gserviceaccount.com
Above command will download the key and store it in
account.json
file -
Grant owner role to terraform service account
gcloud projects add-iam-policy-binding $(gcloud info --format='value(config.project)') --member serviceAccount:terraform@$(gcloud info --format='value(config.project)').iam.gserviceaccount.com --role roles/owner
-
Execute below commands. This will take some time to complete (5 to 8 mins)
terraform init terraform plan -out terraform.plan terraform apply terraform.plan
-
After the command completes, run the following command to set up port forwarding to the Spinnaker UI
export KUBECONFIG=$PWD/.kubeconfig export DECK_POD=$(kubectl get pods --namespace default -l "component=deck" -o jsonpath="{.items[0].metadata.name}") kubectl port-forward --namespace default $DECK_POD 8080:9000 >> /dev/null &
-
Access spinnaker UI at http://localhost:8080/