You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is to be able to patch resources before they enter the cluster. This is useful in situations where mutations are involved and other tools (like Kyverno) are not powerful enough, for example:
Imagine the user wants to patch pods from a namespace to implement a custom pod affinity/anti-affinity not already covered by Kubernetes. Patching resources can solve this with ease. An examples:
apiVersion: reforma.prosimcorp.com/v1beta1kind: PrePatchmetadata:
name: patch-gateway-podsspec:
# Sources to look for the data to make wonderful patchessources:
- apiVersion: v1kind: Pod# (optional)#name: cluster-infonamespace: istio-gateways# Target to apply patches totarget:
apiVersion: v1kind: Pod# (Optional) Should return a list with just one item if defined# name: ^(istio-gateway-stable-)(.*)namespace: istio-gateways# (required) when to act. Admited operations are those admited by MutatingWebhookConfiguration# Ref: https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/#matching-requests-objectselectoroperation: create # The patch type. Currently, the only supported patch by MutatinWebhookConfiguration is JsonPatchpatchType: application/json-patch+json# Templating section is where you can be creative to craft a patch# Basically, if you know Helm templating and Kustomize patches, do what you wanttemplate: | {{- $targetList := (index . 0) -}} {{- $sourceList := (index . 1) -}} {{- $anotherSourceList := (index . 2) -}} {{/* The rest of the patch here to spread the pods on your own */}}
This will discussed internally, but if someone want to contribute or discuss about this topic, the discussion is open too
The text was updated successfully, but these errors were encountered:
The idea is to be able to patch resources before they enter the cluster. This is useful in situations where mutations are involved and other tools (like Kyverno) are not powerful enough, for example:
Imagine the user wants to patch pods from a namespace to implement a custom pod affinity/anti-affinity not already covered by Kubernetes. Patching resources can solve this with ease. An examples:
This will discussed internally, but if someone want to contribute or discuss about this topic, the discussion is open too
The text was updated successfully, but these errors were encountered: