Skip to content

Commit 7017b63

Browse files
Merge pull request #50 from finleap-connect/FCLOUD-5058
make external kubeconfig configurable to connect to a different cluster
2 parents 9e75a51 + a98bffd commit 7017b63

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ testbin/*
2626
cover.out
2727
.vscode
2828
.coverprofile
29+
.dccache

charts/vault-operator/templates/deployment.yaml

+20-2
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,11 @@ spec:
4040
name: vault-operator-env
4141
- secretRef:
4242
name: {{ required "A valid .Values.vault.credentials.secretName is required!" .Values.vault.credentials.secretName }}
43+
{{- if .Values.kubeconfig.secretName }}
44+
env:
45+
- name: KUBECONFIG
46+
value: /opt/kube/kubeconfig
47+
{{- end }}
4348
ports:
4449
- containerPort: 443
4550
name: webhook-server
@@ -56,6 +61,11 @@ spec:
5661
mountPath: /etc/ssl/certs/
5762
readOnly: true
5863
{{- end }}
64+
{{- if .Values.kubeconfig.secretName }}
65+
- name: kubeconfig
66+
mountPath: /opt/kube
67+
readonly: true
68+
{{- end }}
5969
resources:
6070
{{- toYaml .Values.resources | nindent 12 }}
6171
{{- with .Values.nodeSelector }}
@@ -81,5 +91,13 @@ spec:
8191
secret:
8292
secretName: {{ required "A valid .Values.vault.tls.secretName is required!" .Values.vault.tls.secretName }}
8393
{{- end }}
84-
85-
94+
{{- if .Values.kubeconfig.secretName }}
95+
- name: kubeconfig │
96+
│ secret:
97+
│ defaultMode: 420 │
98+
│ items:
99+
│ - key: kubeconfig │
100+
│ mode: 256 │
101+
│ path: kubeconfig │
102+
│ secretName: {{ .Values.kubeconfig.secretName }}
103+
{{- end }}

charts/vault-operator/values.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ vault:
4545
secretName: "" # Required secret containing AppRole credentials as fields VAULT_ROLE_ID and VAULT_SECRET_ID, see https://www.vaultproject.io/docs/auth/approle
4646
namespace: "" # Optional Vault namespace to connect to
4747

48+
kubeconfig:
49+
secretName: ""
50+
4851
# Set which secret engines are allowed to access namespaced
4952
allowedSecretEngines:
5053
- app

0 commit comments

Comments
 (0)