Skip to main content

WordPress Helm chart

A minimal installation of the latest version of the Wordpress Helm chart

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

Uses the Helm API of @pulumi/kubernetes to deploy v9.6.0 of the WordPress Helm chart to a Kubernetes cluster. Pulumi will expand the Helm chart and submit the expanded YAML to the cluster.

wordpress

Prerequisites#

  1. Install Pulumi
  2. Configure Kubernetes
  3. Install Node.js

Deploying the example#

  1. Create a new stack:

    Terminal window
    pulumi stack init dev
  2. Install dependencies:

    Terminal window
    npm install
  3. Deploy the stack:

    Terminal window
    pulumi up
    Updating (ts-helm-wordpress)
    Type Name Status
    + pulumi:pulumi:Stack wordpress-ts-helm-wordpress created
    + └─ kubernetes:helm.sh:Chart wpdev created
    + ├─ kubernetes:core:Secret default/wpdev-mariadb created
    + ├─ kubernetes:core:Secret wpdev-wordpress created
    + ├─ kubernetes:core:PersistentVolumeClaim wpdev-wordpress created
    + ├─ kubernetes:core:Service wpdev-wordpress created
    + ├─ kubernetes:core:ConfigMap default/wpdev-mariadb created
    + ├─ kubernetes:core:Service default/wpdev-mariadb created
    + ├─ kubernetes:apps:StatefulSet default/wpdev-mariadb created
    + └─ kubernetes:apps:Deployment wpdev-wordpress created
    Outputs:
    wordpressIP: "35.193.210.254"
    Resources:
    + 10 created
    Duration: 53s
  4. We can see in the Outputs: section that WordPress was allocated a public IP, in this case 35.193.210.254. It is exported with a stack output variable, wordpressIP. Use curl and grep to retrieve the <title> of the site the proxy points at:

    Terminal window
    curl -sL $(pulumi stack output wordpressIP):80 | grep "<title>"
    <title>User&#039;s Blog! &#8211; Just another WordPress site</title>

    You can also 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.