---
title: "Kubernetes Guestbook, Written in HCL"
description: "The Kubernetes guestbook application, written in HCL"
url: "https://www.pulumi.com/dev/examples/kubernetes-hcl-guestbook/"
image: "https://www.pulumi.com/assets/og/dev/examples/kubernetes-hcl-guestbook.png"
---

# Kubernetes Guestbook, Written in HCL

The Kubernetes guestbook application, written in HCL

- Source on GitHub: https://github.com/pulumi/examples/tree/master/kubernetes-hcl-guestbook

## Get started with this example

This example lives in the [pulumi/examples](https://github.com/pulumi/examples/tree/master/kubernetes-hcl-guestbook) repo. Pull down just this directory to follow along:

```bash
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](https://kubernetes.io/docs/tutorials/stateless-application/guestbook/)
application, written in [Pulumi HCL](https://www.pulumi.com/docs/languages-sdks/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.

1.  Create a new stack:

    ```bash
    $ pulumi stack init guestbook-testing
    ```

1.  Run `pulumi up` to preview and deploy changes. After the preview is shown you will be
    prompted if you want to continue or not.

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

    ```bash
    $ pulumi stack output frontend_ip
    ```

1.  To clean up resources, run `pulumi destroy` and answer the confirmation question at the prompt.
