Mastodon--;Calckey++

This commit is contained in:
Danny Bessems 2023-06-17 18:53:33 +02:00
parent 86378358d6
commit 0659a4bcfe
35 changed files with 1096 additions and 0 deletions

View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: calckey

View File

@ -0,0 +1,31 @@
# Source: calckey/charts/redis/templates/configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: calckey-redis-configuration
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
data:
redis.conf: |-
# User-supplied common configuration:
# Enable AOF https://redis.io/topics/persistence#append-only-file
appendonly yes
# Disable RDB persistence, AOF persistence already enabled.
save ""
# End of common configuration
master.conf: |-
dir /data
# User-supplied master configuration:
rename-command FLUSHDB ""
rename-command FLUSHALL ""
# End of master configuration
replica.conf: |-
dir /data
# User-supplied replica configuration:
rename-command FLUSHDB ""
rename-command FLUSHALL ""
# End of replica configuration

View File

@ -0,0 +1,106 @@
# Source: calckey/charts/redis/templates/health-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: calckey-redis-health
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
data:
ping_readiness_local.sh: |-
#!/bin/bash
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
response=$(
timeout -s 3 $1 \
redis-cli \
-h localhost \
-p $REDIS_PORT \
ping
)
if [ "$?" -eq "124" ]; then
echo "Timed out"
exit 1
fi
if [ "$response" != "PONG" ]; then
echo "$response"
exit 1
fi
ping_liveness_local.sh: |-
#!/bin/bash
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
[[ -n "$REDIS_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_PASSWORD"
response=$(
timeout -s 3 $1 \
redis-cli \
-h localhost \
-p $REDIS_PORT \
ping
)
if [ "$?" -eq "124" ]; then
echo "Timed out"
exit 1
fi
responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}')
if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ] && [ "$responseFirstWord" != "MASTERDOWN" ]; then
echo "$response"
exit 1
fi
ping_readiness_master.sh: |-
#!/bin/bash
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
[[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD"
response=$(
timeout -s 3 $1 \
redis-cli \
-h $REDIS_MASTER_HOST \
-p $REDIS_MASTER_PORT_NUMBER \
ping
)
if [ "$?" -eq "124" ]; then
echo "Timed out"
exit 1
fi
if [ "$response" != "PONG" ]; then
echo "$response"
exit 1
fi
ping_liveness_master.sh: |-
#!/bin/bash
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
[[ -n "$REDIS_MASTER_PASSWORD" ]] && export REDISCLI_AUTH="$REDIS_MASTER_PASSWORD"
response=$(
timeout -s 3 $1 \
redis-cli \
-h $REDIS_MASTER_HOST \
-p $REDIS_MASTER_PORT_NUMBER \
ping
)
if [ "$?" -eq "124" ]; then
echo "Timed out"
exit 1
fi
responseFirstWord=$(echo $response | head -n1 | awk '{print $1;}')
if [ "$response" != "PONG" ] && [ "$responseFirstWord" != "LOADING" ]; then
echo "$response"
exit 1
fi
ping_readiness_local_and_master.sh: |-
script_dir="$(dirname "$0")"
exit_status=0
"$script_dir/ping_readiness_local.sh" $1 || exit_status=$?
"$script_dir/ping_readiness_master.sh" $1 || exit_status=$?
exit $exit_status
ping_liveness_local_and_master.sh: |-
script_dir="$(dirname "$0")"
exit_status=0
"$script_dir/ping_liveness_local.sh" $1 || exit_status=$?
"$script_dir/ping_liveness_master.sh" $1 || exit_status=$?
exit $exit_status

View File

@ -0,0 +1,78 @@
# Source: calckey/charts/redis/templates/scripts-configmap.yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: calckey-redis-scripts
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
data:
start-master.sh: |
#!/bin/bash
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
if [[ ! -f /opt/bitnami/redis/etc/master.conf ]];then
cp /opt/bitnami/redis/mounted-etc/master.conf /opt/bitnami/redis/etc/master.conf
fi
if [[ ! -f /opt/bitnami/redis/etc/redis.conf ]];then
cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf
fi
ARGS=("--port" "${REDIS_PORT}")
ARGS+=("--requirepass" "${REDIS_PASSWORD}")
ARGS+=("--masterauth" "${REDIS_PASSWORD}")
ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf")
ARGS+=("--include" "/opt/bitnami/redis/etc/master.conf")
exec redis-server "${ARGS[@]}"
start-replica.sh: |
#!/bin/bash
get_port() {
hostname="$1"
type="$2"
port_var=$(echo "${hostname^^}_SERVICE_PORT_$type" | sed "s/-/_/g")
port=${!port_var}
if [ -z "$port" ]; then
case $type in
"SENTINEL")
echo 26379
;;
"REDIS")
echo 6379
;;
esac
else
echo $port
fi
}
get_full_hostname() {
hostname="$1"
echo "${hostname}.${HEADLESS_SERVICE}"
}
REDISPORT=$(get_port "$HOSTNAME" "REDIS")
[[ -f $REDIS_PASSWORD_FILE ]] && export REDIS_PASSWORD="$(< "${REDIS_PASSWORD_FILE}")"
[[ -f $REDIS_MASTER_PASSWORD_FILE ]] && export REDIS_MASTER_PASSWORD="$(< "${REDIS_MASTER_PASSWORD_FILE}")"
if [[ ! -f /opt/bitnami/redis/etc/replica.conf ]];then
cp /opt/bitnami/redis/mounted-etc/replica.conf /opt/bitnami/redis/etc/replica.conf
fi
if [[ ! -f /opt/bitnami/redis/etc/redis.conf ]];then
cp /opt/bitnami/redis/mounted-etc/redis.conf /opt/bitnami/redis/etc/redis.conf
fi
echo "" >> /opt/bitnami/redis/etc/replica.conf
echo "replica-announce-port $REDISPORT" >> /opt/bitnami/redis/etc/replica.conf
echo "replica-announce-ip $(get_full_hostname "$HOSTNAME")" >> /opt/bitnami/redis/etc/replica.conf
ARGS=("--port" "${REDIS_PORT}")
ARGS+=("--replicaof" "${REDIS_MASTER_HOST}" "${REDIS_MASTER_PORT_NUMBER}")
ARGS+=("--requirepass" "${REDIS_PASSWORD}")
ARGS+=("--masterauth" "${REDIS_MASTER_PASSWORD}")
ARGS+=("--include" "/opt/bitnami/redis/etc/redis.conf")
ARGS+=("--include" "/opt/bitnami/redis/etc/replica.conf")
exec redis-server "${ARGS[@]}"

