-
Notifications
You must be signed in to change notification settings - Fork 923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Converting from usage of kubectl run --limits to --overrides not clear #1101
Comments
* Be more clear about the intent of the 403 test * Add an additional test they could perform as well. * Update the time it takes to run the network update (longer now with firewall policies in place) * Add a hint about the deprecation warning * I've opened a bug upstream about this Converting from usage of kubectl run --limits to --overrides not clear kubernetes/kubectl#1101
Cheers @ckittel, Apologies for the issues you've run into. I'm not sure about the messaging in those deprecated flags but I will find out. The implementation has indeed not been removed yet. The issue you're running into with your overrides appears to be that JSON Merge Patch (RFC 7396) (I just read it for the first time and could be wrong) doesn't work with objects inside arrays which is what we use here and here.
I don't see a way to apply your patch as expected without providing the entire object (including image) which is an issue because We could potentially use a 6902 patch which I believe we use in kustomize. cc @KnVerey This highlights one of reasons we've been wanting to remove as much of I've got this on the agenda for our meeting next week if you'd like to join us. /triage accepted |
Thanks for the added context. I'll see if I can join the meeting next week to talk about our use case. I fully recognize the desire to minimize utility of things like imparative commands like. We leverage this feature to give our learners "proof of implementation" style tests. E.g. To show that your Network Policies are in place, spin up a one-time shell in this namespace and then execute $command to see the results. Or to show that your Ingress Controller is only responding from external to the cluster, you can simulate an attempt to violate that by shelling in and executing $command. If I cannot attended in person, I'll watch for updates here. Thanks! |
Followup from the call yesterday. We will remove the functionality so the flag message matches the behavior for 1.23. The flags will be removed in 1.24 /assign @eddiezane We will try and add support for 6902 patches while maintaining backwards compatibility. Perhaps a new flag that specifies the patch type. /assign @brianpursley |
|
I have this problem when specifiying limits with Maybe the workaround is to use an old version of |
When using |
why did you remove the --limit to make it more complicated to use? |
shame can't use |
have you tried using kubectl run test --image=busybox --overrides='[{"op":"replace", "path":"/spec/containers/0/resources/limits", "value":{"nvidia.com/gpu": 2}}]' --override-type=json --dry-run=client -o yaml apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: test
name: test
spec:
containers:
- image: busybox
name: test
resources:
limits:
nvidia.com/gpu: "2"
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {} |
What happened:
kubectl run --limits
produces deprecation warning, but alternative doesn't seem to be working either.This was introduced in kubernetes/kubernetes#99732
What you expected to happen:
kubectl run --limits
claims to not work, but it actually does still. But using--overrides
doesn't seem to behave the way I'd expect it either.How to reproduce it (as minimally and precisely as possible):
First an execution using the deprecated
--limits
flag.kubectl run curl -n a0008 --image=mcr.microsoft.com/azure-cli --limits='cpu=200m' --dry-run=client -o yaml
Which is fine, that the command that says it has no effect actually does have an effect. But the workaround (as I understand it) doesn't work either, as it clobbers all of the other values as well (below you'll see
image
removed, for example)kubectl run curl -n a0008 --image=mcr.microsoft.com/azure-cli --dry-run=client -o yaml --overrides='{"spec":{"containers":[{"name":"curl","resources":{"limits":{"cpu":"200m"}}}]}}'
It's as if the
overrides
JSON patch isn't doing a merge on the merge key of containername
.Anything else we need to know?:
Either the patch merge process could be made clearer, or
limits
could maybe be no longer marked deprecated since it seems to do its job just exactly fine.Environment:
The text was updated successfully, but these errors were encountered: