Skip to content

thecodekitchen/terraform-k8s-example

Repository files navigation

terraform-k8s-example

An example of a managed kubernetes deployment on AWS, Azure, and GCP using Terraform.

Why deploy this way?

There are a number of reasons this strategy could be useful for your operations.

Centralized Blueprints

Terraform scripts contain all the relevant details of how your cloud resources relate to one another and to the internet at large. In the case of Kubernetes deployments, this can be extremely useful since that information is necessary in order to properly configure a manifest to run on a cluster.

Turnkey Deployments

Terraform has the ability to provision entire cloud networks with one script. When combined with tools like Github Actions, you can deploy everything your team has designed with the click of a single button.

Infrastructure Security

Because Terraform scripts can isolate the entire deployment process to a single step, there becomes only one set of credentials to manage for all of your infrastructure management.

How can I use this repo?

This repo includes Terraform modules for provisioning a managed Kubernetes cluster on AWS Elastic Kubernetes Service, Azure Kubernetes Service, or Google Kubernetes Engine. The actions are written with the assumption that the resources to be deployed are specified in a Kubernetes manifest file.

Create OIDC Credentials

Instructions for configuring AWS, GCP, and Azure OIDC credentials for Github can be found at the provided links.

Deploy a Kubernetes Manifest

The simplest way to deploy a set of custom resources to the clusters provisioned with these modules is to describe your deployments, services, and other resources in a Kubernetes manifest file like the one provided as an example. Clone the template on your own account and fill in the secrets and variables with authentication data from your desired provider using the secrets and variables/actions tab of the settings menu on your repo. Then replace the example manifest with your own and the actions should deploy, destroy, and run basic health checks on your application.

Deploy a Helm Chart (experimental)

You can deploy a Helm chart by specifying a name for it in the CHART_NAME variable in your repository variables (not secrets). Then, run the deploy-helm action for your desired platform. That's it!

If you would like to deploy a custom Helm chart, simply upload its root directory into your repository and set the CHART_NAME variable to 'app'.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published