View File

@ -0,0 +1,68 @@
# Source: calckey/templates/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: calckey
labels:
helm.sh/chart: calckey-0.1.2
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
app.kubernetes.io/version: "rc"
app.kubernetes.io/managed-by: Helm
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
template:
metadata:
annotations:
checksum/secret-config: "fad5c186c2a77a5e28ea2a2b0d1818921d43b93ea6a67def51da8c8f64ba21de"
labels:
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
spec:
serviceAccountName: calckey
securityContext:
{}
volumes:
- name: config-volume
secret:
secretName: calckey-config
containers:
- name: calckey
securityContext:
{}
image: "docker.io/thatonecalculator/calckey:rc"
imagePullPolicy: IfNotPresent
command:
- pnpm
- run
- start
env:
- name: "NODE_ENV"
value: "production"
volumeMounts:
- name: config-volume
mountPath: /calckey/.config
ports:
- name: http
containerPort: 3000
protocol: TCP
startupProbe:
httpGet:
path: /
port: http
failureThreshold: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{}

View File

@ -0,0 +1,17 @@
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: calckey
namespace: calckey
spec:
entryPoints:
- websecure
routes:
- match: Host(`rest.itch.fyi`)
kind: Rule
services:
- name: calckey
port: 80
middlewares:
- name: security-headers@file
- name: compression@file

View File

