Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Latest commit

 

History

History
64 lines (47 loc) · 1.63 KB

README.md

File metadata and controls

64 lines (47 loc) · 1.63 KB

Control plane

  • Create a VPC (intra, private and public subnets)
  • Create a management EKS cluster in a single zone
  • Use SPOT instances
  • Use bottlerocket AMI
  • Install and configure Karpenter
  • Install and configure Flux
  • Write a secret that contains the cluster's specific variables that will be used with Flux. (please refer to variables substitutions)
  • Deploy Cilium

How to apply this?

  1. Edit the file backend.tf and put your own S3 bucket name.
  2. Create a file that contains your own variables. Here's an example:

variables.tfvars

env          = "dev"
cluster_name = "mycluster-0" # Generated with petname

github_owner    = "Smana"
github_token    = <REDACTED>
repository_name = "cilium-gateway-api"

tags = {
  GithubRepo = "cilium-gateway-api"
  GithubOrg  = "Smana"
}
  1. Apply with terraform apply -var-file variables.tfvars

Cleaning things up

In order to really clean everything you should follow these steps:

  1. Suspend Flux reconciliations

    flux suspend kustomization --all
  2. Delete Gateways (These create AWS loadbalancers)

    kubectl delete gateways --all-namespaces --all
  3. Wait 3/4 minutest and delete all IRSA

    kubectl delete irsa --all-namespaces --all
  4. terraform destroy --var-file variables.tfvars

One step:

flux suspend kustomization --all && \
kubectl delete gateways --all-namespaces --all && sleep 60 && \
kubectl delete irsa --all-namespaces --all && sleep 30 && \
terraform destroy --var-file variables.tfvars