Asking for help? Comment out what you need so we can get more information to help you!
Cluster information:
Kubernetes version: 1.27.10
Cloud being used: bare-metal
Installation method: Rancher
Host OS: RHEL
CNI and version: Calico
CRI and version: Cri-o
You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.
First of all my background: I know Kubernetes really well but not kustomize.
My question is how to patch every container in all deployments/statefulsets via kustomize. Specially I want to update the securityContext of these with the following values:
"allowPrivilegeEscalation": false
capabilities:
drop:
- ALL
This is needed because our customer introduced this kind of security mechanism.
I want to install Kubeflow which has a lot of deployments and sts. (This is the reason I use Kustomize)
I use the latest Kustomize version.
Currently i tried it with json patch:
[
{
"op": "add",
"path": "/spec/template/spec/containers/*/securityContext",
"value": {
"allowPrivilegeEscalation": false
}
}
]
and
[
{
"op": "add",
"path": "/spec/template/spec/containers/*/securityContext/capabilities/drop",
"value": ["ALL"]
}
]
But this does not work.
Can someone help me?
PS: If something with this topic is wrong, please tell me. My first post.
Thanks to everyone who is willing to help me, I really appreciate all of you!