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

Contradicting kubectl apply documentation #896

Closed
SebStrug opened this issue Jul 13, 2020 · 2 comments
Closed

Contradicting kubectl apply documentation #896

SebStrug opened this issue Jul 13, 2020 · 2 comments
Assignees
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI.

Comments

@SebStrug
Copy link

Originally filed at: kubernetes/website#22465 (now closed)

Contradicting kubectl apply documentation

Problem:
The kubectl apply documentation here:
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply

Says that the -k flag should be used for a directory.

However the documentation here for the kubectl overview:
https://kubernetes.io/docs/concepts/configuration/overview/#using-kubectl

Suggests using the -f flag for a directory. Why is there a discrepancy?

Proposed Solution:
Clarification is needed that -f can take a file, a manifest URL, or a local directory containing manifests. If there are any particular reasons why -f is best practice, these should be stated.

Pages to Update:
One of the following pages should be updated or clarified:
https://kubernetes.io/docs/reference/generated/kubectl/kubectl-commands#apply
or
https://kubernetes.io/docs/concepts/configuration/overview/#using-kubectl

@SebStrug SebStrug added the kind/bug Categorizes issue or PR as related to a bug. label Jul 13, 2020
@seans3
Copy link
Contributor

seans3 commented Jul 13, 2020

@SebStrug Hello Seb. The -f <DIR> flag is for regular resource config (e.g. yaml) within the directory, and it can be combined with the -R recursive flag. The -k <DIR> flag is for directories of kustomize configuration that needs the extra step of kustomize build. You can tell if a directory has kustomize configuration if there is a kustomization.yaml file in the directory. The -k flag can not be used with -f or -R. All of this is flag information is available in kubectl apply -h. If we should update other sources, we should probably track that in another issue. I will close this issue shortly.

/assign
/kind support
/sig cli
/area kubectl

@k8s-ci-robot k8s-ci-robot added the sig/cli Categorizes an issue or PR as relevant to SIG CLI. label Jul 13, 2020
@k8s-ci-robot
Copy link
Contributor

@seans3: The label(s) kind/support cannot be applied, because the repository doesn't have them

In response to this:

@SebStrug Hello Seb. The -f <DIR> flag is for regular resource config (e.g. yaml) within the directory, and it can be combined with the -R recursive flag. The -k <DIR> flag is for directories of kustomize configuration that needs the extra step of kustomize build. You can tell if a directory has kustomize configuration if there is a kustomization.yaml file in the directory. The -k flag can not be used with -f or -R. All of this is flag information is available in kubectl apply -h. If we should update other sources, we should probably track that in another issue. I will close this issue shortly.

/assign
/kind support
/sig cli
/area kubectl

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubectl kind/bug Categorizes issue or PR as related to a bug. sig/cli Categorizes an issue or PR as relevant to SIG CLI.
Projects
None yet
Development

No branches or pull requests

3 participants