This repository has been archived by the owner on Mar 29, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 282
Upgrade Examples and tests to use Helm 3 #88
Merged
Merged
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
53db10f
Upgrade examples and tests to Helm 3
autero1 42cba06
Comment skips
autero1 e1bacbf
Use GetResourceCount
autero1 473a8f0
Fix go mod caching
autero1 5150dda
Update Go Modules documentation
autero1 a67ed0f
[skip ci] Update examples/gke-basic-helm/README.md
autero1 570a0af
Add Helm repo documentation
autero1 465637f
Fix port num in documentation
autero1 00cb38e
Merge branch 'helm3_upgrade' of github.com:autero1/terraform-google-g…
autero1 9cb0b61
Switch to private cluster
autero1 7135f2f
Bump versions and fix checksum path
autero1 3e48277
Try different setting go src path
autero1 36b0490
Fix issue with later network -module and skip helm repo data source
autero1 8c434a3
Update main.tf
autero1 f6771b8
Update main.tf
autero1 a781d0d
Update test/go.mod
autero1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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,88 @@ | ||
# GKE Basic Helm Example | ||
|
||
The root folder contains an example of how to deploy a GKE Public Cluster with an example chart | ||
with [Helm](https://helm.sh/). | ||
|
||
## Overview | ||
|
||
In this guide we will walk through the steps necessary to get up and running with GKE and Helm. Here are the steps: | ||
|
||
1. [Install the necessary tools](#installing-necessary-tools) | ||
1. [Apply the Terraform code](#apply-the-terraform-code) | ||
1. [Verify the Deployed Chart](#verify-the-deployed-chart) | ||
1. [Destroy the Deployed Resources](#destroy-the-deployed-resources) | ||
|
||
## Installing necessary tools | ||
|
||
In addition to `terraform`, this example relies on `gcloud` and `kubectl` and `helm` tools to manage the cluster. | ||
|
||
This means that your system needs to be configured to be able to find `terraform`, `gcloud`, `kubectl` and `helm` | ||
client utilities on the system `PATH`. Here are the installation guides for each tool: | ||
|
||
1. [`gcloud`](https://cloud.google.com/sdk/gcloud/) | ||
1. [`kubectl`](https://kubernetes.io/docs/tasks/tools/install-kubectl/) | ||
1. [`terraform`](https://learn.hashicorp.com/terraform/getting-started/install.html) | ||
1. [`helm`](https://docs.helm.sh/using_helm/#installing-helm) (Minimum version v3.0) | ||
|
||
Make sure the binaries are discoverable in your `PATH` variable. See [this Stack Overflow | ||
post](https://stackoverflow.com/questions/14637979/how-to-permanently-set-path-on-linux-unix) for instructions on | ||
setting up your `PATH` on Unix, and [this | ||
post](https://stackoverflow.com/questions/1618280/where-can-i-set-path-to-make-exe-on-windows) for instructions on | ||
Windows. | ||
|
||
## Apply the Terraform Code | ||
|
||
Now that all the prerequisite tools are installed, we are ready to deploy the GKE cluster! | ||
|
||
1. If you haven't already, clone this repo: | ||
- `git clone https://github.com/gruntwork-io/terraform-google-gke.git` | ||
1. Make sure you are in the `gke-basic-helm` example folder: | ||
- `cd examples/gke-basic-helm` | ||
1. Fill in the required variables in `variables.tf` based on your needs | ||
1. Authenticate to GCP: | ||
- `gcloud auth login` | ||
- `gcloud auth application-default login` | ||
1. Initialize terraform: | ||
- `terraform init` | ||
1. Check the terraform plan: | ||
- `terraform plan` | ||
1. Apply the terraform code: | ||
- `terraform apply` | ||
|
||
At the end of the `terraform apply`, you should now have a working GKE cluster and `kubectl` context configured. | ||
So let's verify that in the next step! | ||
|
||
## Verify the Deployed Chart | ||
|
||
The example configures your `kubectl` context, so you can use `kubectl` and `helm` commands without further configuration. | ||
|
||
To see the created resources, run the following commands: | ||
|
||
``` | ||
❯ kubectl get deployments -n default | ||
NAME READY UP-TO-DATE AVAILABLE AGE | ||
nginx 1/1 1 1 92m | ||
|
||
❯ kubectl get service -n default | ||
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE | ||
kubernetes ClusterIP 10.2.0.1 <none> 443/TCP 113m | ||
nginx LoadBalancer 10.2.5.84 34.77.188.186 80:31588/TCP,443:31332/TCP 99m | ||
|
||
❯ kubectl get pods -n default | ||
NAME READY STATUS RESTARTS AGE | ||
nginx-57454964b8-l4w9w 1/1 Running 0 99m | ||
``` | ||
|
||
If you wish to access the deployed service, you use the `kubectl port-forward` command to forward a local port to the deployed service: | ||
|
||
``` | ||
❯ kubectl port-forward deployment/nginx 8080:8080 -n default | ||
Forwarding from 127.0.0.1:8080 -> 8080 | ||
Forwarding from [::1]:8080 -> 8080 | ||
``` | ||
|
||
You can now access the deployed service by opening your web browser to `http://localhost:8080`. | ||
|
||
## Destroy the deployed resources | ||
|
||
To destroy all resources created by the example, just run `terraform destroy`. |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome docs 👍