40 lines
1 KiB
Bash
Executable file
40 lines
1 KiB
Bash
Executable file
#!/bin/bash
|
|
|
|
CHART_VERSION=0.1.7
|
|
NAMESPACE=miniflux
|
|
VAULT_AUTH_NAMESPACE="k8s-teapot"
|
|
|
|
kubectl create ns ${NAMESPACE}
|
|
kubectl create serviceaccount -n ${NAMESPACE} miniflux
|
|
kubectl apply -n ${NAMESPACE} -f external-secrets.yaml
|
|
|
|
HOST_IP=$(ip addr show eth0 | grep -Po 'inet \K[\d.]+')
|
|
TOKEN="$(kubectl get secret serviceaccounttoken -n miniflux -o go-template='{{ .data.token }}' | base64 -d)"
|
|
|
|
cat << EOH > miniflux.hcl
|
|
path "kv/data/miniflux" {
|
|
capabilities = ["read"]
|
|
}
|
|
EOH
|
|
vault policy write miniflux miniflux.hcl
|
|
rm miniflux.hcl
|
|
|
|
vault write auth/${VAULT_AUTH_NAMESPACE}/role/miniflux \
|
|
bound_service_account_names=miniflux \
|
|
bound_service_account_namespaces=miniflux \
|
|
policies=miniflux \
|
|
ttl=24h
|
|
|
|
vault write auth/${VAULT_AUTH_NAMESPACE}/login role=miniflux jwt=${TOKEN} iss=https://${HOST_IP}:6443
|
|
|
|
helm repo add gabe565 https://charts.gabe565.com
|
|
helm repo update
|
|
|
|
helm upgrade --install \
|
|
miniflux \
|
|
gabe565/miniflux \
|
|
-f values.yaml \
|
|
-n ${NAMESPACE} \
|
|
--version ${CHART_VERSION} \
|
|
--cleanup-on-fail
|