diff --git a/infra/vultr-kubernetes/cluster-setup.md b/infra/vultr-kubernetes/cluster-setup.md deleted file mode 100644 index 57da63c..0000000 --- a/infra/vultr-kubernetes/cluster-setup.md +++ /dev/null @@ -1,62 +0,0 @@ -# First we setup the ingress controller with helm - - -```sh -helm repo add traefik https://helm.traefik.io/traefik -helm repo update -# Now we can install this to our cluster -helm install --kubeconfig config.yaml traefik traefik/traefik -``` - -# Prove the service is present with - -```sh -kubectl --kubeconfig config.yaml get svc -``` - -# Create the pods - -```sh -kubectl --kubeconfig config.yaml -f k8s/nginx-dep.yaml -``` - -# Expose on port 80 - -```sh -kubectl --kubeconfig config.yaml -f k8s/nginx-service.yaml -``` - -# Create ingress on k8s - -```sh -kubectl --kubeconfig config.yaml -f k8s/traefik-ingress.yaml -``` - -# Take the external IP from the ingress - -Put that into terraform's A record for the domain since this is a load balancer -in Vultr ( actual resource apparantly ) - -# Configure cert-manager for traefik ingress - -Using the latest version from here: -https://github.com/cert-manager/cert-manager/releases/download/v1.14.2/cert-manager.crds.yaml - -```sh -kubectl --kubeconfig config.yaml \ - apply --validate=false \ - -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.2/cert-manager.yaml -``` - -# Create the cert issuer and certificate - - -```sh -kubectl --kubeconfig config.yaml apply -f k8s/letsencrypt-issuer.yaml -kubectl --kubeconfig config.yaml apply -f k8s/letsencrypt-issuer.yaml -``` - -Because we just have 1 cert for now we are looking for it's status to be `READY` - - - diff --git a/infra/vultr-kubernetes/dns.tf b/infra/vultr-kubernetes/dns.tf index 7a4934a..2731f0d 100644 --- a/infra/vultr-kubernetes/dns.tf +++ b/infra/vultr-kubernetes/dns.tf @@ -6,7 +6,7 @@ resource vultr_dns_domain temprah_lab { resource vultr_dns_record sample_dns { domain = vultr_dns_domain.temprah_lab.id name = "sample" - data = "45.32.68.232" + data = var.lb_ip4 # data = vultr_kubernetes.athens.ip type = "A" } @@ -14,6 +14,6 @@ resource vultr_dns_record sample_dns { resource vultr_dns_record hello_dns { domain = vultr_dns_domain.temprah_lab.id name = "hello" - data = "45.32.68.232" + data = var.lb_ip4 type = "A" } diff --git a/infra/vultr-kubernetes/output.tf b/infra/vultr-kubernetes/output.tf deleted file mode 100644 index e69de29..0000000 diff --git a/infra/vultr-kubernetes/variables.tfvars b/infra/vultr-kubernetes/variables.tfvars index 876b062..336952f 100644 --- a/infra/vultr-kubernetes/variables.tfvars +++ b/infra/vultr-kubernetes/variables.tfvars @@ -13,3 +13,6 @@ cluster = { lab_domain = "temprah-lab.xyz" +lb_ip4 = "45.32.68.232" + +