Skip to content

Commit

Permalink
Add k8s secrets
Browse files Browse the repository at this point in the history
[issue](#135)

---
Co-authored-by: ykuc <140019825+ykuc@users.noreply.github.com>
Co-authored-by: Iurii Kuchits <kuchits@nebius.com>

Pull Request resolved: #150
commit_hash:884f4c5804084642bbb1218d9b328e06aebdb9e1
  • Loading branch information
ykuc authored and robot-piglet committed Dec 22, 2024
1 parent 7ac9b17 commit 41dc7a4
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
22 changes: 20 additions & 2 deletions docs/deploy_k8s.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,11 @@ Be caution: in template you must replace **<Your-Prometheus-source-ID>** before
For secrets management we recommend to use env-vars in paar with secret operator, for example [Hashicorp Vault](https://developer.hashicorp.com/vault/docs/platform/k8s/injector/examples)
Use ENV-vars substitute for src and dst params, you may specify:
#### specify secrets in transferSpec
Use ENV-vars substitute for src and dst params, you may specify
##### Hashicorp Vault
[Hashicorp Vault](https://developer.hashicorp.com/vault/docs/platform/k8s/injector/examples)
```yaml
transferSpec:
dst:
Expand All @@ -124,9 +127,25 @@ transferSpec:

env:
FOO: "/vault/secret"
```
##### K8s secret
[k8s secret](https://kubernetes.io/docs/concepts/configuration/secret/)
```yaml
secret_env:
- env_name: FOO
secret_name: k8s_secret_name
secret_key: k8s_secret_key
```
##### ENV-vars
Don't recommend to use this way, but you may specify env-vars directly in values.yaml
```yaml
env:
FOO: "secret"
```
#### After load
After load this transfer yaml would be:
```yaml
Expand All @@ -135,4 +154,3 @@ dst:
params:
Password: "secret"
```
9 changes: 9 additions & 0 deletions helm/transfer/templates/_transfer_spec.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ containers:
- name: {{ $name }}
value: {{ $value }}
{{- end }}
{{- end }}
{{- if .Values.secret_env }}
{{- range .Values.secret_env }}
- name: {{ .env_name }}
valueFrom:
secretKeyRef:
name: {{ .secret_name }}
key: {{ .secret_key }}
{{- end }}
{{- end }}
ports:
- name: pprof
Expand Down

0 comments on commit 41dc7a4

Please sign in to comment.