I have a project to modify the pod, and the modification depends on the pod nodeName field. I use the following webhook to intercept the pod, but it cannot intercept the update operation after the kube-scheduler allocates the node
apiVersion: admissionregistration.k8s.io/v1
kind: MutatingWebhookConfiguration
...
...
rules:
- operations: ["UPDATE"]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods"]
Then I try to use interception pods/binding, but when I try to parse the pod binding, I find that the Binding type has been deprecated
rules:
- operations: ["UPDATE"]
apiGroups: [""]
apiVersions: ["v1"]
resources: ["pods/binding"]
k8s.io/api/core/v1/types.go
// Binding ties one object to another; for example, a pod is bound to a node by a scheduler.
// Deprecated in 1.7, please use the bindings subresource of pods instead.
type Binding struct {
But I didn't find the bindings subresource of pods. Where is this resource and how to parse it to get the corresponding pod instance?
I really appreciate any help with this.