@ -0,0 +1,44 @@
# Source: calckey/templates/job-db-migrate.yaml
apiVersion: batch/v1
kind: Job
metadata:
name: calckey-db-migrate
labels:
helm.sh/chart: calckey-0.1.2
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
app.kubernetes.io/version: "rc"
app.kubernetes.io/managed-by: Helm
annotations:
"helm.sh/hook": post-install,pre-upgrade
"helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded
"helm.sh/hook-weight": "-2"
spec:
template:
metadata:
name: calckey-db-migrate
spec:
restartPolicy: Never
serviceAccountName: calckey
securityContext:
{}
volumes:
- name: config-volume
secret:
secretName: calckey-config
containers:
- name: calckey
securityContext:
{}
image: "docker.io/thatonecalculator/calckey:rc"
imagePullPolicy: IfNotPresent
command:
- pnpm
- run
- migrate
env:
- name: "NODE_ENV"
value: "production"
volumeMounts:
- name: config-volume
mountPath: /calckey/.config

View File

@ -0,0 +1,20 @@
# Source: calckey/templates/tests/test-connection.yaml
apiVersion: v1
kind: Pod
metadata:
name: "calckey-test-connection"
labels:
helm.sh/chart: calckey-0.1.2
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
app.kubernetes.io/version: "rc"
app.kubernetes.io/managed-by: Helm
annotations:
"helm.sh/hook": test
spec:
containers:
- name: wget
image: busybox
command: ['wget']
args: ['calckey:80']
restartPolicy: Never

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,21 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: calckey-postgresql
namespace: default
spec:
encryptedData:
password: AgCPBAQc6EkNlgJWK2+RXluS/AKwbAo40YSfmAj0xOcG5P3JF8rGQpftUJygMsLoad+wcvp2z50s0IOSIZrBNsXhtUX1svnEadTK8eANXGdU/GB+K3hzl1HdR8yy5fFzQVKt5fa77lEjCqrnbZXoLunTMODgCsaq+DitbeuUB000cWjHPwSpBOICM0gRbSHRfN5nA3PR4oNMyN++HfUN1cN2N4ClF5d59lXcYMM4nqhDkm7paQMDdwah4o5tZCYaIfif7jZc5ODTRjrsokkdJP4d5/rAlwcjus9wiBNx9BTwj1RGW/UAKaMaZ+iUVE4dfYI40Q6YmheEpv/gb6FMTeEy6rsWB8GN39V6CCrDGpwPu4dl7ecmYxE53CpEc29EYIGPufaS7ajSYFXTOIYJf7vZKTA/NYy30P43sJczRzLFK4JLjfVghrtPBcvAogqU1ShA8UShZ1ukmqFYCEmT1E2Mf2oGLtyJm4jXRaFN7mPYhSnJamfzyDTCD1Bt6Ds/w4N2sTfP78UzJMK8EeFttRaMIRJulV9ZnxMozup8M07tVOKewQze+ieEnDd020D/RrjPr2velDuwyzr4bdxBYK1ZDczc52wd5Q15XYCZ/mXU9Hj8n6HyA7+JEhWr5QHkBjdWhiARFsAJH9p6kXwll6IGurWB0J4Xlg7VQzF7xwnosK5nbLApymhT/fHSiL20MV2PAADTOPxztq2gO7baa4CCDYGEreMB0STx/Sj9J26l8A==
postgres-password: AgCqBGTE0FzeJYf8zGhx+SsDq1t563++64x1blUiGg12tB7GF8U27zHy0oY99gza2P5Dy0e/ta2ILkkcuA+uqtqnYfKgfTL4Py5j2TdFJqvy45LYaxfALCni8IrLoLhtN3c4iPyA8GZn77emwqIXB4JJ/Naz6oRG5aWhj7GkZNm5X++LOxTKyNM7G437YH3fyluCwvCczefMc+2Efa9zkqBpwFoGz9SgqP1DeFBlDo4q/DGcm52BtInE2iNxJ2OSE25UcAC+md/z/6WXJvQohkZvHRyWqSnuBm4jICFDgrNGy9S8TVg9z5PpT80XPV8SWRRM0MeOyS6nwL/pmIkhS1miGpv+VzadPD9Ic4mzMKp8/x8wtErgT+3zjwVUDU8SSt3J4kaCCeMuEi9Q2+lp2f3nLKIFkGN9o7Slkj/0lOSPFtdpWO8jFrOZlXoZkXnDaD6QPo0t10VFjWCr5bvImivfxAzzvDH2833FHuG8YcYp8TBla9/ZKPbhDpFjdbzoILmX2qpczx1/T4o2s4ND497xnJ5N+DOnu3peEqqDPnhqn9Jgfec+C9x4vOIhf6WgrBFPsIVtle4F3NZkXtKSS2Niq819SPmEZghb6XNz3OjBulQewGX70AKXYhiBI5Qv800B55Bl45mn6PEDluzgd0XaVKAjq0k7tLjiXnNXDxLKoVE9zdunuMfpiO3uaKKkI5L1rv++PfEVQk052jShfhP4df1a+VR+8z5trEuIiL5B/g==
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: postgresql
helm.sh/chart: postgresql-11.1.3
name: calckey-postgresql
namespace: default
type: Opaque

