-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Deprecate --export flag from get command #73787
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: soltysh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/lgtm |
/hold |
I'm in favor of deprecation for the reasons stated, will leave open for comment |
cc @kubernetes/sig-api-machinery-misc |
I am in favor also. We need to totally rethink how to support this use case. |
This is a super useful/handy command to help folks move from imperative to declarative. The nodeport issue is not that problematic and the other issue mentioned dates back April 2016. I am not in favor, fwiw. |
This is a useful feature, is it possible to consider fixing the bugs? |
The bugs are secondary. The primary issue is that there are multiple conflicting goals and use cases for this feature that require opposite behavior. Some require dropping cluster-specific info, some require preserving it. I don't think the current approach to export is consistent or general enough to promote. |
Before deprecating could we have a documented alternative. End users are already facing the deprecation of Any object can certainly be cleaned up by hand without too much hassle but Since the issues mentioned as justification go back 2016, might as well solve it first once and for all before deprecating this. my 2cts. |
Like mentioned in the email |
I read the email, thank you. |
I think this had sufficient soak time. |
Not having to do this would be great! https://medium.com/@jonathan.johnson/export-has-been-deprecated-in-1-14-51cfef5a0cb7 |
Please provide an alternative in the deprecation message. Or, how about:
|
we use export command to manage compliance check between our CI and clusters how can we do without this command ? |
I needed something like this at work yesterday, so I threw together some filters with https://github.com/kislyuk/yq. In case they are useful to others:
This only covers the basics, but the timestamps/status/annotations and zero-valued fields were what caused most of the pain for us. |
Thanks I try it but i have this error message
Edit thanks mvdan i fix it with manual install of jq-1.6 ( with yum install the latest was 1.5) and yq v2.9.2 |
|
So now I'm supposed to copy secret in postintall hook with hypercube I need to either use weird tricks with sed, install jq or install whole kubernetes plugin when it was as simple as |
Came here after getting a deprecation warning. Motivation behind removal is questionable. "We can't fix bugs so we just remove the feature". Well. Also:
As a software developer, I consider approving own PRs a dangerous practice. |
Not in its current form. This was the visible outcome of more than a year of bug reports, discussion about the structure of the current implementation, and the deprecation of the corresponding server-side API parameters, e.g.:
The rationale was explained in #73787 (comment)
That is auto-recorded by the PR bots (authors inherently approve their own PRs). The author did not rely on that approval, but held and requested additional feedback, and got approval from two top-level approvers(1, 2). A proposal can be opened to address some of the use cases discussed in this thread, which takes into account the shortcomings of the previous implementation. |
Instead, I'm using kubectl -n istio-system get service igateway -o json | jq "$(cat filter.jq)" | yq r - |
@apelisse @jennybuckley we should consider a command to filter an object, leaving only a specific manager's fields, and then printing the result. It wouldn't work 100% of the time, but this would let people see more or less what the user intent was in many cases. |
Yeah, even though I just read the entire thread here (😅) and it's not clear to me what problem we're trying to solve.
I do believe that this would fix some of the problems though, it seems "easily" doable but it could indeed create configs that are not "apply-able". I'd love to understand the problem space better, I've read mostly:
Both of these seem to be XY problems rather than actual problems. I'd rather understand what these people are really trying to achieve. Copying objects from one namespace to another is not a recommended practice. |
@apelisse - happy to share my "Y" issue :) kubectl get secret tls-${_ENV}-secret --namespace=default --export -o yaml |
kubectl apply -n ${_PROJECT_NAME} -f - We have a single TLS secret generated for our staging environment (from a single wildcard certificate), stored in the default namespace and want to copy it to each project namespace when a project is deployed, so that the build script doesn't have to handle generating a new secret for every project. |
Update, for what it's worth: we ended up using cert-manager to generate all the certificates, which was pretty straight-forward once we got around to it (just adding an annotation to each ingress configuration for cert-manager to find and handle with Lets Encrypt). In our case, this eliminated the need for |
if you deprecate a feature, can you suggest an alternative in command deprecation messages ? |
@dfang do you have a specific use case you'd like a recommendation for? I agree that's a great idea generally, but I can also see how that would be difficult to do in this case, since the use cases for --export are varied, and therefore the alternatives are somewhat unique to each use case. Would have possibly been nice to link to this PR at least for a few suggestions. (Maybe as a general practice, it would work to create and/or link to a Github issue for each deprecation, as a place to find and discuss alternatives!) |
It has been removed; see kubernetes/kubernetes#73787
What type of PR is this?
/kind api-change
/sig cli
/sig architecture
/priority important-longterm
What this PR does / why we need it:
kubectl get --export
was broken almost from its inception, multiple bugs (eg. #28551) were reported wrt its functionality but not much was addressed.Additionally, server-side export (#24855) was brought for discussion and most of the time sig-apimachinery decided not to do it.
Given all of the above I think it's the time to start the process of deprecating this functionality.
Special notes for your reviewer:
/assign @deads2k @liggitt
/cc @kubernetes/api-approvers
Does this PR introduce a user-facing change?: