From 1027173c1f6936ffad34c7d79ad2a10419862e5c Mon Sep 17 00:00:00 2001 From: 3deep5me Date: Tue, 14 Nov 2023 13:07:24 +0100 Subject: [PATCH 1/5] added MachineHealthCheck --- templates/cluster-template.yaml | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/templates/cluster-template.yaml b/templates/cluster-template.yaml index dd400ee..8a01d2c 100644 --- a/templates/cluster-template.yaml +++ b/templates/cluster-template.yaml @@ -436,4 +436,25 @@ data: user: ${PROXMOX_USER:=""} password: ${PROXMOX_PASSWORD:=""} tokenID: ${PROXMOX_TOKENID:=""} - secret: ${PROXMOX_SECRET:=""} \ No newline at end of file + secret: ${PROXMOX_SECRET:=""} + +--- + +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachineHealthCheck +metadata: + name: ${CLUSTER_NAME}-unhealthy-5m +spec: + clusterName: '${CLUSTER_NAME}' + nodeStartupTimeout: 5m + maxUnhealthy: 100% + selector: + matchLabels: + cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}' + unhealthyConditions: + - type: Ready + status: Unknown + timeout: 300s + - type: Ready + status: "False" + timeout: 300s \ No newline at end of file From 6b97a244f8b55be53e594e850f4fc30c1d23d897 Mon Sep 17 00:00:00 2001 From: 3deep5me Date: Thu, 16 Nov 2023 09:58:24 +0100 Subject: [PATCH 2/5] restructure to kustomize overlays --- templates/{ => base}/cluster-template.yaml | 23 +------------------ templates/{ => base}/kustomization.yaml | 1 - templates/flavors/advanced/kustomization.yaml | 5 ++++ .../flavors/advanced/machinehealthcheck.yaml | 18 +++++++++++++++ .../flavors/quick-start/kustomization.yaml | 4 ++++ 5 files changed, 28 insertions(+), 23 deletions(-) rename templates/{ => base}/cluster-template.yaml (94%) rename templates/{ => base}/kustomization.yaml (81%) create mode 100644 templates/flavors/advanced/kustomization.yaml create mode 100644 templates/flavors/advanced/machinehealthcheck.yaml create mode 100644 templates/flavors/quick-start/kustomization.yaml diff --git a/templates/cluster-template.yaml b/templates/base/cluster-template.yaml similarity index 94% rename from templates/cluster-template.yaml rename to templates/base/cluster-template.yaml index 8a01d2c..dd400ee 100644 --- a/templates/cluster-template.yaml +++ b/templates/base/cluster-template.yaml @@ -436,25 +436,4 @@ data: user: ${PROXMOX_USER:=""} password: ${PROXMOX_PASSWORD:=""} tokenID: ${PROXMOX_TOKENID:=""} - secret: ${PROXMOX_SECRET:=""} - ---- - -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachineHealthCheck -metadata: - name: ${CLUSTER_NAME}-unhealthy-5m -spec: - clusterName: '${CLUSTER_NAME}' - nodeStartupTimeout: 5m - maxUnhealthy: 100% - selector: - matchLabels: - cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}' - unhealthyConditions: - - type: Ready - status: Unknown - timeout: 300s - - type: Ready - status: "False" - timeout: 300s \ No newline at end of file + secret: ${PROXMOX_SECRET:=""} \ No newline at end of file diff --git a/templates/kustomization.yaml b/templates/base/kustomization.yaml similarity index 81% rename from templates/kustomization.yaml rename to templates/base/kustomization.yaml index 8b6d1fe..4d79dd5 100644 --- a/templates/kustomization.yaml +++ b/templates/base/kustomization.yaml @@ -1,5 +1,4 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization -namespace: default resources: - cluster-template.yaml \ No newline at end of file diff --git a/templates/flavors/advanced/kustomization.yaml b/templates/flavors/advanced/kustomization.yaml new file mode 100644 index 0000000..59b49d3 --- /dev/null +++ b/templates/flavors/advanced/kustomization.yaml @@ -0,0 +1,5 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base + - machinehealthcheck.yaml \ No newline at end of file diff --git a/templates/flavors/advanced/machinehealthcheck.yaml b/templates/flavors/advanced/machinehealthcheck.yaml new file mode 100644 index 0000000..b17dc24 --- /dev/null +++ b/templates/flavors/advanced/machinehealthcheck.yaml @@ -0,0 +1,18 @@ +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachineHealthCheck +metadata: + name: ${CLUSTER_NAME}-unhealthy-5m +spec: + clusterName: '${CLUSTER_NAME}' + nodeStartupTimeout: 5m + maxUnhealthy: 100% + selector: + matchLabels: + cluster.x-k8s.io/cluster-name: '${CLUSTER_NAME}' + unhealthyConditions: + - type: Ready + status: Unknown + timeout: 300s + - type: Ready + status: "False" + timeout: 300s \ No newline at end of file diff --git a/templates/flavors/quick-start/kustomization.yaml b/templates/flavors/quick-start/kustomization.yaml new file mode 100644 index 0000000..2eae97f --- /dev/null +++ b/templates/flavors/quick-start/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../../base \ No newline at end of file From 825caaadcd43ead76e67f3558e35f249225ecf16 Mon Sep 17 00:00:00 2001 From: 3deep5me Date: Sun, 19 Nov 2023 17:26:09 +0100 Subject: [PATCH 3/5] renamed flavor & added namespace --- .../{advanced => machine-health-check}/kustomization.yaml | 0 .../{advanced => machine-health-check}/machinehealthcheck.yaml | 1 + 2 files changed, 1 insertion(+) rename templates/flavors/{advanced => machine-health-check}/kustomization.yaml (100%) rename templates/flavors/{advanced => machine-health-check}/machinehealthcheck.yaml (93%) diff --git a/templates/flavors/advanced/kustomization.yaml b/templates/flavors/ machine-health-check/kustomization.yaml similarity index 100% rename from templates/flavors/advanced/kustomization.yaml rename to templates/flavors/ machine-health-check/kustomization.yaml diff --git a/templates/flavors/advanced/machinehealthcheck.yaml b/templates/flavors/ machine-health-check/machinehealthcheck.yaml similarity index 93% rename from templates/flavors/advanced/machinehealthcheck.yaml rename to templates/flavors/ machine-health-check/machinehealthcheck.yaml index b17dc24..84546ef 100644 --- a/templates/flavors/advanced/machinehealthcheck.yaml +++ b/templates/flavors/ machine-health-check/machinehealthcheck.yaml @@ -2,6 +2,7 @@ apiVersion: cluster.x-k8s.io/v1beta1 kind: MachineHealthCheck metadata: name: ${CLUSTER_NAME}-unhealthy-5m + namespace: "${NAMESPACE}" spec: clusterName: '${CLUSTER_NAME}' nodeStartupTimeout: 5m From 48988a4eaffc88e51a6afe65f5ecd265cd41be68 Mon Sep 17 00:00:00 2001 From: 3deep5me Date: Sun, 19 Nov 2023 17:46:31 +0100 Subject: [PATCH 4/5] removed trailing whitespace --- .../kustomization.yaml | 0 .../machinehealthcheck.yaml | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename templates/flavors/{ machine-health-check => machine-health-check}/kustomization.yaml (100%) rename templates/flavors/{ machine-health-check => machine-health-check}/machinehealthcheck.yaml (100%) diff --git a/templates/flavors/ machine-health-check/kustomization.yaml b/templates/flavors/machine-health-check/kustomization.yaml similarity index 100% rename from templates/flavors/ machine-health-check/kustomization.yaml rename to templates/flavors/machine-health-check/kustomization.yaml diff --git a/templates/flavors/ machine-health-check/machinehealthcheck.yaml b/templates/flavors/machine-health-check/machinehealthcheck.yaml similarity index 100% rename from templates/flavors/ machine-health-check/machinehealthcheck.yaml rename to templates/flavors/machine-health-check/machinehealthcheck.yaml From 72466522e612989a888a2222aa352e9865c1d75c Mon Sep 17 00:00:00 2001 From: 3deep5me Date: Sun, 19 Nov 2023 17:46:56 +0100 Subject: [PATCH 5/5] added new cluster-template builds into makefile --- Makefile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index a986f95..0508ff3 100644 --- a/Makefile +++ b/Makefile @@ -217,9 +217,8 @@ release-metadata: $(RELEASE_DIR) .PHONY: release-templates release-templates: $(RELEASE_DIR) - cp templates/cluster-template* $(RELEASE_DIR)/ - - + $(KUSTOMIZE) build templates/flavors/machine-health-check > $(RELEASE_DIR)/cluster-template-mhc.yaml + $(KUSTOMIZE) build templates/flavors/quick-start > $(RELEASE_DIR)/cluster-template.yaml ##@ Build Dependencies ## Location to install dependencies to