searxng/manifests/bin/deploy.sh

44 lines
989 B
Bash
Raw Normal View History

2024-05-01 08:36:34 +00:00
#!/bin/bash -e
set -o pipefail
function kapply() {
for f in "$@"; do
kubectl apply -f \
<(envsubst "$(env | xargs printf '$%s ')" < "manifests/$f")
done
}
function kcreatesec() {
kubectl create secret generic --save-config --dry-run=client -oyaml "$@" | kubectl apply -f-
}
function kcreatecm() {
kubectl create configmap --dry-run=client -oyaml "$@" | kubectl apply -f-
}
function kgseckey() {
local sec="$1"; shift
local key="$1"; shift
kubectl get secret "$sec" -o jsonpath="{.data.$key}" | base64 -d
}
function kgcmkey() {
local cm="$1"; shift
local key="$1"; shift
kubectl get configmap "$cm" -o jsonpath="{.data.$key}"
}
2024-05-15 23:33:29 +00:00
kcreatesec searxng \
--from-literal=SEARXNG_SECRET="$(kgseckey searxng SEARXNG_SECRET || openssl rand -hex 32)"
2024-05-01 08:36:34 +00:00
2024-05-15 21:31:25 +00:00
kcreatecm searxng \
--from-file=config/settings.yml \
--from-file=config/limiter.toml
2024-05-01 08:36:34 +00:00
kapply common/redis.yaml common/app.yaml
kubectl rollout restart deployment app