Coder Social home page Coder Social logo

wi3ard / k8s-nginx-ingress Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 2.0 27 KB

Terraform configuration for deploying Nginx ingress controller in a Kubernetes cluster

License: Apache License 2.0

HCL 85.52% Smarty 14.48%
kubernetes kubernetes-service terraform-configurations terraform terraform-scripts

k8s-nginx-ingress's Introduction

Nginx ingress controller for Kubernetes

Terraform configuration for deploying Nginx ingress controller in a Kubernetes cluster

Features

  • GKE support.
  • Automatic DNS management using Google Cloud DNS.
  • Let's Encrypt wildcard certificate generation using cert-manager.

Before you begin

The following prerequisites need to be installed and configured:

GCE configuration

GOOGLE_APPLICATION_CREDENTIALS environment variable must be configured to point to GCE JSON key file. For example (PowerShell):

$env:GOOGLE_APPLICATION_CREDENTIALS = "C:/mykeys/gce-default.json"

Terraform initialization

Copy terraform.tfvars.example file to terraform.tfvars and set input variables values as per your needs. Then initialize Terraform with init command:

terraform init -backend-config "bucket=$BUCKET_NAME" -backend-config "prefix=apps/$CLUSTER_NAME/nginx-ingress"
  • $REGION should be replaced with a region name.
  • $CLUSTER_NAME should be replaced with the name of a cluster.
  • $BUCKET_NAME should be replaced with a GCS Terraform state storage bucket name.

Installation

To apply the Terraform plan, run:

terraform apply

Uninstall and cleanup

To remove the Terraform plan, run:

terraform destroy

The cert-manager Helm chart included in this plan creates several Custom Resource Definitions that have to be deleted manually:

$ kubectl delete crd certificates.certmanager.k8s.io -n kube-system
customresourcedefinition.apiextensions.k8s.io "certificates.certmanager.k8s.io" deleted

$ kubectl delete crd clusterissuers.certmanager.k8s.io -n kube-system
customresourcedefinition.apiextensions.k8s.io "clusterissuers.certmanager.k8s.io" deleted

$ kubectl delete crd issuers.certmanager.k8s.io -n kube-system
customresourcedefinition.apiextensions.k8s.io "issuers.certmanager.k8s.io" deleted

k8s-nginx-ingress's People

Contributors

wi3ard avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mofesola izzie88

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.