Created
August 15, 2024 22:55
-
-
Save karlkfi/5ae3103cdb08721fde74c987645df65e to your computer and use it in GitHub Desktop.
Use Gatekeeper mutating webhooks to auto-assign Pods from a namespace to a specific node pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: mutations.gatekeeper.sh/v1 | |
kind: Assign | |
metadata: | |
name: kube-system-node-selector | |
spec: | |
applyTo: | |
- groups: [""] | |
kinds: ["Pod"] | |
versions: ["v1"] | |
match: | |
scope: "Namespaced" | |
namespaces: ["a-team"] | |
location: 'spec.nodeSelector.team' | |
parameters: | |
assign: | |
value: "a-team" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment