Skip to main content

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:

Get started with this example
git clone --filter=blob:none --sparse https://github.com/pulumi/examples pulumi-examples
git -C pulumi-examples sparse-checkout set kubernetes-hcl-guestbook
cd pulumi-examples/kubernetes-hcl-guestbook

A 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#

  1. Make sure ~/.kube/config points at a running Kubernetes cluster. The frontend service has type LoadBalancer, so the cluster must be able to provision one — on minikube, enable the MetalLB addon.

  2. Create a new stack:

    Terminal window
    pulumi stack init guestbook-testing
  3. Run pulumi up to preview and deploy changes. After the preview is shown you will be prompted if you want to continue or not.

  4. Open the frontend IP in a browser to use the guestbook:

    Terminal window
    pulumi stack output frontend_ip
  5. To clean up resources, run pulumi destroy and answer the confirmation question at the prompt.

Related

The infrastructure as code platform for any cloud.