Skip to content

Commit

Permalink
Fix go helm release example
Browse files Browse the repository at this point in the history
  • Loading branch information
viveklak committed Feb 3, 2022
1 parent cf8cec6 commit 23cf486
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 62 deletions.
72 changes: 36 additions & 36 deletions kubernetes-go-helm-release-wordpress/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[![Deploy](https://get.pulumi.com/new/button.svg)](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/blob/master/kubernetes-go-helm-wordpress/README.md)
[![Deploy](https://get.pulumi.com/new/button.svg)](https://app.pulumi.com/new?template=https://github.com/pulumi/examples/blob/master/kubernetes-go-helm-release-wordpress/README.md)

# Wordpress Helm Chart
# Wordpress Helm Chart Deployed Using Helm Release Resource

Uses the Helm Release API of `pulumi-kubernetes` to deploy `v13.0.6` of the Wordpress Helm Chart to a
Kubernetes cluster. Pulumi will expand the Helm Chart and submit the expanded YAML to the cluster.
Uses the Helm Release resource in `pulumi-kubernetes` to deploy `v13.0.6` of the Wordpress Helm Chart to a
Kubernetes cluster. Pulumi will use native Helm support to deploy the chart on the target Kubernetes cluster.

![wordpress](images/deploy.gif "Wordpress Helm Release deployment")

## Running the App

Expand All @@ -22,72 +24,70 @@ Create a new stack:

```sh
$ pulumi stack init
Enter a stack name: wordpress-dev
Enter a stack name: dev
```

Preview the deployment of the application and the perform the deployment:

```sh
pulumi up
Previewing update (wordpress-dev)
Previewing update (dev)

View Live: https://app.pulumi.com/...
View Live: https://app.pulumi.com/.../kubernetes-go-helm-release-wordpress/dev/previews/01ac68a0-bcce-4bc8-a34c-cad12544b839

Type Name Plan
+ pulumi:pulumi:Stack kubernetes-go-helm-release-wordpress-wordpress-dev create
+ └─ kubernetes:helm.sh/v3:Release wpdev create
Type Name Plan
+ pulumi:pulumi:Stack kubernetes-go-helm-release-wordpress-dev create
+ └─ kubernetes:helm.sh/v3:Release wpdev create

Resources:
+ 2 to create

Do you want to perform this update? yes
Updating (wordpress-dev)

View Live: https://app.pulumi.com/...
Updating (dev)

Type Name Status
+ pulumi:pulumi:Stack kubernetes-go-helm-release-wordpress-wordpress-dev created
+ ├─ kubernetes:helm.sh/v3:Release wpdev created
└─ kubernetes:core/v1:Service frontendIp
View Live: https://app.pulumi.com/.../kubernetes-go-helm-release-wordpress/dev/updates/11

Type Name Status
+ pulumi:pulumi:Stack kubernetes-go-helm-release-wordpress-dev created
+ ├─ kubernetes:helm.sh/v3:Release wpdev created
└─ kubernetes:core/v1:Service svc

Outputs:
frontendIp: "10.96.85.225"
frontendIp : "10.96.109.99"
portForwardCommand: "kubectl port-forward svc/wpdev-ysmr245n-wordpress 8080:80"

Resources:
+ 2 created

Duration: 1m4s
Duration: 1m13s

```

We can see here in the `---outputs:---` section that Wordpress was allocated a public IP, in this
case `10.96.85.225`. It is exported with a stack output variable, `frontendIp`. We can use `curl`
and `grep` to retrieve the `<title>` of the site the proxy points at.

```sh
$ curl -sL $(pulumi stack output frontendIp):80 | grep "<title>"
<title>User&#039;s Blog! &#8211; Just another WordPress site</title>
```
We can see here in the `---outputs:---` section that Wordpress was allocated a cluster IP, in this
case `10.96.109.99`. It is exported with a stack output variable, `frontendIp`. Since this is a Cluster IP,
you will need to port-forward to the service in order to hit the endpoint at `http:https://localhost:8080`
by running the port-forward command specified in `portForwardCommand`.

You can also navigate to the site in a web browser.
You can navigate to the site in a web browser.

When you're done, you can remove these resources with `pulumi destroy`:

```sh
pulumi destroy --skip-preview
Destroying (wordpress-dev)
Destroying (dev)

View Live: https://app.pulumi.com/example/...

Type Name Status
- pulumi:pulumi:Stack kubernetes-go-helm-release-wordpress-wordpress-dev deleted
- └─ kubernetes:helm.sh/v3:Release wpdev deleted
View Live: https://app.pulumi.com/.../kubernetes-go-helm-release-wordpress/dev/updates/12

Type Name Status
- pulumi:pulumi:Stack kubernetes-go-helm-release-wordpress-dev deleted
- └─ kubernetes:helm.sh/v3:Release wpdev deleted

Outputs:
- frontendIp: "10.96.85.225""
- frontendIp : "10.96.109.99"
- portForwardCommand: "kubectl port-forward svc/wpdev-ysmr245n-wordpress 8080:80"

Resources:
- 2 deleted

Duration: 9s
Duration: 8s
```
Loading

0 comments on commit 23cf486

Please sign in to comment.