feat: gitea manifests

This commit is contained in:
ange 2024-08-17 22:58:46 +07:00
parent e1abb674d0
commit c245e46383
Signed by: ange
GPG key ID: 9E0C4157BB7BEB1D
9 changed files with 143 additions and 7 deletions

36
manifests/bin/deploy.sh Executable file
View file

@ -0,0 +1,36 @@
#!/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}"
}
kapply common/app.yaml
kubectl rollout restart deployment app

5
manifests/bin/devel.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash -e
export NB_REPLICAS=1
. ./manifests/bin/deploy.sh

5
manifests/bin/prod.sh Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash -e
export NB_REPLICAS=3
. ./manifests/bin/deploy.sh