Closed jasonkuhrt closed 4 years ago
I don't understand. How is a default pod specification useful more than once, after which time the name is "in use"?
Can you explain more what utility you are trying to add or what problem you want to solve?
Can you explain more what utility you are trying to add
Projects will have pod
or replicationController
config file(s) and also maybe service
config file(s). kubectl
should be able to find these without the user having to be explicit all the time.
If users are creating various config file names in varying project folder locations, and if among the different approaches there are emerging cow paths, then Kubernetes core may want to pave them with smart defaults that streamline kubectl
interactions.
I'm not sure this is a big enough win to warrant any code. It seems a bit surprising to me, but I could be convinced
On Wed, Jan 7, 2015 at 11:10 AM, Jason Kuhrt notifications@github.com wrote:
If the community is coming up with various config file names and locations that point to clear cow paths then Kubernetes core might as well automate what it can.
Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/kubernetes/issues/3268#issuecomment-69073919 .
@thockin When I created this issue I was in part punting the details to those with more experience, who could relate the idea to use-cases they'd had or seen. I'll need more time with kubernetes myself to flush out the use-cases I'm seeing across many projects. If after some time this issue is still an echo chamber then probably I've just been thinking about/using Kubernetes wrong.
Fair enough - no harm in seeking supporting evidence for an idea :)
On Wed, Jan 7, 2015 at 1:34 PM, Jason Kuhrt notifications@github.com wrote:
@thockin https://github.com/thockin When I created this issue I was in part punting the details to those with more experience, who could relate the idea to use-cases they'd had or seen. I'll need more time with kubernetes myself to flush out the use-cases I'm seeing across many projects. If after some time this issue is still an echo chamber then probably I've just been thinking about/using Kubernetes wrong.
Reply to this email directly or view it on GitHub https://github.com/GoogleCloudPlatform/kubernetes/issues/3268#issuecomment-69096078 .
Like Makefiles and Dockerfiles? Those at least process other files in the same directory. I'm not sure this makes sense for kubectl. kubectl does already have the ability to slurp in all the config files in a directory (kubectl create -f dir), so this would be like making cwd the default, which I don't particularly see as a desirable feature, as would be error prone.
Like Makefiles and Dockerfiles? Those at least process other files in the same directory
Yes I think that's a decent starting point for this idea.
kubectl does already have the ability to slurp in all the config files in a directory (kubectl create -f dir)
I agree this alleviates the issue somewhat
so this would be like making cwd the default, which I don't particularly see as a desirable feature, as would be error prone.
Agreed cwd
would not work. A folder might though, such as .kubernetes
or .kube
or no dot-prefix variants...
There's a good chance that this feature is invalid.
@bgrant0607 Another use-case that I am envisioning is analogous to editor plugins. For instance there is a module called flycheck
for emacs
which is a emacs linting framework that allows additional modules to be written that lint for particular languages. Unfortunately, one awful default is that flycheck_*
files are created all over the file system as files are opened/edited/closed.
The point here is that emacs
or some emacs
packaging tool never provided a reliable folder-space system which modules can use to provide sane defaults.
The reason this is analogous to Kubernetes
is that I'm just wondering/imaging that plugins that extend kubectl
may also have need to interact with the file system in some way. If this is likely then its certainly worth Kubernetes
project investing a little into some filesystem defaults so that good defaults can be enjoyed by everyone.
This last comment is somewhat out of scope of the issue title. I admit I'm somewhat making up the issue as I go here. It just began as a sense.
@jasonkuhrt If you haven't seen it, take a look at https://github.com/GoogleCloudPlatform/kubernetes/tree/master/pkg/kubectl/cmd/config
@bgrant0607 Ah cool. Will take a closer look later but I guess a new command to work with settings painlessly?
Yes. See the section on "config" here: https://github.com/GoogleCloudPlatform/kubernetes/blob/master/docs/kubectl.md
Tools from the community are doing this:
https://github.com/helm/helm https://github.com/kubernauts/kploy https://github.com/flexiant/kdeploy https://github.com/kubespray/kpm
cc @ethernetdan
@bgrant0607 @thockin seems like we can close this issue?
@dims No, this is still a valid issue. Why do you think it should be closed?
@bgrant0607 was wondering aloud since the last few comments were old.
@dims Nobody has had time to do it. I have listed it as something we want to do, here: https://github.com/kubernetes/community/wiki/Roadmap:-kubectl
Thanks @bgrant0607 !
magic implicit file input doesn't seem great... what was the reason for reopening this?
@liggitt Current default behavior is to look for files with .yaml, .yml, and .json suffixes in a directory. Keeping this open regarding providing a way to override that behavior with a file of a well known name.
/lifecycle frozen
Hi @bgrant0607. This issue has been open a long time, so I'm just checking to see if this issue is still valid or if it is taken care of by kubectl apply -k
or helm, etc.
/kind feature
@brianpursley Yes, I think it's addressed by kustomize, or at least addressed as it's going to be. kubectl has a long-established, documented convention of specifying files and directories explicitly. /close
@bgrant0607: Closing this issue.
When
kubectl
is given a CRUD command for a resource (pod
,replicationController
,service
), if it is not explicitly given a path to a config file, it should try a systematic file system lookup pattern for a config file for that resource.Presumably these CRUD commands are being issued for a project and therefore I think the lookup pattern would not go beyond the
cwd
. However... it would be interesting if the command could be issues within any directory inside a project.git
for instance gets away with this because it assumes the project root has a.git
folder.Some sketchy ideas:
.kubernetes-pod.yaml
,.kubernetes-replicationController.yaml
, etc..kubernetes.yaml
.kubernetes
with per-resource config files therein likepod.yaml
,replicationController.yaml
, etc..kubernetes
with single config file likeconfig.yaml
A
.kubernetes
folder seems somewhat interesting:kubectl
to detect the "project root"Do not necessarily take this idea too literally, its just a sketch for a general feature-characteristic. Lots of ways this could be skinned/go. The goal is ultimately: