Skip to content

Creation of a HTTPS Web App and a local cluster with Terraform

License

Notifications You must be signed in to change notification settings

mateusclira/web-app-https-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Manage Kubernetes Cluster with Terraform and Web APP Example

In this project I'm demonstrating you how to use Terraform together to create and manage the Kubernetes cluster on Kind.

Prerequisites

  1. Terraform CLI installed
  2. Docker

Getting Started

These commands will get a Cluster with 3 nodes

First, clone the repo:

$ git clone https://github.com/mateusclira/challenge-cloud-engineer.git
$ cd challenge-cloud-engineer

Then initialize Terraform config:

terraform init

Review the actions plan:

terraform plan

Run the Terraform actions:

terraform apply

https://artifacthub.io/packages/helm/ingress-nginx/ingress-nginx

You have to install the ingress-nginx controler

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v1.9.4/deploy/static/provider/cloud/deploy.yaml

Run this to install the cert-manager

https://artifacthub.io/packages/helm/cert-manager/cert-manager

First install the CRDs:

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.2/cert-manager.crds.yaml

Add the helm repo

helm repo add jetstack https://charts.jetstack.io

Then install the cert-manager:

helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --version v1.13.2 --set prometheus.enabled=false --set webhook.timeoutSeconds=4

You are going to need to indicate that the your cluster's IP is addressed to your Hostname. To do so, you are going to need a DNS Provider service

Now, apply the Issuer, so it can provide the environment for the Certificate

kubectl apply -f .\kubernetes\issuer.yaml 

Deploy the application and the service

kubectl apply -f .\kubernetes\deployment.yaml 
kubectl apply -f .\kubernetes\service.yaml

We can now create our Certificate, which will be the last requisite for the Ingress

kubectl apply -f .\kubernetes\certificate.yaml

Make sure your certificate ran correctly and created the tls. You should be able to see a recently created kubernetes.io/tls's TYPE

kubectl get secrets

Finally, create the ingress, and the HTTPS will be available.

kubectl apply -f .\kubernetes\ingress.yaml

Uses on this Github include:

  1. Terraform Kind Cluster Creation
  2. Deploy of a Web Application
  3. Ingress to deploy HTTPS on a Kubernetes Cluster

Guides for study

  1. Kubernetes
  1. Kind
  1. SSL/TLS
  1. Network on Cluster
  1. Configuring Ingress

About

Creation of a HTTPS Web App and a local cluster with Terraform

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages