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