kops icon indicating copy to clipboard operation
kops copied to clipboard

document .kops file - does VIPER work

Open chrislovecnm opened this issue 7 years ago • 10 comments

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 avatar Apr 26 '17 02:04 chrislovecnm

@chrislovecnm Elaborate this issue?

dolftax avatar May 08 '17 08:05 dolftax

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.

chrislovecnm avatar May 08 '17 18:05 chrislovecnm

Here are the docs https://github.com/spf13/viper

Code is in cmd/kops/root.go

chrislovecnm avatar May 08 '17 18:05 chrislovecnm

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

fejta-bot avatar Dec 24 '17 03:12 fejta-bot

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

fejta-bot avatar Jan 23 '18 04:01 fejta-bot

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

fejta-bot avatar Feb 22 '18 04:02 fejta-bot

/lifecycle frozen /remove-lifecycle rotten

This is not fixed, and someone had a PR in that got closed.

chrislovecnm avatar Feb 22 '18 21:02 chrislovecnm

I will try to handle this issue

jsenon avatar Mar 19 '18 08:03 jsenon

Actually config file is located on $HOME/.kops.yaml, do you want to move it to $HOME/.kops/config ?

jsenon avatar Mar 19 '18 15:03 jsenon

@chrislovecnm - I think viper is setup up in kops to ONLY cover the case of the state store having a default value.

cmd/kops/root.go

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:

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

fred-vogt avatar Jun 27 '20 02:06 fred-vogt