longhorn savegame
This commit is contained in:
59
08_Vault/justfile
Normal file
59
08_Vault/justfile
Normal file
@@ -0,0 +1,59 @@
|
||||
set fallback := true
|
||||
|
||||
export K8S_VAULT_NAMESPACE := env("K8S_VAULT_NAMESPACE", "vault")
|
||||
export VAULT_CHART_VERSION := env("VAULT_CHART_VERSION", "0.31.0")
|
||||
export VAULT_HOST := env("VAULT_HOST", "")
|
||||
export VAULT_ADDR := "https://" + VAULT_HOST
|
||||
export VAULT_DEBUG := env("VAULT_DEBUG", "false")
|
||||
SECRET_PATH := "secret"
|
||||
|
||||
|
||||
[private]
|
||||
default:
|
||||
@just --list --unsorted --list-submodules
|
||||
|
||||
# Add Helm repository
|
||||
add-helm-repo:
|
||||
helm repo add hashicorp https://helm.releases.hashicorp.com
|
||||
helm repo update
|
||||
|
||||
# Remove Helm repository
|
||||
remove-helm-repo:
|
||||
helm repo remove hashicorp
|
||||
|
||||
|
||||
# Create Vault namespace
|
||||
create-namespace:
|
||||
@kubectl get namespace ${K8S_VAULT_NAMESPACE} > /dev/null || kubectl create namespace ${K8S_VAULT_NAMESPACE}
|
||||
|
||||
# Delete Vault namespace
|
||||
delete-namespace:
|
||||
@kubectl delete namespace ${K8S_VAULT_NAMESPACE} --ignore-not-found
|
||||
|
||||
install:
|
||||
#!/bin/bash
|
||||
set -eu
|
||||
just create-namespace
|
||||
just add-helm-repo
|
||||
|
||||
gomplate -f vault-values.gomplate.yaml -o vault-values.yaml
|
||||
|
||||
helm upgrade \
|
||||
--cleanup-on-fail \
|
||||
--install \
|
||||
vault \
|
||||
hashicorp/vault \
|
||||
--namespace ${K8S_VAULT_NAMESPACE} \
|
||||
--wait \
|
||||
-f vault-values.yaml
|
||||
|
||||
kubectl wait pod --for=condition=PodReadyToStartContainers \
|
||||
-n ${K8S_VAULT_NAMESPACE} vault-0 --timeout=5m
|
||||
|
||||
|
||||
# Uninstall Vault
|
||||
uninstall delete-ns='false':
|
||||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
helm uninstall vault -n ${K8S_VAULT_NAMESPACE} --ignore-not-found --wait
|
||||
just delete-namespace
|
||||
16
08_Vault/vault-values.gomplate.yaml
Normal file
16
08_Vault/vault-values.gomplate.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
server:
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: traefik
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
ingressClassName: traefik
|
||||
hosts:
|
||||
- host: {{ .Env.VAULT_HOST }}
|
||||
paths:
|
||||
- /
|
||||
tls:
|
||||
- hosts:
|
||||
- {{ .Env.VAULT_HOST }}
|
||||
dataStorage:
|
||||
storageClass: longhorn
|
||||
16
08_Vault/vault-values.yaml
Normal file
16
08_Vault/vault-values.yaml
Normal file
@@ -0,0 +1,16 @@
|
||||
server:
|
||||
ingress:
|
||||
enabled: true
|
||||
annotations:
|
||||
kubernetes.io/ingress.class: traefik
|
||||
traefik.ingress.kubernetes.io/router.entrypoints: websecure
|
||||
ingressClassName: traefik
|
||||
hosts:
|
||||
- host: vault.test.k8s.schnrbs.work
|
||||
paths:
|
||||
- /
|
||||
tls:
|
||||
- hosts:
|
||||
- vault.test.k8s.schnrbs.work
|
||||
dataStorage:
|
||||
storageClass: longhorn
|
||||
Reference in New Issue
Block a user