Ssoon
HashiCorp Vault - High Availability (HA) 본문
🧩 Vault HA란 무엇인가
- Vault는 “비밀(secret)”을 안전하게 저장하고 관리하는 시스템입니다.
- HA(High Availability)란, 단일 서버 장애가 발생해도 Vault 서비스가 지속 가능하도록 여러 Vault 서버를 클러스터 형태로 운영하는 구성입니다.
- HA 모드에서는 Vault가 여러 노드를 사용해 redundancy(중복성)를 확보하고, 하나의 노드 장애 시 다른 노드가 대신 서비스하도록 보장합니다.
🏗️ Vault HA 동작 방식
▶️ Active / Standby 구조
- Vault HA 클러스터에서는 Vault 서버 노드가 두 가지 상태를 가질 수 있습니다: active 또는 standby.
- 클러스터 내에서 단 하나의 노드만 active로 동작하며, 이 active 노드가 모든 읽기/쓰기 요청(read/write)을 처리합니다.
- 나머지 standby 노드들은 hot standby로 유지되며, active 노드에 장애가 생기면 standby 노드 중 하나가 새로운 active로 승격되어 서비스를 지속합니다.
- 즉, standby 노드들은 active가 된 뒤에만 요청을 처리할 수 있고, sealed 상태이거나 초기화되지 않은 노드는 standby 역할을 수행할 수 없습니다.
▶️ 요청 처리 방식: Redirection or Forwarding
Vault HA는 클라이언트 요청이 standby 노드에 들어왔을 때, 두 가지 방식 중 하나로 처리합니다.
- Client Redirection
- Standby 노드가 클라이언트에게 HTTP 307 status code와 함께 active 노드의 주소를 반환해, 클라이언트를 active 노드로 직접 리다이렉트합니다.
- Request Forwarding
- Standby 노드가 내부 TLS 연결을 통해 active 노드로 요청을 전달하고, active 노드가 처리한 응답을 standby 노드를 통해 클라이언트로 되돌려 보냅니다. 이 방식은 standby ↔ active 간 직접 TLS 연결이 필요합니다.
🗄️ Storage Backend — HA를 위한 핵심 요소
Vault가 HA로 동작하려면, storage backend(데이터 저장소)가 “HA를 지원하는 backend”여야 합니다. 즉, 저장소가 복제(replication) 또는 lock coordination 등의 메커니즘을 제공해야 합니다.
Vault 공식 지원 저장소 중 다음이 대표적입니다:
• Integrated Storage (Raft 기반)
- Vault 내장 저장소로 별도의 외부 시스템 없이 동작합니다.
- Raft consensus algorithm을 사용해, 클러스터의 모든 Vault 노드에 데이터가 복제됩니다. 각 노드는 동일한 데이터 복사본(full replica)을 가집니다.
- HA가 기본 활성화되며, 설정 간소화, 외부 의존성 제거 등의 장점이 있어 HashiCorp는 신규 배포 시 Integrated Storage 사용을 권장합니다.
- 구성 예 (config.hcl):
storage "raft" {
path = "/opt/vault/data"
node_id = "node-a"
}
cluster_addr = "http://127.0.0.1:8201"
— 모든 노드는 고유한 node_id를 가져야 합니다.
• Consul (외부 storage backend)
- Vault 데이터와 HA lock 관리를 위해 Consul의 key-value store와 세션 기능을 사용하는 방식입니다.
- Consul backend 또한 Vault HA를 지원하며, 여러 노드로 구성된 Consul 클러스터가 필요합니다.
- 그러나 외부 시스템(Consul)을 별도로 배포하고 운영해야 하므로 운영 복잡도가 증가합니다. 때문에 신규 환경에서는 Integrated Storage가 더 권장되는 추세입니다.
• 기타 backend
- 문서에 따르면, Consul, ZooKeeper, etcd 등의 backend들도 HA 구성을 지원 가능한 backend로 분류되지만, 공식적으로 추천되는 기본 backend는 Integrated Storage 또는 Consul입니다.
🛠️ Vault HA 구성 및 배포 — 실무 가이드
▶️ 언제 Single Node가 아닌 HA를 사용해야 할까?
- 단일 노드는 redundancy가 없고, 노드 장애 시 Vault 전체 서비스가 중단되므로, 프로덕션 환경에서는 권장되지 않습니다.
- 따라서 최소 2개 이상의 노드를 사용하는 Multi-Node Cluster 구성이 권장됩니다.
▶️ Vault 설정 예: Integrated Storage 기반 HA
예: 3노드 Vault cluster 설정
storage "raft" {
path = "/opt/vault/data"
node_id = "vault-node-1"
}
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "0.0.0.0:8201"
tls_disable = false
tls_cert_file = "/etc/vault.d/tls.cert"
tls_key_file = "/etc/vault.d/tls.key"
}
cluster_addr = "https://vault-node-1.example.com:8201"
- 각 노드는 고유한 node_id를 가져야 하며, cluster_addr를 통해 클러스터 내 통신을 설정해야 합니다.
- Integrated Storage를 사용하는 경우, 별도의 ha_storage를 지정하면 안 됩니다.
- 운영 환경에서는 TLS 설정과 메모리 잠금(mlock) 해제, swap 비활성화 등을 권장합니다.
▶️ Vault 설정 예: Consul backend 기반 HA
storage "consul" {
address = "127.0.0.1:8500"
path = "vault/"
}
listener "tcp" {
address = "0.0.0.0:8200"
cluster_address = "0.0.0.0:8201"
tls_disable = false
tls_cert_file = "/etc/vault.d/tls.cert"
tls_key_file = "/etc/vault.d/tls.key"
}
- Vault는 local Consul agent와 통신하고, Consul 클러스터는 별도로 운영되어야 합니다.
- Consul backend도 Vault HA를 지원하나, 외부 시스템 의존과 복잡도 때문에, 가능하면 Integrated Storage 사용이 권장됩니다.
⚠️ Vault HA의 제약 및 주의사항
- HA는 “가용성(redundancy)”을 위한 것이지, “수평적 확장(horizontal scalability)”을 위한 것은 아닙니다. 즉, standby 노드는 일반적으로 실제 트래픽을 처리하지 않으며, active 노드가 요청을 처리합니다.
- 만약 많은 읽기 요청(read-only)이 있고, 그 부하를 분산하고 싶다면, Vault Enterprise의 “Performance Standby Nodes” 기능을 고려해야 합니다. OSS 버전에서는 standby 노드가 read-only 처리하는 것이 기본이 아닙니다.
- Vault HA 동작을 위한 storage backend가 꼭 HA를 지원해야 하며, HA를 지원하지 않는 backend를 사용하면 HA 모드가 작동하지 않습니다.
- 모든 Vault 노드는 unseal 상태여야 standby로 기능할 수 있습니다. 만약 sealed 상태라면 장애 시 클러스터가 복구되지 않습니다.
✅실습
- kind k8s : worker 3node + ingress-nginx
- 1. Kind 클러스터 생성 (myk8s)
- Kubernetes v1.32.8 기반의 Kind 클러스터를 만듦
- Control-plane 노드에 ingress-ready: true 라벨 추가
- 80/443 및 NodePort 범위 외 포트 매핑
- Worker 3개 포함 총 4노드 구성
→ IngressController를 로컬에서 바로 테스트할 수 있는 환경 완성
- Ingress-NGINX 설치 : GitHub 공식 manifest를 사용하여 다음 리소스 자동 배포됨:
- Namespace: ingress-nginx
- Deployment: ingress-nginx-controller
- Service: ingress-nginx-controller (NodePort 형태)
- Admission 관련 Job 생성
- RBAC, ConfigMap, Webhook 등 모든 구성 자동 적용
- Ingress Controller를 Control-Plane 노드에 고정 배치 (nodeSelector)
- Ingress Controller가 반드시 Control-plane 노드에 스케줄링되도록 설정
- Kind의 공식 문서에서 권장하는 설정이며 로컬 환경에서 필요한 작업
- SSL Passthrough 활성화 : Ingress-NGINX Deployment 매니페스트 중
- TLS termination을 NGINX에서 처리하지 않고 TLS 트래픽을 그대로 backend Pod로 넘기는 기능
- 예: Vault, Keycloak, MinIO, 기타 자체 TLS를 가진 서비스에서 필
(⎈|N/A:N/A) ssoon@DESKTOP-72C919S:~$ kind create cluster --name myk8s --image kindest/node:v1.32.8 --config - <<EOF
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
labels:
ingress-ready: true
extraPortMappings:
- containerPort: 80
hostPort: 80
protocol: TCP
- containerPort: 443
hostPort: 443
protocol: TCP
- containerPort: 30000
hostPort: 30000
- containerPort: 30001
hostPort: 30001
- role: worker
- role: worker
- role: worker
EOF
Creating cluster "myk8s" ...
✓ Ensuring node image (kindest/node:v1.32.8) 🖼
✓ Preparing nodes 📦 📦 📦 📦
✓ Writing configuration 📜
✓ Starting control-plane 🕹️
✓ Installing CNI 🔌
✓ Installing StorageClass 💾
✓ Joining worker nodes 🚜
Set kubectl context to "kind-myk8s"
You can now use your cluster with:
kubectl cluster-info --context kind-myk8s
Have a question, bug, or feature request? Let us know! https://kind.sigs.k8s.io/#community 🙂
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/deploy/static/provider/kind/deploy.yaml
namespace/ingress-nginx created
serviceaccount/ingress-nginx created
serviceaccount/ingress-nginx-admission created
role.rbac.authorization.k8s.io/ingress-nginx created
role.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrole.rbac.authorization.k8s.io/ingress-nginx created
clusterrole.rbac.authorization.k8s.io/ingress-nginx-admission created
rolebinding.rbac.authorization.k8s.io/ingress-nginx created
rolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx created
clusterrolebinding.rbac.authorization.k8s.io/ingress-nginx-admission created
configmap/ingress-nginx-controller created
service/ingress-nginx-controller created
service/ingress-nginx-controller-admission created
deployment.apps/ingress-nginx-controller created
job.batch/ingress-nginx-admission-create created
job.batch/ingress-nginx-admission-patch created
ingressclass.networking.k8s.io/nginx created
validatingwebhookconfiguration.admissionregistration.k8s.io/ingress-nginx-admission created
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl patch deployment ingress-nginx-controller -n ingress-nginx \
--type='merge' \
-p='{
"spec": {
"template": {
"spec": {
"nodeSelector": {
"ingress-ready": "true"
}
}
}
}
}'
deployment.apps/ingress-nginx-controller patched
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl get deployment ingress-nginx-controller -n ingress-nginx -o yaml \
| sed '/- --publish-status-address=localhost/a\
- --enable-ssl-passthrough' | kubectl apply -f -
deployment.apps/ingress-nginx-controller configured
- Namespace 생성 완료
- Vault Server 3개 Replica
- StatefulSet 형태로 3개 Pod(vault-0, vault-1, vault-2) 생성
- 높은 가용성을 갖춘 Raft 클러스터 구성 가능
- Raft Storage(HA)
- 외부 스토리지 없이 Raft 내부 저장소를 사용
- TLS 비활성화
- Ingress나 외부 LB에서 TLS 처리 가능
- Kubernetes 서비스 등록
- Vault가 Kubernetes API에 자신의 cluster-address 정보를 자동으로 업데이트
- UI 서비스 NodePort로 오픈
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl create ns vault
namespace/vault created
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ cat << EOF > values-ha.yaml
server:
replicas: 3
# Vault HA mode
ha:
enabled: true
replicas: 3
raft:
enabled: true
config: |
ui = true
listener "tcp" {
tls_disable = 1 # TLS 바활성화
address = "[::]:8200" # 모든 IPv6 주소에서 8200 포트 수신
cluster_address = "[::]:8201" # 클러스터 통신 포트
}
service_registration "kubernetes" {} # Kubernetes 서비스 등록 활성화
readinessProbe:
enabled: true
# PVC for Raft storage
dataStorage:
enabled: true
size: 10Gi
service:
enabled: true
type: ClusterIP
port: 8200
targetPort: 8200
ui:
enabled: true
serviceType: "NodePort"
externalPort: 8200
serviceNodePort: 30000
injector:
enabled: false
EOF
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ helm install vault hashicorp/vault -n vault -f values-ha.yaml --version 0.31.0
NAME: vault
LAST DEPLOYED: Mon Dec 8 22:33:49 2025
NAMESPACE: vault
STATUS: deployed
REVISION: 1
NOTES:
Thank you for installing HashiCorp Vault!
Now that you have deployed Vault, you should look over the docs on using
Vault with Kubernetes available here:
https://developer.hashicorp.com/vault/docs
Your release is named vault. To learn more about the release, try:
$ helm status vault
$ helm get manifest vault
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl get pods --selector='app.kubernetes.io/name=vault' -n vault
NAME READY STATUS RESTARTS AGE
vault-0 0/1 Running 0 33s
vault-1 0/1 Running 0 33s
vault-2 0/1 Running 0 33s
- 초기화 성공 (vault operator init)
초기화 결과:- Unseal Keys 5개 생성
- Threshold: 3 → 즉, 5개의 키 중 3개 이상 입력해야 Vault가 해제(Unseal) 됨
- Initial Root Token 생성됨
- 이 root token은 Vault에 로그인할 때 사용하는 관리자 토큰입니다.
/ $ vault operator init
Unseal Key 1: aVYcLi0CBPMzaoTroPTYve/mhDRhw9wd3NRxpLYJn9KE
Unseal Key 2: 3+138zn8obeFoAdvbHhOvqmfIySFga7v7TsbCszN0cLM
Unseal Key 3: lBPTUBKTTXKJTnC4LEZuKVakUw5AdcpYayfrgBVSuiR+
Unseal Key 4: 8imchdQYKMicTlFWEWFJTW1NmjQixieddz6v+H3xNLHF
Unseal Key 5: IYywQry0gJUf6KQLoxQqWk/+R7tTpOwyBLXXCcAzBRB8
Initial Root Token: hvs.PQ8ieshCDpKGPJvNYrlfGkum
Vault initialized with 5 key shares and a key threshold of 3. Please securely
distribute the key shares printed above. When the Vault is re-sealed,
restarted, or stopped, you must supply at least 3 of these keys to unseal it
before it can start servicing requests.
Vault does not store the generated root key. Without at least 3 keys to
reconstruct the root key, Vault will remain permanently sealed!
It is possible to generate new unseal keys, provided you have a quorum of
existing unseal keys shares. See "vault operator rekey" for more information.
/ $ vault status
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 5
Threshold 3
Unseal Progress 0/3
Unseal Nonce n/a
Version 1.20.4
Build Date 2025-09-23T13:22:38Z
Storage Type raft
Removed From Cluster false
HA Enabled true
- vault-0 Unseal 성공
출력된 상태를 보면 vault-0이 정상적으로 Unseal 완료되었고, 현재 클러스터의 Active 노드 역할을 맡고 있습니다.- vault-0이 완전히 Unseal 완료
- 현재 클러스터의 Active Leader
- Raft index도 정상 반영됨
- vault-0 → 정상적으로 Unseal 완료 (현재 Active)
- 이제 vault-1, vault-2도 각각 Unseal 작업을 수행해야 함
/ $ vault operator unseal
Unseal Key (will be hidden):
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 5
Threshold 3
Unseal Progress 1/3
Unseal Nonce f283fd21-9e78-4b5e-012e-e4e424184f77
Version 1.20.4
Build Date 2025-09-23T13:22:38Z
Storage Type raft
Removed From Cluster false
HA Enabled true
/ $ vault operator unseal
Unseal Key (will be hidden):
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed true
Total Shares 5
Threshold 3
Unseal Progress 2/3
Unseal Nonce f283fd21-9e78-4b5e-012e-e4e424184f77
Version 1.20.4
Build Date 2025-09-23T13:22:38Z
Storage Type raft
Removed From Cluster false
HA Enabled true
/ $ vault operator unseal
Unseal Key (will be hidden):
Key Value
--- -----
Seal Type shamir
Initialized true
Sealed false
Total Shares 5
Threshold 3
Version 1.20.4
Build Date 2025-09-23T13:22:38Z
Storage Type raft
Cluster Name vault-cluster-48687838
Cluster ID c08a938e-453e-6056-29d6-6fc762a094b6
Removed From Cluster false
HA Enabled true
HA Cluster https://vault-0.vault-internal:8201
HA Mode active
Active Since 2025-12-08T13:41:58.720987463Z
Raft Committed Index 37
Raft Applied Index 37
- vault-1, vault-2가 수동으로 leader(vault-0)에 정상적으로 Raft Cluster Join에 성공
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl exec -n vault -it vault-1 -- vault operator raft join http://vault-0.vault-internal:8200
Key Value
--- -----
Joined true
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl exec -n vault -it vault-2 -- vault operator raft join http://vault-0.vault-internal:8200
Key Value
--- -----
Joined true
- Vault 클러스터가 정상적으로 leader 선출은 되었지만, 아직 vault-0만 Raft 클러스터의 peer로 등록되어 있는 상태
- vault-1, vault-2가 raft cluster에 조인(join)되지 않은 상태
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl exec -it vault-0 -n vault -- sh
/ $ vault login
Token (will be hidden):
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.PQ8ieshCDpKGPJvNYrlfGkum
token_accessor 55MLRgkSBSeotgCkWVJ6BK28
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
/ $ vault operator raft list-peers
Node Address State Voter
---- ------- ----- -----
88ae56ee-bccf-4040-0f25-dc120c76ca6d vault-0.vault-internal:8201 leader true
/ $ exit
- vault-1과 vault-2에서 각각 vault operator unseal 을 3번씩 입력해 Unseal을 완료
kubectl get pods --selector='app.kubernetes.io/name=vault' -n vault
kubectl exec -it vault-1 -n vault -- sh
---------------------------------------
vault status
vault operator unseal
vault operator unseal
vault operator unseal
vault status
exit
---------------------------------------
#
kubectl exec -it vault-2 -n vault -- sh
---------------------------------------
vault status
vault operator unseal
vault operator unseal
vault operator unseal
vault status
exit
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl get pods --selector='app.kubernetes.io/name=vault' -n vault
NAME READY STATUS RESTARTS AGE
vault-0 1/1 Running 0 27m
vault-1 1/1 Running 0 27m
vault-2 1/1 Running 0 27m
- raft list-peers 실행
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ kubectl exec -it -n vault vault-0 -- sh
/ $ vault login hvs.imTbwNZVQ9O5bkK6HZBdknKI
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.imTbwNZVQ9O5bkK6HZBdknKI
token_accessor AosA1h2ZQDZPMlQbdc71pjwR
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
/ $ vault operator raft list-peers
Node Address State Voter
---- ------- ----- -----
684ed27a-7d3c-1ab9-0e9a-2f03186530af vault-0.vault-internal:8201 leader true
dd9c2995-ab63-b338-714a-395d269c58b0 vault-1.vault-internal:8201 follower true
70911fb3-6180-e603-3a8e-1d3573dbc854 vault-2.vault-internal:8201 follower true
- Vault 서버는 이미 unseal 상태이고, 로컬에서 root token 로그인도 되어 있으며, KV v2 엔진 활성화 → 데이터 저장 → 조회 → 리스트
| Vault 서버 상태 | 정상 | 모든 노드 unseal 완료 |
| Vault CLI 인증 | root token 정상 로그인 | root 정책 적용 |
| KV v2 엔진 | mysecret/ 로 정상 생성됨 | kv-v2로 동작 |
| Secret 생성 | OK | study 키에 username/password 저장됨 |
| Secret 조회 | OK | 정확히 동일한 값 반환됨 |
| Secret list | OK | logins/study 경로 정상 인식 |
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault login
Token (will be hidden):
Success! You are now authenticated. The token information displayed below
is already stored in the token helper. You do NOT need to run "vault login"
again. Future Vault requests will automatically use this token.
Key Value
--- -----
token hvs.imTbwNZVQ9O5bkK6HZBdknKI
token_accessor AosA1h2ZQDZPMlQbdc71pjwR
token_duration ∞
token_renewable false
token_policies ["root"]
identity_policies []
policies ["root"]
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault secrets enable -path=mysecret kv-v2
Success! Enabled the kv-v2 secrets engine at: mysecret/
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault kv put mysecret/logins/study \
username="demo" \
password="p@ssw0rd"
======= Secret Path =======
mysecret/data/logins/study
======= Metadata =======
Key Value
--- -----
created_time 2025-12-08T14:35:36.101604193Z
custom_metadata <nil>
deletion_time n/a
destroyed false
version 1
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault kv get mysecret/logins/study
======= Secret Path =======
mysecret/data/logins/study
======= Metadata =======
Key Value
--- -----
created_time 2025-12-08T14:35:36.101604193Z
custom_metadata <nil>
deletion_time n/a
destroyed false
version 1
====== Data ======
Key Value
--- -----
password p@ssw0rd
username demo
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault kv list mysecret
Keys
----
logins/
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault kv list mysecret/logins
Keys
----
study
- Policy 생성
- mysecret/logins/study 경로 및 그 하위 모든 Key
예:- mysecret/logins/study
- mysecret/logins/study/anything
- 위 경로에 대한 모든 권한을 명시적으로 차단(deny)
- mysecret/logins/study 경로 및 그 하위 모든 Key
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ vault policy write restrict_study - <<EOF
path "mysecret/logins/study*" {
capabilities = ["deny"]
}
EOF
Success! Uploaded policy: restrict_study
- Vault의 권한 시스템은 다음과 같은 우선순위를 가집니다:
- root 토큰은 모든 정책을 무시하고 전체 권한(full access)
- deny 정책이 allow 정책보다 우선
- allow 정책
- default(권한 없음)
- 즉, root 토큰은 어떤 경로라도 접근 가능합니다.
따라서 restrict_study 정책이 있어도 결과에 영향을 받지 않습니다.
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ export VAULT_ROOT_TOKEN=hvs.imTbwNZVQ9O5bkK6HZBdknKI
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ curl -s --header "X-Vault-Token: $VAULT_ROOT_TOKEN" http://localhost:30000/v1/mysecret/data/logins/study | jq
{
"request_id": "3e2f7830-f0d4-a263-fef9-dfd544a5f01e",
"lease_id": "",
"renewable": false,
"lease_duration": 0,
"data": {
"data": {
"password": "p@ssw0rd",
"username": "demo"
},
"metadata": {
"created_time": "2025-12-08T14:35:36.101604193Z",
"custom_metadata": null,
"deletion_time": "",
"destroyed": false,
"version": 1
}
},
"wrap_info": null,
"warnings": null,
"auth": null,
"mount_type": "kv"
}
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ curl -s --header "X-Vault-Token: $VAULT_ROOT_TOKEN" http://localhost:30000/v1/mysecret/data/logins/study \
| jq -r .data.data.username
demo
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ curl -s --header "X-Vault-Token: $VAULT_ROOT_TOKEN" http://localhost:30000/v1/mysecret/data/logins/study \
| jq -r .data.data.password
p@ssw0rd
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ export USER_NAME=$(curl -s --header "X-Vault-Token: $VAULT_ROOT_TOKEN" http://localhost:30000/v1/mysecret/data/logins/study | jq -r .data.data.username)
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ export PASSWORD=$(curl -s --header "X-Vault-Token: $VAULT_ROOT_TOKEN" http://localhost:30000/v1/mysecret/data/logins/study | jq -r .data.data.password)
(⎈|kind-myk8s:N/A) ssoon@DESKTOP-72C919S:~$ echo $USER_NAME $PASSWORD
demo p@ssw0rd'CICD Study [1기]' 카테고리의 다른 글
| HashiCorp Vault - Server TLS (0) | 2025.12.07 |
|---|---|
| HashiCorp Vault - Auth with LDAP (0) | 2025.12.07 |
| HashiCorp Vault - Vault Secrets Operator (0) | 2025.12.07 |
| HashiCorp Vault - 암호화(Encryption)와 Vault Transit 엔진 (0) | 2025.11.27 |
| HashiCorp Vault - Jenkins + Vault (AppRole) - CI (0) | 2025.11.27 |
Comments