Create the GKE Cluster and Kubernetes Defaults.
Check out the Crosswalk Guide on this stack for more details.
To deploy your infrastructure, follow the below steps.
After cloning this repo, from this working directory, run these commands:
-
Install the required Node.js packages:
$ npm install
-
Create a new stack, which is an isolated deployment target for this example:
$ pulumi stack init
-
Collect any stack configuration references to configure the stack in the next step.
To get the Pulumi Stack Reference of a dependent stack, reference it in the config using the format:
<org_or_username>/<project>/<stack>
e.g.myUser/myProject/dev01
You can retrieve the Stack's reference name by running
pulumi stack ls
in the stack, and extracting it's stack URI.The stack reference for the example below is:
myUser/k8s-gcp-identity/dev-1573587501
user@pulumi:~/pulumi/kubernetes-guides/gcp/01-identity$ pul stack ls NAME LAST UPDATE RESOURCE COUNT URL dev-1573587501* 4 minutes ago 13 https://app.pulumi.com/myUser/k8s-gcp-identity/dev-1573587501
-
Configure the stack.
$ pulumi config set gcp:zone us-west1-a $ pulumi config set gcp:project <project_name> $ pulumi config set k8s-gke-cluster:identityStackRef myUser/k8s-gcp-identity/dev-1573589109 $ pulumi config set k8s-gke-cluster:infraStackRef myUser/k8s-gcp-infra/dev-1573589378
-
Update the stack.
$ pulumi up
-
Once you've finished experimenting, tear down your stack's resources by destroying and removing it:
$ pulumi destroy --yes $ pulumi stack rm --yes