View File

@ -0,0 +1,20 @@
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
creationTimestamp: null
name: calckey-redis
namespace: default
spec:
encryptedData:
redis-password: AgALj5kkS+4PMDMO1RAC8E2Vzzexhm/vyfatlw4BpQAAa4KOyVztDQkX+YaaDMve944/feKArH6L80ndighgrjxLiNHDh3/da/XLmB+27hr8994qvE4xy0YQzCo/2D5hOMDOHdTTmDnsqoIoY1Ly1GGiDBKPplXwgLW9Nw0m7JKHWEurlrYRrISmy5pdngwiXoX1UTa0DbyPxZt3IsbernaX1bPZ2si8ebxftKWv/+V2kyH5i5cIDh6XjU7chT7nX0QDXmQpJ2ebUdCqc7EbAwsxZwEO0348m71OW+DJsDh3gFOYs+bgFiPuH/tow4qccXbTOUHObpB85Hq5iDPIeWJhi3nFjxmeJ49rRnt1hSpGQT+W7Vc/IdXqapehtrTPVKABM4lo88Evqz09wbm+JViIC1LLE9u5tT1wNNPDbvOjl1m8hPNj7CslGoXUqv1sa67ZZueVp4Jn3WnhBJaCzXSVj2bMPH5xMX/G6TAJF76gDHhhxMHdh/61k2hIg3LWYElV4fkU8DrSznicPxg48w+Z+6EqMwlhQhAdlrX3snTuV3/tKxjjix8PVCMXDT3rZtmaQXrFA0xKg4QnebNF81j/AjD3OS/LwGcCN0+HAVqwkbscgxOkGvcrfyDjm8p1TQYgUajqqqqhyLSwrUES2K3MYlRwFHrLG8Dix6oLnfx5ao3kDO4D6lhUxLTnXLtrMpox1aJlv0BNmfKDQz8/qNjP5NhYH6qcpBhvEOOODv2APA==
template:
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
name: calckey-redis
namespace: default
type: Opaque

View File

@ -0,0 +1,32 @@
# Source: calckey/charts/postgresql/templates/primary/svc-headless.yaml
apiVersion: v1
kind: Service
metadata:
name: calckey-postgresql-hl
namespace: default
labels:
app.kubernetes.io/name: postgresql
helm.sh/chart: postgresql-11.1.3
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: primary
# Use this annotation in addition to the actual publishNotReadyAddresses
# field below because the annotation will stop being respected soon but the
# field is broken in some versions of Kubernetes:
# https://github.com/kubernetes/kubernetes/issues/58662
service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
spec:
type: ClusterIP
clusterIP: None
# We want all pods in the StatefulSet to have their addresses published for
# the sake of the other Postgresql pods even before they're ready, since they
# have to be able to talk to each other in order to become ready.
publishNotReadyAddresses: true
ports:
- name: tcp-postgresql
port: 5432
targetPort: tcp-postgresql
selector:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: primary

View File

@ -0,0 +1,24 @@
# Source: calckey/charts/postgresql/templates/primary/svc.yaml
apiVersion: v1
kind: Service
metadata:
name: calckey-postgresql
namespace: default
labels:
app.kubernetes.io/name: postgresql
helm.sh/chart: postgresql-11.1.3
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: primary
annotations:
spec:
type: ClusterIP
ports:
- name: tcp-postgresql
port: 5432
targetPort: tcp-postgresql
nodePort: null
selector:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: primary

