refactor: 구조 변경
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
# Vault shared service
|
||||
|
||||
여러 system이 소비하는 dev Vault service의 Kubernetes base입니다. Namespace,
|
||||
single-node profile과 NetworkPolicy는
|
||||
`gitops/clusters/dev-k3s/overlays/platform/vault`에서 결합합니다.
|
||||
|
||||
Vault API object는 이 경로가 아니라 `infrastructure/live/dev-k3s`의 세
|
||||
Terraform state가 소유합니다.
|
||||
@@ -0,0 +1,13 @@
|
||||
ui = true
|
||||
disable_mlock = true
|
||||
|
||||
listener "tcp" {
|
||||
address = "0.0.0.0:8200"
|
||||
cluster_address = "0.0.0.0:8201"
|
||||
tls_disable = 1
|
||||
}
|
||||
|
||||
storage "raft" {
|
||||
path = "/vault/data"
|
||||
node_id = "vault-0"
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||
kind: Kustomization
|
||||
|
||||
resources:
|
||||
- vault-serviceaccount.yaml
|
||||
- vault-auth-delegator.clusterrolebinding.yaml
|
||||
- vault-pvc.yaml
|
||||
- vault-service.yaml
|
||||
- vault-deployment.yaml
|
||||
|
||||
configMapGenerator:
|
||||
- name: vault-config
|
||||
files:
|
||||
- files/vault/vault.hcl
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: vault-server-auth-delegator
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: system:auth-delegator
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: vault-server
|
||||
namespace: vault
|
||||
@@ -0,0 +1,91 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: vault
|
||||
spec:
|
||||
replicas: 1
|
||||
strategy:
|
||||
type: Recreate
|
||||
selector:
|
||||
matchLabels:
|
||||
app: vault
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: vault
|
||||
spec:
|
||||
serviceAccountName: vault-server
|
||||
containers:
|
||||
- name: vault
|
||||
image: hashicorp/vault:1.18.5@sha256:750bb37c1638fa194ab37053a81618c61bb0491ddec6fccac87c07a8e6cd8166
|
||||
command:
|
||||
- /bin/sh
|
||||
- -ec
|
||||
env:
|
||||
- name: VAULT_ADDR
|
||||
value: http://127.0.0.1:8200
|
||||
- name: POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: VAULT_API_ADDR
|
||||
value: http://$(POD_IP):8200
|
||||
- name: VAULT_CLUSTER_ADDR
|
||||
value: http://$(POD_IP):8201
|
||||
args:
|
||||
- |
|
||||
cp /vault/config/vault.hcl /tmp/vault.hcl
|
||||
exec vault server -config=/tmp/vault.hcl
|
||||
ports:
|
||||
- containerPort: 8200
|
||||
name: http
|
||||
- containerPort: 8201
|
||||
name: cluster
|
||||
volumeMounts:
|
||||
- name: vault-config
|
||||
mountPath: /vault/config
|
||||
readOnly: true
|
||||
- name: vault-data
|
||||
mountPath: /vault/data
|
||||
readinessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- vault status -address=http://127.0.0.1:8200 >/dev/null 2>&1
|
||||
initialDelaySeconds: 10
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
livenessProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- vault status -address=http://127.0.0.1:8200 >/dev/null 2>&1; code=$?; [ "$code" -eq 0 ] || [ "$code" -eq 2 ]
|
||||
initialDelaySeconds: 20
|
||||
periodSeconds: 15
|
||||
timeoutSeconds: 5
|
||||
startupProbe:
|
||||
exec:
|
||||
command:
|
||||
- sh
|
||||
- -c
|
||||
- vault status -address=http://127.0.0.1:8200 >/dev/null 2>&1; code=$?; [ "$code" -eq 0 ] || [ "$code" -eq 2 ]
|
||||
periodSeconds: 5
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 30
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 500m
|
||||
memory: 512Mi
|
||||
volumes:
|
||||
- name: vault-config
|
||||
configMap:
|
||||
name: vault-config
|
||||
defaultMode: 0555
|
||||
- name: vault-data
|
||||
persistentVolumeClaim:
|
||||
claimName: vault-data
|
||||
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: vault-data
|
||||
annotations:
|
||||
argocd.argoproj.io/sync-options: Prune=confirm,Delete=confirm
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 5Gi
|
||||
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: vault
|
||||
spec:
|
||||
selector:
|
||||
app: vault
|
||||
ports:
|
||||
- name: http
|
||||
port: 8200
|
||||
targetPort: 8200
|
||||
- name: cluster
|
||||
port: 8201
|
||||
targetPort: 8201
|
||||
type: ClusterIP
|
||||
@@ -0,0 +1,4 @@
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: vault-server
|
||||
Reference in New Issue
Block a user