Kubernetes Guestbook, Written in HCL
The Kubernetes guestbook application, written in HCL
This example lives in the pulumi/examples repository. Check out just this directory to use it:
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examplesgit -C pulumi-examples sparse-checkout set kubernetes-hcl-guestbookcd pulumi-examples/kubernetes-hcl-guestbookA version of the Kubernetes Guestbook
application, written in Pulumi HCL. It deploys a
Redis leader, Redis replicas, and a PHP frontend exposed through a LoadBalancer service. Pulumi
installs the HCL language plugin and the Terraform Kubernetes provider automatically the first time
you run the program.
Running the app#
-
Make sure
~/.kube/configpoints at a running Kubernetes cluster. The frontend service has typeLoadBalancer, so the cluster must be able to provision one — on minikube, enable the MetalLB addon. -
Create a new stack:
Terminal window pulumi stack init guestbook-testing -
Run
pulumi upto preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not. -
Open the frontend IP in a browser to use the guestbook:
Terminal window pulumi stack output frontend_ip -
To clean up resources, run
pulumi destroyand answer the confirmation question at the prompt.