View File

@ -0,0 +1,23 @@
# Source: calckey/charts/redis/templates/headless-svc.yaml
apiVersion: v1
kind: Service
metadata:
name: calckey-redis-headless
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
annotations:
spec:
type: ClusterIP
clusterIP: None
ports:
- name: tcp-redis
port: 6379
targetPort: redis
selector:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey

View File

@ -0,0 +1,25 @@
# Source: calckey/charts/redis/templates/master/service.yaml
apiVersion: v1
kind: Service
metadata:
name: calckey-redis-master
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: master
spec:
type: ClusterIP
internalTrafficPolicy: Cluster
sessionAffinity: None
ports:
- name: tcp-redis
port: 6379
targetPort: redis
nodePort: null
selector:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: master

View File

@ -0,0 +1,25 @@
# Source: calckey/charts/redis/templates/replicas/service.yaml
apiVersion: v1
kind: Service
metadata:
name: calckey-redis-replicas
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: replica
spec:
type: ClusterIP
internalTrafficPolicy: Cluster
sessionAffinity: None
ports:
- name: tcp-redis
port: 6379
targetPort: redis
nodePort: null
selector:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: replica

View File

@ -0,0 +1,21 @@
# Source: calckey/templates/service.yaml
apiVersion: v1
kind: Service
metadata:
name: calckey
labels:
helm.sh/chart: calckey-0.1.2
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
app.kubernetes.io/version: "rc"
app.kubernetes.io/managed-by: Helm
spec:
type: ClusterIP
ports:
- port: 80
targetPort: http
protocol: TCP
name: http
selector:
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey

View File

@ -0,0 +1,12 @@
# Source: calckey/charts/redis/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
automountServiceAccountToken: true
metadata:
name: calckey-redis
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm

View File

@ -0,0 +1,11 @@
# Source: calckey/templates/serviceaccount.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
name: calckey
labels:
helm.sh/chart: calckey-0.1.2
app.kubernetes.io/name: calckey
app.kubernetes.io/instance: calckey
app.kubernetes.io/version: "rc"
app.kubernetes.io/managed-by: Helm

View File

@ -0,0 +1,165 @@
# Source: calckey/charts/postgresql/templates/primary/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: calckey-postgresql
namespace: default
labels:
app.kubernetes.io/name: postgresql
helm.sh/chart: postgresql-11.1.3
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: primary
annotations:
spec:
replicas: 1
serviceName: calckey-postgresql-hl
updateStrategy:
rollingUpdate: {}
type: RollingUpdate
selector:
matchLabels:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: primary
template:
metadata:
name: calckey-postgresql
labels:
app.kubernetes.io/name: postgresql
helm.sh/chart: postgresql-11.1.3
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: primary
annotations:
spec:
serviceAccountName: default
affinity:
podAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: postgresql
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: primary
namespaces:
- "default"
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:
securityContext:
fsGroup: 1001
hostNetwork: false
hostIPC: false
initContainers:
containers:
- name: postgresql
image: docker.io/bitnami/postgresql:14.2.0-debian-10-r14
imagePullPolicy: "IfNotPresent"
securityContext:
runAsUser: 1001
env:
- name: BITNAMI_DEBUG
value: "false"
- name: POSTGRESQL_PORT_NUMBER
value: "5432"
- name: POSTGRESQL_VOLUME_DIR
value: "/bitnami/postgresql"
- name: PGDATA
value: "/bitnami/postgresql/data"
# Authentication
- name: POSTGRES_USER
value: "calckey"
- name: POSTGRES_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: calckey-postgresql
key: postgres-password
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: calckey-postgresql
key: password
- name: POSTGRES_DB
value: "calckey_production"
# Replication
# Initdb
# Standby
# LDAP
- name: POSTGRESQL_ENABLE_LDAP
value: "no"
# TLS
- name: POSTGRESQL_ENABLE_TLS
value: "no"
# Audit
- name: POSTGRESQL_LOG_HOSTNAME
value: "false"
- name: POSTGRESQL_LOG_CONNECTIONS
value: "false"
- name: POSTGRESQL_LOG_DISCONNECTIONS
value: "false"
- name: POSTGRESQL_PGAUDIT_LOG_CATALOG
value: "off"
# Others
- name: POSTGRESQL_CLIENT_MIN_MESSAGES
value: "error"
- name: POSTGRESQL_SHARED_PRELOAD_LIBRARIES
value: "pgaudit"
ports:
- name: tcp-postgresql
containerPort: 5432
livenessProbe:
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
exec:
command:
- /bin/sh
- -c
- exec pg_isready -U "calckey" -d "dbname=calckey_production" -h 127.0.0.1 -p 5432
readinessProbe:
failureThreshold: 6
initialDelaySeconds: 5
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
exec:
command:
- /bin/sh
- -c
- -e
- |
exec pg_isready -U "calckey" -d "dbname=calckey_production" -h 127.0.0.1 -p 5432
[ -f /opt/bitnami/postgresql/tmp/.initialized ] || [ -f /bitnami/postgresql/.initialized ]
resources:
limits: {}
requests:
cpu: 250m
memory: 256Mi
volumeMounts:
- name: dshm
mountPath: /dev/shm
- name: data
mountPath: /bitnami/postgresql
volumes:
- name: dshm
emptyDir:
medium: Memory
volumeClaimTemplates:
- metadata:
name: data
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "25Gi"
storageClassName: longhorn

