forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pulumi#1156 from pulumi/helm-release
Add Go example for new Helm Release feature
- Loading branch information
Showing
10 changed files
with
727 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: kubernetes-go-helm-release-wordpress | ||
runtime: go | ||
description: A minimal Go Pulumi program |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
[![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 Deployed Using Helm Release Resource | ||
|
||
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 | ||
|
||
If you haven't already, follow the steps in [Pulumi Installation and | ||
Setup](https://www.pulumi.com/docs/get-started/install/) and [Configuring Pulumi | ||
Kubernetes](https://www.pulumi.com/docs/intro/cloud-providers/kubernetes/setup/) to get set up with | ||
Pulumi and Kubernetes. | ||
|
||
Now, install dependencies: | ||
|
||
```sh | ||
go mod download | ||
``` | ||
|
||
Create a new stack: | ||
|
||
```sh | ||
$ pulumi stack init | ||
Enter a stack name: dev | ||
``` | ||
|
||
Preview the deployment of the application and the perform the deployment: | ||
|
||
```sh | ||
pulumi up | ||
Previewing update (dev) | ||
|
||
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-dev create | ||
+ └─ kubernetes:helm.sh/v3:Release wpdev create | ||
|
||
Resources: | ||
+ 2 to create | ||
|
||
Do you want to perform this update? yes | ||
Updating (dev) | ||
|
||
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.109.99" | ||
portForwardCommand: "kubectl port-forward svc/wpdev-ysmr245n-wordpress 8080:80" | ||
|
||
Resources: | ||
+ 2 created | ||
|
||
Duration: 1m13s | ||
|
||
``` | ||
|
||
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://localhost:8080` | ||
by running the port-forward command specified in `portForwardCommand`. | ||
|
||
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 (dev) | ||
|
||
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.109.99" | ||
- portForwardCommand: "kubectl port-forward svc/wpdev-ysmr245n-wordpress 8080:80" | ||
|
||
Resources: | ||
- 2 deleted | ||
|
||
Duration: 8s | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
module github.com/pulumi/examples/kubernetes-go-helm-release-wordpress | ||
|
||
go 1.17 | ||
|
||
require ( | ||
github.com/pulumi/pulumi-kubernetes/sdk/v3 v3.15.0 | ||
github.com/pulumi/pulumi/sdk/v3 v3.23.1 | ||
) | ||
|
||
require ( | ||
github.com/blang/semver v3.5.1+incompatible // indirect | ||
github.com/cheggaaa/pb v1.0.18 // indirect | ||
github.com/djherbis/times v1.2.0 // indirect | ||
github.com/emirpasic/gods v1.12.0 // indirect | ||
github.com/gofrs/uuid v3.3.0+incompatible // indirect | ||
github.com/gogo/protobuf v1.3.1 // indirect | ||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b // indirect | ||
github.com/golang/protobuf v1.4.2 // indirect | ||
github.com/grpc-ecosystem/grpc-opentracing v0.0.0-20180507213350-8e809c8a8645 // indirect | ||
github.com/hashicorp/errwrap v1.0.0 // indirect | ||
github.com/hashicorp/go-multierror v1.0.0 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect | ||
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd // indirect | ||
github.com/mattn/go-runewidth v0.0.8 // indirect | ||
github.com/mitchellh/go-homedir v1.1.0 // indirect | ||
github.com/mitchellh/go-ps v1.0.0 // indirect | ||
github.com/opentracing/basictracer-go v1.0.0 // indirect | ||
github.com/opentracing/opentracing-go v1.1.0 // indirect | ||
github.com/pkg/errors v0.9.1 // indirect | ||
github.com/rivo/uniseg v0.2.0 // indirect | ||
github.com/rogpeppe/go-internal v1.8.1 // indirect | ||
github.com/sabhiram/go-gitignore v0.0.0-20180611051255-d3107576ba94 // indirect | ||
github.com/sergi/go-diff v1.1.0 // indirect | ||
github.com/spf13/cobra v1.0.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/src-d/gcfg v1.4.0 // indirect | ||
github.com/texttheater/golang-levenshtein v0.0.0-20191208221605-eb6844b05fc6 // indirect | ||
github.com/tweekmonster/luser v0.0.0-20161003172636-3fa38070dbd7 // indirect | ||
github.com/uber/jaeger-client-go v2.22.1+incompatible // indirect | ||
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect | ||
github.com/xanzy/ssh-agent v0.2.1 // indirect | ||
go.uber.org/atomic v1.6.0 // indirect | ||
golang.org/x/crypto v0.0.0-20200317142112-1b76d66859c6 // indirect | ||
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect | ||
golang.org/x/sys v0.0.0-20210817190340-bfb29a6856f2 // indirect | ||
golang.org/x/text v0.3.2 // indirect | ||
google.golang.org/genproto v0.0.0-20200608115520-7c474a2e3482 // indirect | ||
google.golang.org/grpc v1.29.1 // indirect | ||
google.golang.org/protobuf v1.24.0 // indirect | ||
gopkg.in/src-d/go-billy.v4 v4.3.2 // indirect | ||
gopkg.in/src-d/go-git.v4 v4.13.1 // indirect | ||
gopkg.in/warnings.v0 v0.1.2 // indirect | ||
gopkg.in/yaml.v2 v2.2.8 // indirect | ||
sourcegraph.com/sourcegraph/appdash v0.0.0-20190731080439-ebfcffb1b5c0 // indirect | ||
) |
Oops, something went wrong.