Skip to content
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

Document kubectl config file format #38478

Closed
mleonhard opened this issue Jan 29, 2020 · 31 comments
Closed

Document kubectl config file format #38478

mleonhard opened this issue Jan 29, 2020 · 31 comments
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/docs Categorizes an issue or PR as relevant to SIG Docs. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@mleonhard
Copy link

What would you like to be added:

Documentation of kubectl YAML config files

Why is this needed:

So I can understand, write, and maintain kubectl config files.

Expressing frustration:

I'm learning Kubernetes. I went through the tutorials - thanks. Now I'm trying to set up services to run on minikube and my hosting provider. The kubectl command apparently takes a YAML config file. I searched for 15 mins and found no documentation for it at all. I found a helpful blog post complaining about the missing documentation. There are examples: guestbook-all-in-one.yaml, a deployment, a service, a replica set, and a replication controller. The "Getting Start / Production Environment" documentation contains no guidance on using config files to define application deployments.

Should I deploy my code with bash scripts that call kubectl create deployment ... ? Is that how Google engineers work? No, they write borgcfg files. And they learned how to write borgcfg by reading the borgcfg docs. There's even a codelab (tutorial) on writing such files. Imagine trying to onboard new Googler SWEs without letting them read the borgcfg documentation or teaching them how to write borgcfg files. Nobody would do that. Yet Google wants us to use Kubernetes, to deploy on Google Cloud, and doesn't provide this basic doc.

The kubectl config file is crucial information that everyone learning Kubernetes must learn. Please don't make us hunt for this information, guess at the meanings of examples, and read unreliable Stack Overflow answers and blog posts. Just provide usable documentation. Please?

@mleonhard mleonhard added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 29, 2020
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jan 29, 2020
@mleonhard
Copy link
Author

/sig docs

@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 29, 2020
@mleonhard
Copy link
Author

Terraform's kubernetes provider has some usable documentation. Presumably its config keys and values have the same meanings as those used by kubectl, although the file format is different.

@neolit123
Copy link
Member

neolit123 commented Jan 29, 2020

https://vsupalov.com/yaml-kubernetes-examples-docs-spec/

this blog post mentions kubectl explain, which is the dynamic way of obtaining documentation.

https://kubernetes.io/docs/reference/kubectl/overview/#resource-types
also you can use kubectl api-resources and then based on the APIGroup column you can find the structures and fields you are interested in, in the go docs at:
https://godoc.org/k8s.io/api

i think the documentation you are asking for is examples based, and it's missing because some of the APIs are changing and keeping examples in sync-with all of them is going to be problematic. i doubt there are enough people to help with this effort.

what can be potentially added to kubectl one day is the generation of examples, but this is up to the group that maintains is.

if you want to discuss this in chat try joining the k8s slack channel #sig-cli
/sig cli

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Jan 29, 2020
@mleonhard
Copy link
Author

mleonhard commented Feb 12, 2020

i think the documentation you are asking for is examples based, and it's missing because some of the APIs are changing and keeping examples in sync-with all of them is going to be problematic. i doubt there are enough people to help with this effort.

Examples-based documentation is fine if there are comprehensive examples with comments explaining what each option means and the available values. Kubernetes does not have that kind of documentation.

The APIs I need to use are not changing. I'm not doing anything complicated.

Kubernetes is an example of API Practices If You Hate Your Customers - Technique kubernetes/kubernetes#4: Hide the API docs from Search Engines and Technique kubernetes/kubernetes#7: Maintain documentation manually. Google, VMWare, and other members of the Kubernetes group: Get this done and you will earn more money. You win when more companies move to cloud tech.

There are engineers with plenty of Kubernetes experience. Thirty pull requests were submitted yesterday alone. I think you can mobilize them to build out usable documentation. You just need to try.

For now, I give up on Kubernetes. I deleted my Kubernetes cluster and will implement our deployments with Terraform + Docker.

@sftim
Copy link
Contributor

sftim commented Feb 16, 2020

also
/sig cli

@hypdeb
Copy link

hypdeb commented Apr 26, 2020

