Provisioning Rancher in high availability on DigitalOcean.
- Adds security to the cluster
- Use terraform best practices
- Use MetalLB and remove instance with Nginx
- Cloudflare
- DigitalOcean
- Ubuntu Server 20.04 x86
- Terraform
- Docker
- Nginx
- Rancher Kubernetes Engine
- Kubernetes
- Helm
- cert-manager
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.
# Install required providers
terraform init
# Apply action
terraform apply -auto-approve -var-file="sensitive.tfvars"
export KUBECONFIG=./kube_config_cluster.yaml
kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.46.0/deploy/static/provider/baremetal/deploy.yaml
# 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
helm install \
cert-manager jetstack/cert-manager \
--namespace cert-manager \
--create-namespace \
--version v1.3.1 \
--set installCRDs=true
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
terraform destroy -auto-approve -var-file="sensitive.tfvars"
👤 Aguirre Sabino
- Github: @aguirresabino
- LinkedIn: @aguirresabino
This README was generated with ❤️ by readme-md-generator