Skip to main content

WordPress Helm chart deployed using the Helm Release resource

A minimal installation of the Wordpress Helm chart using Helm Release support

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-py-helm-release-wordpress
cd pulumi-examples/kubernetes-py-helm-release-wordpress

Uses the Helm Release API of @pulumi/kubernetes to deploy v13.0.6 of the WordPress Helm chart to a Kubernetes cluster. The Helm Release resource will install the chart, mimicking the behavior of the Helm CLI.

wordpress

Prerequisites#

  1. Install Pulumi
  2. Configure Kubernetes
  3. Install Python

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init dev
  2. Install dependencies:

    Terminal window
    python3 -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
  3. Deploy the stack:

    Terminal window
    pulumi up
    Updating (dev)
    View Live: https://app.pulumi.com/.../kubernetes-py-helm-release-wordpress/dev/updates/1
    Type Name Status
    + pulumi:pulumi:Stack kubernetes-py-helm-release-wordpress-dev created
    + ├─ kubernetes:helm.sh/v3:Release wpdev created
    └─ kubernetes:core/v1:Service wpdev-wordpress
    Outputs:
    frontendIp : "10.96.144.123"
    portForwardCommand: "kubectl port-forward svc/wpdev-3zbpljcn-wordpress 8080:80"
    Resources:
    + 2 created
    Duration: 1m29s
  4. WordPress was allocated a cluster IP, in this case 10.96.144.123, exported as the stack output frontendIp. Since this is a cluster IP, you will need to port-forward to the service in order to hit the endpoint at http://localhost:8080 by running the port-forward command specified in portForwardCommand. You can then navigate to the site in a web browser.

Cleaning up#

Once you’re finished experimenting, you can destroy your stack and remove it to avoid incurring any additional cost:

Terminal window
pulumi destroy
pulumi stack rm

Related

The infrastructure as code platform for any cloud.