I am experimenting with openshift/minishift, I find myself having to run:
oc edit scc privileged
and add:
- system:serviceaccount:default:router
So I can expose the pods. Is there a way to do it in a script?
I know oc adm
have some command for policy manipulation but I can't figure out how to add this line.
You can achieve it using oc patch
command and with type json. The snippet below will add a new item to array before 0th element. You can try it out with a fake "bla" value etc.
oc patch scc privileged --type=json -p '[{"op": "add", "path": "/users/0", "value":"system:serviceaccount:default:router"}]'
The --type=json
will interpret the provided patch as jsonpatch operation. Unfortunately oc patch --help
doesn't provide any example for json patch type. Luckily example usage can be found in kubernetes docs: kubectl patch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With