Skip to content

Commit

Permalink
Merge pull request #50 from finleap-connect/FCLOUD-5058
Browse files Browse the repository at this point in the history
make external kubeconfig configurable to connect to a different cluster
  • Loading branch information
christianhuening authored Jul 8, 2022
2 parents 9e75a51 + a98bffd commit 7017b63
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ testbin/*
cover.out
.vscode
.coverprofile
.dccache
22 changes: 20 additions & 2 deletions charts/vault-operator/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ spec:
name: vault-operator-env
- secretRef:
name: {{ required "A valid .Values.vault.credentials.secretName is required!" .Values.vault.credentials.secretName }}
{{- if .Values.kubeconfig.secretName }}
env:
- name: KUBECONFIG
value: /opt/kube/kubeconfig
{{- end }}
ports:
- containerPort: 443
name: webhook-server
Expand All @@ -56,6 +61,11 @@ spec:
mountPath: /etc/ssl/certs/
readOnly: true
{{- end }}
{{- if .Values.kubeconfig.secretName }}
- name: kubeconfig
mountPath: /opt/kube
readonly: true
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nodeSelector }}
Expand All @@ -81,5 +91,13 @@ spec:
secret:
secretName: {{ required "A valid .Values.vault.tls.secretName is required!" .Values.vault.tls.secretName }}
{{- end }}


{{- if .Values.kubeconfig.secretName }}
- name: kubeconfig │
│ secret:
│ defaultMode: 420 │
│ items:
│ - key: kubeconfig │
│ mode: 256 │
│ path: kubeconfig │
│ secretName: {{ .Values.kubeconfig.secretName }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/vault-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ vault:
secretName: "" # Required secret containing AppRole credentials as fields VAULT_ROLE_ID and VAULT_SECRET_ID, see https://www.vaultproject.io/docs/auth/approle
namespace: "" # Optional Vault namespace to connect to

kubeconfig:
secretName: ""

# Set which secret engines are allowed to access namespaced
allowedSecretEngines:
- app
Expand Down

0 comments on commit 7017b63

Please sign in to comment.