Is there really NO reference to what this config file should contain ? If yes, I support this request for documentation. I would like to help but I'm here exactly because I know nothing about kubectl :)

@sftim
Copy link
Contributor

sftim commented Apr 27, 2020

https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/ exists
It would be great if https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/ could hyperlink to a reference document explaining .kubeconfig as a reference.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 26, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Aug 25, 2020
@cpxPratik
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Aug 26, 2020
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 24, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 24, 2020
@cpxPratik
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Dec 24, 2020
@kunal-kushwaha
Copy link
Contributor

I'd like to take this one 😄
/assign

@k8s-ci-robot k8s-ci-robot added the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 8, 2021
@cpxPratik
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Jul 16, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 14, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Nov 13, 2021
@cpxPratik
Copy link

/remove-lifecycle rotten

@k8s-ci-robot k8s-ci-robot removed the lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. label Nov 15, 2021
@sftim
Copy link
Contributor

sftim commented Nov 20, 2021

(on behalf of SIG Docs)
/lifecycle frozen

@k8s-ci-robot k8s-ci-robot added the lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. label Nov 20, 2021
@sftim
Copy link
Contributor

sftim commented Dec 15, 2022

/transfer website

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Dec 15, 2022
@k8s-ci-robot k8s-ci-robot transferred this issue from kubernetes/kubernetes Dec 15, 2022
@sftim
Copy link
Contributor

sftim commented Dec 15, 2022

/priority important-longterm
/triage accepted

@k8s-ci-robot k8s-ci-robot added priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 15, 2022
@sftim
Copy link
Contributor

sftim commented Dec 15, 2022

@tengqm
Copy link
Contributor

tengqm commented Dec 15, 2022

There is nothing like a config API for this purpose. The website has some useful information here: https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

The page could use some improvement because kubeconfig file is not just for accessing multiple clusters.

@sftim
Copy link
Contributor

sftim commented Dec 15, 2022

I'd like to add a reference that is similar to the pages within https://kubernetes.io/docs/reference/config-api/
I can make a quick mockup (if that'd help?)

We don't need to generate the new page automatically. It is useful if the references are consistent, though.

@sftim
Copy link
Contributor

sftim commented Dec 29, 2022

@k8s-ci-robot
Copy link
Contributor

@sftim: Closing this issue.

In response to this:

Done: https://kubernetes.io/docs/reference/config-api/kubeconfig.v1/

/close

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.

@mleonhard
Copy link
Author

mleonhard commented Dec 29, 2022 via email

@sftim
Copy link
Contributor

sftim commented Dec 29, 2022

@mleonhard this issue is resolved.

If you would like to request further improvements, you are welcome to file further issues. It's best to use a new issue for each logically separate improvement.
If you are considering making a suggestion, please check to see whether it has already been requested; if so, you could upvote the existing issue.

I recommend that you read tips for writing a good issue; even if you have already read a similar guide, it's worth having a fresh idea of how open source projects encourage contributors to act.

@mleonhard
Copy link
Author

@sftim You linked to docs that are different than what this ticket asked for. The sidebar is not visible at all on mobile, making it hard to find the needed docs. On desktop, I was able to find them: https://kubernetes.io/docs/reference/kubernetes-api/ . Thank you!

There is still a lot of room for improvement. This ticket is about docs for new users, specifically how to set up services to run in a k8s cluster. The docs now have that info, but put it under "Kubernetes API". I've been doing software for 15 years, including stints at AWS and Google infrastructure. To me, "Kubernetes API" is the RPC interface for controlling a Kubernetes cluster. I would read that when I work on Kubernetes management tools.

But I just want to make my server run on a Kubernetes cluster, using existing tools. I just need to know what to put in the @#%$@ config file. That's what this ticket is about.

So all new Kubernetes users must first learn that the info about "what to put in the config file" is under "Kubernetes API". Finding that info will take time. This is time that most new users will waste. Please fix this. And next time you write or change documentation or user interfaces, please try harder to consider the needs of the users.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. sig/cli Categorizes an issue or PR as relevant to SIG CLI. sig/docs Categorizes an issue or PR as relevant to SIG Docs. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

No branches or pull requests

10 participants