-
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
kubectl create -f <directory> doesn't create services first, violating config best practice #16448
Comments
Yes, known issue. Thanks for filing. |
Also relevant: #1768 |
In a galaxy far far away, kubecfg created services first. @smarterclayton How would you feel about doing that in kubectl? |
Not opposed, possibly if we detect you give us lots of things we could put On Fri, Feb 12, 2016 at 5:02 PM, Brian Grant notifications@github.com
|
cc @kubernetes/kubectl |
If start establishing order amongst creates, I'd like to see it as an interface in the I also think that if we go down this route, we should bound ourselves. For instance, if you create a serviceaccount and then create a pod that uses that SA, the pod will be rejected unless the SA token controller has created a token. People find this frustrating (even though bare pods aren't a good idea). Would we also allow preconditions? I'm against it, but I'd like to be sure that we're willing to allow flaky failures in cases like that. Similar problems exist with quota. |
I'd rather fix services and pods by being explicit via downward api. On Wed, Apr 6, 2016 at 8:46 AM, David Eads notifications@github.com wrote:
|
any news about this? |
These service linking proposals seem to be the upcoming solution for this: |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
I'd also like this feature. It seems that kubecfg has a hardcoded ordering of types of objects This seems rather simple to fetch the types and give them a priority, toss them into a priority queue, then finally empty the queue into a list. This will bring kubectl one step closer to kubecfg. |
The way I implemented my CD is using the kubectl apply. I then in order to
guarantee the order I prefix the files with numbers. e.g:
0_namespace.yaml
1_secret.yaml
2_service.yaml
3_deployment.yaml
4_ingress.yaml
Works like a charm.
…On Mon, Jan 14, 2019, 10:02 PM borg286 ***@***.*** wrote:
I'd also like this feature. It seems that kubecfg has a hardcoded ordering
of types of objects
It does ThirdPartyResource and CustomResourceDefinition
then global resources,
then namespace,
then things that don't contain pods
then lastly things that contain pods.
This seems rather simple to fetch the types and give them a priority, toss
them into a priority queue, then finally empty the queue into a list. This
will bring kubectl one step closer to kubecfg.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#16448 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACQA91WhX2Ezi5b2i9pdoRTUQ5keFOPTks5vDRqVgaJpZM4GXkIK>
.
|
@renannprado However, if the directory was of sufficiently large size to get into double digits (or greater), issues would emerge again unless files have been properly zero prefixed. |
@vtereso if you're afraid of that then just do like this:
If you're afraid of having hundreds, same logic applies. |
That doesn't look like a proper solution ;) |
This might not be a solution to this exact issue, but kubectl's new Even if you're not interested in kustomize's other features, as long as you can upgrade your kubectl, you should be able to work around this limitation in a relatively clean way (at least compared to 0-prefixing). |
As some of the more recent comments allude to, the issue of resource creation ordering is a lot more complicated than just Services->Deployments. Even if we were to implement a dependency graph between all built-in kinds, which would be non-trivial, we would still encounter several stumbling blocks:
We discussed this at a SIG-CLI meeting today, and for all these reasons, we don't think this is a change we should pursue in kubectl. The current behavior is effectively to have users fully control the dependency chain by providing the resources in the desired order. This is the right behavior for a tool at this level of abstraction. If more complex behavior is desired, there are many more opinionated, higher-level deploy orchestration tools available in the ecosystem. /close |
@KnVerey: Closing this issue. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
Sorry to reanimate this issue, but as a noobie it would be helpful to know what "higher-level deploy orchestration tools available in the ecosystem" there are. Can anyone name some examples or link to an overview? Actually I'm quite surprised that I would stumble on this kind of issue because I just assumed I could just natively with kubernetes apply all at once in a correct order. I personally now got to this issue because I wanted to "install" knative and then deploy a knative Service all in one
which from my guess is what was described:
So is this not possible with kubernetes? |
Config best practices says:
It also says:
It looks like
kubectl
just creates things in sorted order:cc @gmarek @mikedanese
The text was updated successfully, but these errors were encountered: