From 0e2eb430a5047874dbb2f4faf3ab9363701a2b00 Mon Sep 17 00:00:00 2001 From: shockrah Date: Wed, 29 May 2024 22:29:22 -0700 Subject: [PATCH] Deprecating old stuff and bringing in new tf managed cluster content --- infra/vultr-kubernetes/k8s/.gitignore | 1 + infra/vultr-kubernetes/k8s/backend.tf | 33 +++++++++++++++++++ infra/vultr-kubernetes/k8s/namespace.tf | 5 +++ infra/vultr-kubernetes/k8s/variables.tf | 21 ++++++++++++ .../alternate.temprah-lab.xyz/main.yaml | 0 .../alternate.temprah-lab.xyz/tls.yaml | 0 .../{ => yaml}/letsencrypt-certificate.yaml | 0 .../k8s/{ => yaml}/letsencrypt-issuer.yaml | 0 .../{ => yaml}/temprah-lab.xyz/nginx-dep.yaml | 0 .../temprah-lab.xyz/nginx-service.yaml | 0 .../vultr-kubernetes/k8s/{ => yaml}/tls.yaml | 0 .../k8s/{ => yaml}/traefik-ingress.yaml | 0 12 files changed, 60 insertions(+) create mode 100644 infra/vultr-kubernetes/k8s/.gitignore create mode 100644 infra/vultr-kubernetes/k8s/backend.tf create mode 100644 infra/vultr-kubernetes/k8s/namespace.tf create mode 100644 infra/vultr-kubernetes/k8s/variables.tf rename infra/vultr-kubernetes/k8s/{ => yaml}/alternate.temprah-lab.xyz/main.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/alternate.temprah-lab.xyz/tls.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/letsencrypt-certificate.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/letsencrypt-issuer.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/temprah-lab.xyz/nginx-dep.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/temprah-lab.xyz/nginx-service.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/tls.yaml (100%) rename infra/vultr-kubernetes/k8s/{ => yaml}/traefik-ingress.yaml (100%) diff --git a/infra/vultr-kubernetes/k8s/.gitignore b/infra/vultr-kubernetes/k8s/.gitignore new file mode 100644 index 0000000..b0e86bb --- /dev/null +++ b/infra/vultr-kubernetes/k8s/.gitignore @@ -0,0 +1 @@ +terraform.yaml diff --git a/infra/vultr-kubernetes/k8s/backend.tf b/infra/vultr-kubernetes/k8s/backend.tf new file mode 100644 index 0000000..b658f54 --- /dev/null +++ b/infra/vultr-kubernetes/k8s/backend.tf @@ -0,0 +1,33 @@ +terraform { + required_version = ">= 0.13" + backend s3 { + bucket = "project-athens" + key = "infra/vke/k8s/state/build.tfstate" + region = "us-west-1" + encrypt = true + } + required_providers { + # For interacting with S3 + aws = { + source = "hashicorp/aws" + version = "~> 5.0" + } + kubernetes = { + source = "hashicorp/kubernetes" + version = "2.30.0" + } + } +} + +provider aws { + access_key = var.aws_key + secret_key = var.aws_secret + region = var.aws_region + max_retries = 1 +} + +provider kubernetes { + config_path = "terraform.yaml" +} + + diff --git a/infra/vultr-kubernetes/k8s/namespace.tf b/infra/vultr-kubernetes/k8s/namespace.tf new file mode 100644 index 0000000..8885fc4 --- /dev/null +++ b/infra/vultr-kubernetes/k8s/namespace.tf @@ -0,0 +1,5 @@ +resource kubernetes_namespace websites { + metadata { + name = "websites" + } +} diff --git a/infra/vultr-kubernetes/k8s/variables.tf b/infra/vultr-kubernetes/k8s/variables.tf new file mode 100644 index 0000000..b08e0d4 --- /dev/null +++ b/infra/vultr-kubernetes/k8s/variables.tf @@ -0,0 +1,21 @@ +# API Keys required to reach AWS/Vultr +variable vultr_api_key { + type = string + sensitive = true +} + +variable aws_key { + type = string + sensitive = true +} + +variable aws_secret { + type = string + sensitive = true +} + +variable aws_region { + type = string + sensitive = true +} + diff --git a/infra/vultr-kubernetes/k8s/alternate.temprah-lab.xyz/main.yaml b/infra/vultr-kubernetes/k8s/yaml/alternate.temprah-lab.xyz/main.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/alternate.temprah-lab.xyz/main.yaml rename to infra/vultr-kubernetes/k8s/yaml/alternate.temprah-lab.xyz/main.yaml diff --git a/infra/vultr-kubernetes/k8s/alternate.temprah-lab.xyz/tls.yaml b/infra/vultr-kubernetes/k8s/yaml/alternate.temprah-lab.xyz/tls.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/alternate.temprah-lab.xyz/tls.yaml rename to infra/vultr-kubernetes/k8s/yaml/alternate.temprah-lab.xyz/tls.yaml diff --git a/infra/vultr-kubernetes/k8s/letsencrypt-certificate.yaml b/infra/vultr-kubernetes/k8s/yaml/letsencrypt-certificate.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/letsencrypt-certificate.yaml rename to infra/vultr-kubernetes/k8s/yaml/letsencrypt-certificate.yaml diff --git a/infra/vultr-kubernetes/k8s/letsencrypt-issuer.yaml b/infra/vultr-kubernetes/k8s/yaml/letsencrypt-issuer.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/letsencrypt-issuer.yaml rename to infra/vultr-kubernetes/k8s/yaml/letsencrypt-issuer.yaml diff --git a/infra/vultr-kubernetes/k8s/temprah-lab.xyz/nginx-dep.yaml b/infra/vultr-kubernetes/k8s/yaml/temprah-lab.xyz/nginx-dep.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/temprah-lab.xyz/nginx-dep.yaml rename to infra/vultr-kubernetes/k8s/yaml/temprah-lab.xyz/nginx-dep.yaml diff --git a/infra/vultr-kubernetes/k8s/temprah-lab.xyz/nginx-service.yaml b/infra/vultr-kubernetes/k8s/yaml/temprah-lab.xyz/nginx-service.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/temprah-lab.xyz/nginx-service.yaml rename to infra/vultr-kubernetes/k8s/yaml/temprah-lab.xyz/nginx-service.yaml diff --git a/infra/vultr-kubernetes/k8s/tls.yaml b/infra/vultr-kubernetes/k8s/yaml/tls.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/tls.yaml rename to infra/vultr-kubernetes/k8s/yaml/tls.yaml diff --git a/infra/vultr-kubernetes/k8s/traefik-ingress.yaml b/infra/vultr-kubernetes/k8s/yaml/traefik-ingress.yaml similarity index 100% rename from infra/vultr-kubernetes/k8s/traefik-ingress.yaml rename to infra/vultr-kubernetes/k8s/yaml/traefik-ingress.yaml