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

Make cache-dir configurable wih env variable #1184

Closed
strigazi opened this issue Mar 9, 2022 · 5 comments · Fixed by kubernetes/kubernetes#109479
Closed

Make cache-dir configurable wih env variable #1184

strigazi opened this issue Mar 9, 2022 · 5 comments · Fixed by kubernetes/kubernetes#109479
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.

Comments

@strigazi
Copy link

strigazi commented Mar 9, 2022

What would you like to be added:
Make kubectl use an optional environment variable to configure the cache-dir.

https://kubernetes.io/docs/reference/kubectl/kubectl/
--cache-dir string     Default: "$HOME/.kube/cache"
Default cache directory

Why is this needed:
At the moment, users have to pass the --cache-dir option on every kubectl execution, with an environment variable (similar to KUBECONFIG), they will have to set it once.

@strigazi strigazi added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 9, 2022
@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Mar 9, 2022
@ardaguclu
Copy link
Member

cache-dir is used by discovery and kubectl commands using discovery are api-resource, create and a few others(autoscale, version).There is no need to pass cache-dir in every execution, if you need to customize cache-dir. You can just pass cache-dir for the commands using discovery.

I understand the inconvenience in here(From the user perspective, how user knows which command uses discovery and which one not). But there is an ongoing work on discovery caching. Even though it is small, there is a probability that cache-dir will be removed. At that point, I think we might not want to add new environment variable.

@traylenator
Copy link

traylenator commented Mar 16, 2022

I'd take a step back as to what we were trying to achieve.

The default cache is $HOME/.kube/cache

We want to be able to make the default cache $XDG_RUNTIME_DIR/kubecache
since it is a much quicker filesystem.

It's probably a better default generally though possibly a bit linuxy "sic" for sure.

@eddiezane
Copy link
Member

/assign @ardaguclu
/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Mar 30, 2022
@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 Jun 28, 2022
@ardaguclu
Copy link
Member

/remove-lifecycle stale

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. priority/backlog Higher priority than priority/awaiting-more-evidence. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
6 participants