View File

@ -0,0 +1,158 @@
# Source: calckey/charts/redis/templates/master/application.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: calckey-redis-master
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: master
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: master
serviceName: calckey-redis-headless
updateStrategy:
rollingUpdate: {}
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: master
annotations:
checksum/configmap: 704277d4ad2a6b119bddb0231d8e367729adc7969d2cf18690f74d9f4fcc1002
checksum/health: 5bce17c7b4d3099300dec41326b077bb3e748d146175eb1d7e078f3768ebfe41
checksum/scripts: 6b7dad2abd637e7811a0dc9e66ebd8217bfcd41606216ff69782a5bd044c4cd3
checksum/secret: c636eaa1a6b4db1149e57a7f5ac501956a8e872ece7921014fb33593394734ab
spec:
securityContext:
fsGroup: 1001
serviceAccountName: calckey-redis
affinity:
podAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: master
namespaces:
- "default"
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:
terminationGracePeriodSeconds: 30
containers:
- name: redis
image: docker.io/bitnami/redis:6.2.7-debian-11-r11
imagePullPolicy: "IfNotPresent"
securityContext:
runAsUser: 1001
command:
- /bin/bash
args:
- -c
- /opt/bitnami/scripts/start-scripts/start-master.sh
env:
- name: BITNAMI_DEBUG
value: "false"
- name: REDIS_REPLICATION_MODE
value: master
- name: ALLOW_EMPTY_PASSWORD
value: "no"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: calckey-redis
key: redis-password
- name: REDIS_TLS_ENABLED
value: "no"
- name: REDIS_PORT
value: "6379"
ports:
- name: redis
containerPort: 6379
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 5
# One second longer than command timeout should prevent generation of zombie processes.
timeoutSeconds: 6
successThreshold: 1
failureThreshold: 5
exec:
command:
- sh
- -c
- /health/ping_liveness_local.sh 5
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 5
exec:
command:
- sh
- -c
- /health/ping_readiness_local.sh 1
resources:
limits: {}
requests: {}
volumeMounts:
- name: start-scripts
mountPath: /opt/bitnami/scripts/start-scripts
- name: health
mountPath: /health
- name: redis-data
mountPath: /data
subPath:
- name: config
mountPath: /opt/bitnami/redis/mounted-etc
- name: redis-tmp-conf
mountPath: /opt/bitnami/redis/etc/
- name: tmp
mountPath: /tmp
volumes:
- name: start-scripts
configMap:
name: calckey-redis-scripts
defaultMode: 0755
- name: health
configMap:
name: calckey-redis-health
defaultMode: 0755
- name: config
configMap:
name: calckey-redis-configuration
- name: redis-tmp-conf
emptyDir: {}
- name: tmp
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: redis-data
labels:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: master
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "10Gi"

