searxng/manifests/bin/deploy.sh
ange b24dc7fbab
All checks were successful
/ deploy (push) Successful in 5s
chore: bump 2024.7.29-98c73010f (#1)
Reviewed-on: #1
2024-07-30 10:21:28 +00:00

44 lines
990 B
Bash
Executable File

#!/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}"
}
kcreatesec searxng \
--from-literal=SEARXNG_SECRET="$(kgseckey searxng SEARXNG_SECRET || openssl rand -hex 32)"
kcreatecm searxng \
--from-file=config/settings.yml \
--from-file=config/limiter.toml
kapply common/valkey.yaml common/app.yaml
kubectl rollout restart deployment app