Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.19.0'
go-version: '^1.20.0'
- name: Run make check
run: |
export PATH=${PATH}:`go env GOPATH`/bin
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@v2
with:
go-version: '^1.19.0'
go-version: '^1.20.0'
- name: Build the binary-files
id: build_binary_files
run: |
Expand Down
49 changes: 48 additions & 1 deletion docs/stores/vault/use_vault_store.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,51 @@ kubeconfigStores:
- my-next-vault-path
config:
vaultAPIAddress: http://127.0.0.1:8200
```
```

### Configure Vault KV Secrets engine v2 in SwitchConfig file

If Vault is setup with a KV secrets engine v2, below is an example configuration for using Vault in the `SwitchConfig` file.

```
kind: SwitchConfig
version: v1alpha1
kubeconfigStores:
- kind: vault
showPrefix: false
paths:
- "shared/kubernetes"
config:
vaultAPIAddress: "https://address.to.vault"
vaultKeyKubeconfig: "kubeconfig"
vaultEngineVersion: "v2"
```

`vaultKeyKubeconfig` specifies which key in the secret the kubeconfig is saved under. Defaults to `config`.

`vaultEngineVersion` specifies which Vault secrets engine to use. Defaults to `v1`.

Combining `vault` with `cache` means that the fetched kubeconfig's from Vault are cached locally, and thus limiting the number of requests to Vault significant:

```
kind: SwitchConfig
version: v1alpha1
refreshIndexAfter: 12h
kubeconfigStores:
- kind: vault
showPrefix: false
paths:
- "shared/kubernetes"
config:
vaultAPIAddress: "https://address.to.vault"
vaultKeyKubeconfig: "kubeconfig"
vaultEngineVersion: "v2"
cache:
kind: filesystem
config:
path: ~/.kube/cache/switch
```

By using `refreshIndexAfter` you can force a refresh of the index. In this case every 12th hour.

Note: Make sure that the folder mentioned under `cache.path` is present, otherwise it will not work.
39 changes: 19 additions & 20 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ require (
github.com/aws/smithy-go v1.8.1
github.com/disiqueira/gotree v1.0.0
github.com/gardener/gardener v1.45.1
github.com/hashicorp/go-multierror v1.1.0
github.com/hashicorp/vault/api v1.0.4
github.com/hashicorp/go-multierror v1.1.1
github.com/hashicorp/vault/api v1.9.2
github.com/jedib0t/go-pretty/v6 v6.1.0
github.com/karrick/godirwalk v1.16.1
github.com/ktr0731/go-fuzzyfinder v0.6.0
Expand All @@ -39,7 +39,7 @@ require (
github.com/onsi/ginkgo/v2 v2.1.3
github.com/rancher/norman v0.0.0-20220621173721-cba80063e705
github.com/rancher/rancher/pkg/client v0.0.0-20220712195127-2c2137347e42
golang.org/x/tools v0.1.10
golang.org/x/tools v0.1.12
k8s.io/klog/v2 v2.30.0
)

Expand All @@ -65,6 +65,7 @@ require (
github.com/aws/aws-sdk-go-v2/service/sts v1.8.0 // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/bmatcuk/doublestar/v4 v4.0.2 // indirect
github.com/cenkalti/backoff/v3 v3.0.0 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/cyphar/filepath-securejoin v0.2.2 // indirect
github.com/davecgh/go-spew v1.1.1 // indirect
Expand All @@ -77,28 +78,29 @@ require (
github.com/gdamore/encoding v1.0.0 // indirect
github.com/gdamore/tcell/v2 v2.4.0 // indirect
github.com/ghodss/yaml v1.0.0 // indirect
github.com/go-jose/go-jose/v3 v3.0.0 // indirect
github.com/go-logr/logr v1.2.0 // indirect
github.com/go-logr/zapr v1.2.0 // indirect
github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0 // indirect
github.com/gobwas/glob v0.2.3 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/golang/snappy v0.0.4 // indirect
github.com/google/go-cmp v0.5.7 // indirect
github.com/google/gofuzz v1.2.0 // indirect
github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/gax-go/v2 v2.2.0 // indirect
github.com/googleapis/gnostic v0.5.5 // indirect
github.com/gorilla/websocket v1.4.2 // indirect
github.com/hashicorp/errwrap v1.0.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.1 // indirect
github.com/hashicorp/go-retryablehttp v0.5.4 // indirect
github.com/hashicorp/go-rootcerts v1.0.1 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/go-retryablehttp v0.6.6 // indirect
github.com/hashicorp/go-rootcerts v1.0.2 // indirect
github.com/hashicorp/go-secure-stdlib/parseutil v0.1.6 // indirect
github.com/hashicorp/go-secure-stdlib/strutil v0.1.2 // indirect
github.com/hashicorp/go-sockaddr v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/vault/sdk v0.1.13 // indirect
github.com/huandu/xstrings v1.3.2 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand All @@ -110,14 +112,13 @@ require (
github.com/matttproud/golang_protobuf_extensions v1.0.2-0.20181231171920-c182affec369 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/mitchellh/mapstructure v1.4.3 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/spdystream v0.2.0 // indirect
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
github.com/modern-go/reflect2 v1.0.2 // indirect
github.com/nsf/termbox-go v0.0.0-20201124104050-ed494de23a00 // indirect
github.com/nxadm/tail v1.4.8 // indirect
github.com/pierrec/lz4 v2.6.1+incompatible // indirect
github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4 // indirect
github.com/prometheus/client_golang v1.12.1 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
Expand All @@ -132,23 +133,21 @@ require (
go.uber.org/atomic v1.7.0 // indirect
go.uber.org/multierr v1.6.0 // indirect
go.uber.org/zap v1.19.1 // indirect
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 // indirect
golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect
golang.org/x/crypto v0.6.0 // indirect
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4 // indirect
golang.org/x/net v0.7.0 // indirect
golang.org/x/oauth2 v0.0.0-20220411215720-9780585627b5 // indirect
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c // indirect
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect
golang.org/x/text v0.3.7 // indirect
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4 // indirect
golang.org/x/sys v0.5.0 // indirect
golang.org/x/term v0.5.0 // indirect
golang.org/x/text v0.7.0 // indirect
golang.org/x/time v0.0.0-20210723032227-1f47c861a9ac // indirect
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 // indirect
gomodules.xyz/jsonpatch/v2 v2.2.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20220324131243-acbaeb5b85eb // indirect
google.golang.org/grpc v1.45.0 // indirect
google.golang.org/protobuf v1.28.0 // indirect
gopkg.in/inf.v0 v0.9.1 // indirect
gopkg.in/square/go-jose.v2 v2.3.1 // indirect
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect
istio.io/api v0.0.0-20220304035241-8c47cbbea144 // indirect
istio.io/client-go v1.12.5 // indirect
Expand Down
Loading