View File

@ -0,0 +1,170 @@
# Source: calckey/charts/redis/templates/replicas/statefulset.yaml
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: calckey-redis-replicas
namespace: "default"
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: replica
spec:
replicas: 0
selector:
matchLabels:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: replica
serviceName: calckey-redis-headless
updateStrategy:
rollingUpdate: {}
type: RollingUpdate
template:
metadata:
labels:
app.kubernetes.io/name: redis
helm.sh/chart: redis-16.13.2
app.kubernetes.io/instance: calckey
app.kubernetes.io/managed-by: Helm
app.kubernetes.io/component: replica
annotations:
checksum/configmap: 704277d4ad2a6b119bddb0231d8e367729adc7969d2cf18690f74d9f4fcc1002
checksum/health: 5bce17c7b4d3099300dec41326b077bb3e748d146175eb1d7e078f3768ebfe41
checksum/scripts: 6b7dad2abd637e7811a0dc9e66ebd8217bfcd41606216ff69782a5bd044c4cd3
checksum/secret: c636eaa1a6b4db1149e57a7f5ac501956a8e872ece7921014fb33593394734ab
spec:
securityContext:
fsGroup: 1001
serviceAccountName: calckey-redis
affinity:
podAffinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- podAffinityTerm:
labelSelector:
matchLabels:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: replica
namespaces:
- "default"
topologyKey: kubernetes.io/hostname
weight: 1
nodeAffinity:
terminationGracePeriodSeconds: 30
containers:
- name: redis
image: docker.io/bitnami/redis:6.2.7-debian-11-r11
imagePullPolicy: "IfNotPresent"
securityContext:
runAsUser: 1001
command:
- /bin/bash
args:
- -c
- /opt/bitnami/scripts/start-scripts/start-replica.sh
env:
- name: BITNAMI_DEBUG
value: "false"
- name: REDIS_REPLICATION_MODE
value: slave
- name: REDIS_MASTER_HOST
value: calckey-redis-master-0.calckey-redis-headless.default.svc.cluster.local
- name: REDIS_MASTER_PORT_NUMBER
value: "6379"
- name: ALLOW_EMPTY_PASSWORD
value: "no"
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
name: calckey-redis
key: redis-password
- name: REDIS_MASTER_PASSWORD
valueFrom:
secretKeyRef:
name: calckey-redis
key: redis-password
- name: REDIS_TLS_ENABLED
value: "no"
- name: REDIS_PORT
value: "6379"
ports:
- name: redis
containerPort: 6379
startupProbe:
failureThreshold: 22
initialDelaySeconds: 10
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
tcpSocket:
port: redis
livenessProbe:
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 6
successThreshold: 1
failureThreshold: 5
exec:
command:
- sh
- -c
- /health/ping_liveness_local_and_master.sh 5
readinessProbe:
initialDelaySeconds: 20
periodSeconds: 5
timeoutSeconds: 2
successThreshold: 1
failureThreshold: 5
exec:
command:
- sh
- -c
- /health/ping_readiness_local_and_master.sh 1
resources:
limits: {}
requests: {}
volumeMounts:
- name: start-scripts
mountPath: /opt/bitnami/scripts/start-scripts
- name: health
mountPath: /health
- name: redis-data
mountPath: /data
subPath:
- name: config
mountPath: /opt/bitnami/redis/mounted-etc
- name: redis-tmp-conf
mountPath: /opt/bitnami/redis/etc
volumes:
- name: start-scripts
configMap:
name: calckey-redis-scripts
defaultMode: 0755
- name: health
configMap:
name: calckey-redis-health
defaultMode: 0755
- name: config
configMap:
name: calckey-redis-configuration
- name: redis-tmp-conf
emptyDir: {}
volumeClaimTemplates:
- metadata:
name: redis-data
labels:
app.kubernetes.io/name: redis
app.kubernetes.io/instance: calckey
app.kubernetes.io/component: replica
spec:
accessModes:
- "ReadWriteOnce"
resources:
requests:
storage: "8Gi"