I am trying to use kustomize from within kubectl. Specifically, I want to know the equivalent kubectl command for:
kustomize build --load_restrictor LoadRestrictionsNone config/overlays/dev_mutation | kubectl apply -f -
(kustomize properly runs this command and does what I expect)
I've tried this command:
$ kubectl apply -k config/overlays/dev_mutation --load_restrictor="LoadRestrictionsNone"
which complains that load_restrictor
is deprecated and I should use load-restrictor
instead.
W0712 07:58:16.811301 2407909 flags.go:39] load_restrictor is DEPRECATED and will be removed in a future version. Use load-restrictor instead.
Error: unknown flag: --load_restrictor
So, I tried replacing with the non-deprecated flag:
kubectl apply -k config/overlays/dev_mutation --load-restrictor="LoadRestrictionsNone"
If I do this, kubectl complains that --load-restrictor
is unknown:
Error: unknown flag: --load-restrictor
How do I properly pass the load_restrictor
/load-restrictor
flag to kubectl apply -k
?
Output of kubectl version
:
gatekeeper$ kubectl version
Client Version: version.Info{Major:"1", Minor:"21", GitVersion:"v1.21.2", GitCommit:"092fbfbf53427de67cac1e9fa54aaa09a28371d7", GitTreeState:"clean", BuildDate:"2021-06-16T12:59:11Z", GoVersion:"go1.16.5", Compiler:"gc", Platform:"linux/amd64"}