Skip to content

aguirresabino/rancher-ha

Repository files navigation

Welcome to Rancher HA 👋

License: MIT

Provisioning Rancher in high availability on DigitalOcean.

Todo

  • Adds security to the cluster
  • Use terraform best practices
  • Use MetalLB and remove instance with Nginx

Services / Tools

  • Cloudflare
  • DigitalOcean
  • Ubuntu Server 20.04 x86
  • Terraform
  • Docker
  • Nginx
  • Rancher Kubernetes Engine
  • Kubernetes
  • Helm
  • cert-manager

Introduction

The purpose of this project is to provision a Kubernetes cluster so that we can install the Rancher in high availability mode. The cluster will be created with the Rancher Kubernetes Engine (RKE), which will facilitate the configuration process. And to automate this process, terraform will be used.

Rancher is an open source project to facilitate container infrastructure management, whether in any cloud service or on-premise environments.

Architecture

Rancher HA

Install

Create infrastructure on DigitalOcean

# Install required providers
terraform init
# Apply action
terraform apply -auto-approve -var-file="sensitive.tfvars"

Create KUBECONFIG env

export KUBECONFIG=./kube_config_cluster.yaml

Instal Nginx Ingress Controller bare-metal version

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.46.0/deploy/static/provider/baremetal/deploy.yaml

Add helm repo

# cert-manager
helm repo add jetstack https://charts.jetstack.io
# rancher
helm repo add rancher-stable https://releases.rancher.com/server-charts/stable

helm repo update

Install cert-manager

helm install \
  cert-manager jetstack/cert-manager \
  --namespace cert-manager \
  --create-namespace \
  --version v1.3.1 \
  --set installCRDs=true

Install Rancher

helm install rancher rancher-latest/rancher \
  --namespace cattle-system \
  --create-namespace \
  --set hostname=rancher.aguirresabino.dev \
  --set ingress.tls.source=letsEncrypt \
  --set letsEncrypt.environment=production \
  --set [email protected] \
  --set letsEncrypt.ingress.class=nginx

Check Rancher deploy status:

kubectl -n cattle-system rollout status deploy/rancher

Destroy infrastructure

terraform destroy -auto-approve -var-file="sensitive.tfvars"

Author

👤 Aguirre Sabino


This README was generated with ❤️ by readme-md-generator

Releases

No releases published

Packages

No packages published