I created a TLS [with HA enabled] as below [TLS is created via cert-manager]:
global:
enabled: true
tlsDisable: false
injector:
enabled: true
image:
repository: "hashicorp/vault-k8s"
tag: "1.1.0"
pullPolicy: IfNotPresent
agentImage:
repository: "hashicorp/vault"
tag: "1.12.1"
pullPolicy: IfNotPresent
server:
extraEnvironmentVars:
VAULT_CACERT: /vault/userconfig/vault-server-tls/ca.crt
VAULT_TLSCERT: /vault/userconfig/vault-server-tls/tls.crt
VAULT_TLSKEY: /vault/userconfig/vault-server-tls/tls.key
volumes:
- name: vault-tls
secret:
defaultMode: 420
secretName: vault-cert
volumeMounts:
- mountPath: /vault/userconfig/vault-server-tls/
name: vault-tls
readOnly: true
affinity: ""
ha:
enabled: true
raft:
enabled: true
setNodeId: true
config: |
listener "tcp" {
address = "[::]:8200"
cluster_address = "[::]:8201"
tls_cert_file = "/vault/userconfig/vault-server-tls/tls.crt"
tls_key_file = "/vault/userconfig/vault-server-tls/tls.key"
tls_client_ca_file = "/vault/userconfig/vault-server-tls/ca.crt"
}
{{- $replicas := 3 | int -}}
{{ range $k, $v := until $replicas }}
retry_join {
leader_api_addr = "https://vault-{{ $k }}.vault-testing.svc:8200"
leader_ca_cert = "/vault/userconfig/vault-server-tls/ca.crt"
leader_client_cert = "/vault/userconfig/vault-server-tls/tls.crt"
leader_client_key = "/vault/userconfig/vault-server-tls/tls.key"
}
{{ end }}
storage "raft" {
path = "/vault/data"
}
disable_mlock = true
service_registration "kubernetes" {}
dataStorage:
storageClass: "local"
agentImage:
repository: "hashicorp/vault"
tag: "1.12.1"
pullPolicy: IfNotPresent
ui:
enabled: true
I am able to initialize vault in vault-0 pod.
Also, when I’m going into vault-1 to join it
vault operator raft join -address=https://vault-0.vault-internal:8200
I got no errors:
Key Value
--- -----
Joined true
but when I’m going to vault-0 [leader] to see the members I’ll see only one:
Host Name API Address Cluster Address Active Node Version Upgrade Version Redundancy Zone Last Echo
--------- ----------- --------------- ----------- ------- --------------- --------------- ---------
vault-0 https://10.42.0.217:8200 https://vault-0.vault-internal:8201 true 1.12.1 1.12.1 n/a n/a
What I’m doing wrong?