From 3c1b10a931c0f021aec6a34eacb46c44e261e3b0 Mon Sep 17 00:00:00 2001 From: James Callahan Date: Wed, 24 Jul 2024 00:52:42 +1000 Subject: [PATCH 1/2] kustomize: move base resources to a subfolder retains a top level kustomization file for compatibility --- kustomize/base/kustomization.yaml | 8 ++++++++ kustomize/{ => base}/resources.yaml | 0 kustomize/kustomization.yaml | 6 +----- 3 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 kustomize/base/kustomization.yaml rename kustomize/{ => base}/resources.yaml (100%) diff --git a/kustomize/base/kustomization.yaml b/kustomize/base/kustomization.yaml new file mode 100644 index 0000000..a18fe46 --- /dev/null +++ b/kustomize/base/kustomization.yaml @@ -0,0 +1,8 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app.kubernetes.io/name: tkhq-frames +resources: + - resources.yaml +images: + - name: ghcr.io/tkhq/frames diff --git a/kustomize/resources.yaml b/kustomize/base/resources.yaml similarity index 100% rename from kustomize/resources.yaml rename to kustomize/base/resources.yaml diff --git a/kustomize/kustomization.yaml b/kustomize/kustomization.yaml index a18fe46..3c2f51f 100644 --- a/kustomize/kustomization.yaml +++ b/kustomize/kustomization.yaml @@ -1,8 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -commonLabels: - app.kubernetes.io/name: tkhq-frames resources: - - resources.yaml -images: - - name: ghcr.io/tkhq/frames + - ./base From 1ad94b55e6784b70bcd8752fe4ffb6cd44577bd2 Mon Sep 17 00:00:00 2001 From: James Callahan Date: Wed, 24 Jul 2024 00:45:24 +1000 Subject: [PATCH 2/2] kustomize: add "ha" overlay for high availbility Includes a pod disruption budget to ensure we always run at least 1 pod during node rolls etc. Run at least 2 replicas --- kustomize/ha/kustomization.yaml | 10 ++++++++++ kustomize/ha/pdb.yaml | 8 ++++++++ 2 files changed, 18 insertions(+) create mode 100644 kustomize/ha/kustomization.yaml create mode 100644 kustomize/ha/pdb.yaml diff --git a/kustomize/ha/kustomization.yaml b/kustomize/ha/kustomization.yaml new file mode 100644 index 0000000..f16837d --- /dev/null +++ b/kustomize/ha/kustomization.yaml @@ -0,0 +1,10 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +commonLabels: + app.kubernetes.io/name: tkhq-frames +resources: + - ../base + - pdb.yaml +replicas: + - name: frames + count: 2 diff --git a/kustomize/ha/pdb.yaml b/kustomize/ha/pdb.yaml new file mode 100644 index 0000000..8e3a130 --- /dev/null +++ b/kustomize/ha/pdb.yaml @@ -0,0 +1,8 @@ +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: frames +spec: + minAvailable: 1 + selector: + matchLabels: {}