Hello
context
I deployed vault on a kubernetes (on premise) cluster, with three nodes. Manual unsealing goes well by following the instructions in this tutorial.
But I would like to manage this unsealing automatically, after deploying vault in my cluster.
I would also like to reassure myself that I have understood the process of setting up the secret transit engine.
My understanding: You need at least two vault deployer instances, one (Vault-0) which will host the transit engine and the other (vault-1) which will be uncelled via this transit engine.
Question:
- Does this assume vault-0 must be unsealed manually ?
- Is this unsealing procedure valid for all vault deployments on kubenertes (on premise)?
- In my case, I have three pods (vault-0, vault-1, vault-2).
On my vault-0 instance, I installed the transit engine, and generated the wrapping_token.
But on vault-1 and vault-2 , when I do
VAULT_TOKEN=“hvs.CAESIAdlH3P-PviQbHGyI” vault unwrap
i have this message
Error unwrapping: Error making API request.
URL: PUT https://127.0.0.1:8200/v1/sys/wrapping/unwrap
Code: 503. Errors:
- Vault is sealed
however I connect well to vault-1 and vault-2
with this
kubectl -n vault exec --stdin=true --tty=true vault-1 --sh
My Vault Helm Chart Value Overrides
global:
enabled: true
tlsDisable: false
injector:
enabled: false
image:
repository: “hashicorp/vault-k8s”
tag: “latest”
resources:
requests:
memory: 256Mi
cpu: 250m
limits:
memory: 256Mi
cpu: 250m
server: #
dataStorage:
enabled: true
auditStorage:
enabled: true
resources:
requests:
memory: 1Gi
cpu: 1000m
limits:
memory: 1Gi
cpu: 2000m
image:
repository: “hashicorp/vault”
tag: “latest”
pullPolicy: IfNotPresent
extraEnvironmentVars:
VAULT_CACERT: /vault/userconfig/tls-ca/tls.crt
extraVolumes:
- type: secret
name: tls-server
- type: secret
name: tls-ca
readinessProde:
enabled: true
path: “/v1/sys/health?standbyok=true&sealedcode=204&uninitcode=204”
livenessProbe:
enable: true
path: “/v1/sys/health?standbyok=true”
initialDelaySeconds: 60
ha:
enabled: true
replicas: 3 # replicas Number
raft:
enabled: true
setNodeId: trueconfig: | ui = true api_addr = "https://POD_IP:8200" listener "tcp" { tls_disable = 1 address = 0.0.0.0:8200" cluster_address = "0.0.0.0:8201" tls_cert_file = "/vault/userconfig/tls-server/tls.crt" tls_key_file = "/vault/userconfig/tls-server/tls.key" } storage "raft" { path = "/vault/data" retry_join { leader_api_addr = "https://vault-0.vault-internal:8200" leader_client_cert_file = "/vault/userconfig/tls-server/tls.crt" leader_client_key_file = "/vault/userconfig/tls-server/tls.key" } retry_join { leader_api_addr = "https://vault-1.vault-internal:8200" leader_client_cert_file = "/vault/userconfig/tls-server/tls.crt" leader_client_key_file = "/vault/userconfig/tls-server/tls.key" } retry_join { leader_api_addr = "https://vault-3.vault-internal:8200" leader_client_cert_file = "/vault/userconfig/tls-server/tls.crt" leader_client_key_file = "/vault/userconfig/tls-server/tls.key" } autopilot { cleanup_dead_servers = "true" last_contact_threshold = "200ms" last_contact_failure_threshold = "10m" max_trailing_logs = 250000 min_quorum = 5 server_stabilization_time = "10s" } } service_registration "kubernetes" {}
ui:
enabled: true
serviceType: “LoadBalancer”
serviceNodePort: null
externalPort: 8200