From da450c08dd311b2ae9488159fc6fc1c1c9f9dc9b Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Mon, 2 May 2022 21:44:33 +0100 Subject: [PATCH] Decommission k8s environment Need a little more time in the playground before I have use of a production-grade environment. Especially when it's costing $20/mo --- k8s/kustomization.yml | 4 ---- k8s/whoami/deployment.yml | 24 ----------------------- k8s/whoami/ingress.yml | 17 ----------------- k8s/whoami/kustomization.yml | 8 -------- k8s/whoami/namespace.yml | 4 ---- k8s/whoami/service.yml | 13 ------------- scripts/k8s/apply.sh | 5 ----- scripts/k8s/lint.sh | 7 ------- terraform/the-ring.tf | 37 ------------------------------------ 9 files changed, 119 deletions(-) delete mode 100644 k8s/kustomization.yml delete mode 100644 k8s/whoami/deployment.yml delete mode 100644 k8s/whoami/ingress.yml delete mode 100644 k8s/whoami/kustomization.yml delete mode 100644 k8s/whoami/namespace.yml delete mode 100644 k8s/whoami/service.yml delete mode 100755 scripts/k8s/apply.sh delete mode 100755 scripts/k8s/lint.sh delete mode 100644 terraform/the-ring.tf diff --git a/k8s/kustomization.yml b/k8s/kustomization.yml deleted file mode 100644 index 338d5e1..0000000 --- a/k8s/kustomization.yml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -resources: - - whoami diff --git a/k8s/whoami/deployment.yml b/k8s/whoami/deployment.yml deleted file mode 100644 index 2299d1f..0000000 --- a/k8s/whoami/deployment.yml +++ /dev/null @@ -1,24 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: whoami -spec: - selector: - matchLabels: - app: whoami - replicas: 2 - template: - metadata: - labels: - app: whoami - spec: - containers: - - name: whoami - image: traefik/whoami - readinessProbe: - httpGet: - path: / - port: 80 - ports: - - containerPort: 80 - imagePullPolicy: Always diff --git a/k8s/whoami/ingress.yml b/k8s/whoami/ingress.yml deleted file mode 100644 index 71e6a6e..0000000 --- a/k8s/whoami/ingress.yml +++ /dev/null @@ -1,17 +0,0 @@ -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: whoami -spec: - ingressClassName: nginx - rules: - - host: whoami.localhost - http: - paths: - - path: / - pathType: Prefix - backend: - service: - name: whoami - port: - number: 80 diff --git a/k8s/whoami/kustomization.yml b/k8s/whoami/kustomization.yml deleted file mode 100644 index 30a02f5..0000000 --- a/k8s/whoami/kustomization.yml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: kustomize.config.k8s.io/v1beta1 -kind: Kustomization -namespace: whoami -resources: - - deployment.yml - - ingress.yml - - namespace.yml - - service.yml diff --git a/k8s/whoami/namespace.yml b/k8s/whoami/namespace.yml deleted file mode 100644 index f7d1afe..0000000 --- a/k8s/whoami/namespace.yml +++ /dev/null @@ -1,4 +0,0 @@ -apiVersion: v1 -kind: Namespace -metadata: - name: whoami diff --git a/k8s/whoami/service.yml b/k8s/whoami/service.yml deleted file mode 100644 index 39f0019..0000000 --- a/k8s/whoami/service.yml +++ /dev/null @@ -1,13 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: whoami - labels: - app: whoami -spec: - ports: - - port: 80 - targetPort: 80 - protocol: TCP - selector: - app: whoami diff --git a/scripts/k8s/apply.sh b/scripts/k8s/apply.sh deleted file mode 100755 index 5ab9cbe..0000000 --- a/scripts/k8s/apply.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -set -e - -kubectl apply -k ./k8s diff --git a/scripts/k8s/lint.sh b/scripts/k8s/lint.sh deleted file mode 100755 index 7fc9627..0000000 --- a/scripts/k8s/lint.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash - -set -e - -PATH=${PWD}/env/bin:${PATH} - -yamllint -c ./yamllint.yml ./k8s diff --git a/terraform/the-ring.tf b/terraform/the-ring.tf deleted file mode 100644 index f35475d..0000000 --- a/terraform/the-ring.tf +++ /dev/null @@ -1,37 +0,0 @@ -resource "linode_lke_cluster" "the-ring" { - label = "the-ring" - k8s_version = "1.22" - region = "eu-west" - - pool { - type = "g6-standard-1" - count = 1 - } -} - -resource "linode_firewall" "the-ring" { - label = "the-ring" - linodes = [ - for node in linode_lke_cluster.the-ring.pool[0].nodes : - node.instance_id - ] - outbound_policy = "ACCEPT" - inbound_policy = "DROP" - - inbound { - label = "allow-ping" - action = "ACCEPT" - protocol = "ICMP" - ipv4 = ["0.0.0.0/0"] - ipv6 = ["::/0"] - } - - inbound { - label = "allow-k8s-unprivileged" - action = "ACCEPT" - protocol = "TCP" - ports = "30000-32767" - ipv4 = ["0.0.0.0/0"] - ipv6 = ["::/0"] - } -}