kops
kops copied to clipboard
document .kops file - does VIPER work
I have the following config file installed and run:
$cat $HOME/.kops
KOPS_STATE_STORE=s3://aws.k8spro.com
$ kops toolbox inventory -f in-v1alpha2.yaml
unable to load client set State Store: Required value: Please set the --state flag or export KOPS_STATE_STORE.
A valid value follows the format s3://<bucket>.
A s3 bucket is required to store cluster state information.
And that does not work. We have https://github.com/spf13/viper installed, but I do not know if it is actually wired in correctly ....
@chrislovecnm Elaborate this issue?
We have viper in order code base. It is part or the cobra cli stuff. It does not seem to be functioning. This issue is to figure out if it works, if so document how it works. If not fix it.
Here are the docs https://github.com/spf13/viper
Code is in cmd/kops/root.go
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.
Prevent issues from auto-closing with an /lifecycle frozen
comment.
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
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
/remove-lifecycle stale
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
.
Mark the issue as fresh with /remove-lifecycle rotten
.
Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /close
/lifecycle frozen /remove-lifecycle rotten
This is not fixed, and someone had a PR in that got closed.
I will try to handle this issue
Actually config file is located on $HOME/.kops.yaml, do you want to move it to $HOME/.kops/config ?
@chrislovecnm - I think viper is setup up in kops to ONLY cover the case of the state store
having a default value
.
rootCommand.RegistryPath = viper.GetString("KOPS_STATE_STORE")
The use case for this file might be somewhat limited:
- always required settings, or settings that apply to ALL clusters
Some items that might be candidates:
-
util/pkg/vfs/s3fs.go -
acl := os.Getenv("KOPS_STATE_S3_ACL")
- perhaps util/pkg/vfs/s3context.go
That said, I think this feature of kops does need to be documented better.
For myself I was wondering if it could be used to specify custom values for KOPS_BASE_URL
or custom base url mirrors