From aaa4ca5e45510894b3a885d2138f4356c2d036ae Mon Sep 17 00:00:00 2001 From: Jim Gustavsson <40056436+jimgus@users.noreply.github.com> Date: Fri, 27 Jan 2023 14:38:07 +0100 Subject: [PATCH] Add modifyset for removing Azure spot taint (#93) --- Makefile | 7 +++++++ .../remove-azure-node-spot-taints.yaml | 17 +++++++++++++++++ .../remove-azure-node-spot-taints.yaml | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 charts/gatekeeper-library-constraints/generated/remove-azure-node-spot-taints.yaml create mode 100644 library/modifysets/remove-azure-node-spot-taints.yaml diff --git a/Makefile b/Makefile index 63c6469..f65c5e0 100644 --- a/Makefile +++ b/Makefile @@ -33,6 +33,13 @@ generate: get-external cp $$D $$CONTRAINTS_GENERATED/$$FILENAME done + MODIFYSETS_LIBRARY=$$(ls -d ./library/modifysets/*) + for D in $$MODIFYSETS_LIBRARY + do + FILENAME=$$(basename $$D) + cp $$D $$CONTRAINTS_GENERATED/$$FILENAME + done + CONSTRAINT_LIBRARY=$$(ls -d ./library/constraints/*/) for D in $$CONSTRAINT_LIBRARY do diff --git a/charts/gatekeeper-library-constraints/generated/remove-azure-node-spot-taints.yaml b/charts/gatekeeper-library-constraints/generated/remove-azure-node-spot-taints.yaml new file mode 100644 index 0000000..d5897e4 --- /dev/null +++ b/charts/gatekeeper-library-constraints/generated/remove-azure-node-spot-taints.yaml @@ -0,0 +1,17 @@ +apiVersion: mutations.gatekeeper.sh/v1beta1 +kind: ModifySet +metadata: + name: remove-azure-node-spot-taints +spec: + location: "spec.taints" + applyTo: + - groups: [""] + kinds: ["Node"] + versions: ["v1"] + parameters: + operation: prune + values: + fromList: + - effect: NoSchedule + key: kubernetes.azure.com/scalesetpriority + value: spot diff --git a/library/modifysets/remove-azure-node-spot-taints.yaml b/library/modifysets/remove-azure-node-spot-taints.yaml new file mode 100644 index 0000000..d5897e4 --- /dev/null +++ b/library/modifysets/remove-azure-node-spot-taints.yaml @@ -0,0 +1,17 @@ +apiVersion: mutations.gatekeeper.sh/v1beta1 +kind: ModifySet +metadata: + name: remove-azure-node-spot-taints +spec: + location: "spec.taints" + applyTo: + - groups: [""] + kinds: ["Node"] + versions: ["v1"] + parameters: + operation: prune + values: + fromList: + - effect: NoSchedule + key: kubernetes.azure.com/scalesetpriority + value: spot