Skip to content

feat: load keys from HashiCorp Vault #639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions charts/v3-operator/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v2
name: v3-operator
version: 3.4.0
appVersion: v3.0.3
version: 3.5.0
appVersion: v3.1.8
description: Operator hosted service for Stakewise V3 protocol.
type: application
icon: https://storage.googleapis.com/stakewise-charts/stakewise.png
Expand Down
3 changes: 3 additions & 0 deletions charts/v3-operator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ Kubernetes secrets are used to store sensitive information related to the v3-ope
kubectl create secret generic v3-operator-deposit-data --from-file=/home/username/.stakewise/0xeefffd4c23d2e8c845870e273861e7d60df49663/deposit_data.json
kubectl create secret generic v3-operator-keystores-data --from-file=/home/username/.stakewise/0xeefffd4c23d2e8c845870e273861e7d60df49663/keystores
kubectl create secret generic v3-operator-wallet-data --from-file=/home/username/.stakewise/0xeefffd4c23d2e8c845870e273861e7d60df49663/wallet

# optional if you are using HashiCorp Vault
kubectl create secret generic v3-operator-hcv-token --from-literal=token=<insert token here>
```

> Replace `0xeefffd4c23d2e8c845870e273861e7d60df49663` with the actual vault contract address
Expand Down
13 changes: 13 additions & 0 deletions charts/v3-operator/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,25 @@ spec:
- --remote-signer-url
- {{ .Values.settings.remoteDbConfig.remoteSignerUrl }}
{{- end }}
{{- if .Values.settings.hcVaultConfig.enabled }}
- --hashi-vault-url
- {{ .Values.settings.hcVaultConfig.hcVaultUrl }}
- --hashi-vault-token
- $(HASHICORP_VAULT_TOKEN)
- --hashi-vault-key-path
- {{ .Values.settings.hcVaultConfig.hcVaultKeyPath }}
{{- end }}
{{- range .Values.settings.extraFlags }}
- {{ . }}
{{- end }}
env:
- name: PYTHONPATH
value: "."
- name: HASHICORP_VAULT_TOKEN
valueFrom:
secretKeyRef:
name: {{ .Values.settings.hcVaultConfig.hcVaultTokenSecretName }}
key: token
envFrom:
- configMapRef:
name: {{ include "common.names.fullname" . }}
Expand Down
6 changes: 6 additions & 0 deletions charts/v3-operator/templates/validate.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,9 @@
{{- if not .Values.settings.vault }}
{{- fail ".Values.settings.vault is empty" }}
{{- end }}

{{- if .Values.settings.hcVaultConfig.enabled -}}
{{- if not .Values.settings.hcVaultConfig.hcVaultTokenSecretName }}
{{- fail ".Values.settings.hcVaultConfig.hcVaultTokenSecretName is empty" }}
{{- end }}
{{- end }}
9 changes: 8 additions & 1 deletion charts/v3-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ serviceAccount:
image:
registry: "europe-west4-docker.pkg.dev"
repository: "stakewiselabs/public/v3-operator"
tag: "v3.0.3"
tag: "v3.1.8"
pullPolicy: IfNotPresent
pullSecrets: []

Expand Down Expand Up @@ -105,6 +105,13 @@ settings:
dbUrl: "postgresql://postgres:postgres@localhost/operator"
remoteSignerUrl: "http://web3signer:6174"

# Whether to receive keystores from HashiCorp Vault
hcVaultConfig:
enabled: false
hcVaultUrl: "http://vault:8200"
hcVaultTokenSecretName: ""
hcVaultKeyPath: "stakewise"

# If specified, deposit data will be obtained from the secret
depositDataSecretName: ""
# If specified, keystores will be obtained from the secret
Expand Down