Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a094d3b925 | |||
| 9508a8483c | |||
| c5919259f6 | |||
| 83de150f87 | |||
| 70d785769e | |||
| f129977993 | |||
| cf4c70075c | |||
| 2b979b5f43 | |||
| dbecdb7069 | |||
| fb7dfbee57 | |||
| 6b5a0fc31f | |||
| 47adf8e718 | |||
| 54980ff18b | |||
| ccfa5df898 | |||
| 3cd60a353e | |||
| 4d000080d8 | |||
| 3881b5b3ba |
@@ -53,7 +53,6 @@ ArgoCD homelab project
|
|||||||
| **k8s-secrets** | [](https://ag.hexor.cy/applications/argocd/k8s-secrets) |
|
| **k8s-secrets** | [](https://ag.hexor.cy/applications/argocd/k8s-secrets) |
|
||||||
| **khm** | [](https://ag.hexor.cy/applications/argocd/khm) |
|
| **khm** | [](https://ag.hexor.cy/applications/argocd/khm) |
|
||||||
| **lidarr** | [](https://ag.hexor.cy/applications/argocd/lidarr) |
|
| **lidarr** | [](https://ag.hexor.cy/applications/argocd/lidarr) |
|
||||||
| **llamacpp** | [](https://ag.hexor.cy/applications/argocd/llamacpp) |
|
|
||||||
| **matrix** | [](https://ag.hexor.cy/applications/argocd/matrix) |
|
| **matrix** | [](https://ag.hexor.cy/applications/argocd/matrix) |
|
||||||
| **mtproxy** | [](https://ag.hexor.cy/applications/argocd/mtproxy) |
|
| **mtproxy** | [](https://ag.hexor.cy/applications/argocd/mtproxy) |
|
||||||
| **n8n** | [](https://ag.hexor.cy/applications/argocd/n8n) |
|
| **n8n** | [](https://ag.hexor.cy/applications/argocd/n8n) |
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
apiVersion: argoproj.io/v1alpha1
|
||||||
|
kind: Application
|
||||||
|
metadata:
|
||||||
|
name: amnezia
|
||||||
|
namespace: argocd
|
||||||
|
spec:
|
||||||
|
project: apps
|
||||||
|
destination:
|
||||||
|
namespace: amnezia
|
||||||
|
server: https://kubernetes.default.svc
|
||||||
|
source:
|
||||||
|
repoURL: ssh://git@gt.hexor.cy:30022/ab/homelab.git
|
||||||
|
targetRevision: HEAD
|
||||||
|
path: k8s/apps/amnezia
|
||||||
|
syncPolicy:
|
||||||
|
automated:
|
||||||
|
selfHeal: true
|
||||||
|
prune: true
|
||||||
|
syncOptions:
|
||||||
|
- CreateNamespace=true
|
||||||
@@ -0,0 +1,168 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: amneziawg-scripts
|
||||||
|
data:
|
||||||
|
firewall-up.sh: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
PORT="${1:-5847}"
|
||||||
|
VPN_CIDR="${2:-10.8.0.0/16}"
|
||||||
|
|
||||||
|
external_interface() {
|
||||||
|
ip route get 1.1.1.1 | awk '{for (i=1;i<=NF;i++) if ($i=="dev") {print $(i+1); exit}}'
|
||||||
|
}
|
||||||
|
|
||||||
|
ensure_insert_rule() {
|
||||||
|
local table_args=()
|
||||||
|
if [ "${1:-}" = "-t" ]; then
|
||||||
|
table_args=("$1" "$2")
|
||||||
|
shift 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
local chain="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if ! iptables "${table_args[@]}" -C "${chain}" "$@" >/dev/null 2>&1; then
|
||||||
|
iptables "${table_args[@]}" -I "${chain}" 1 "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_rule() {
|
||||||
|
local table_args=()
|
||||||
|
if [ "${1:-}" = "-t" ]; then
|
||||||
|
table_args=("$1" "$2")
|
||||||
|
shift 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
local chain="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
while iptables "${table_args[@]}" -D "${chain}" "$@" >/dev/null 2>&1; do
|
||||||
|
true
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
ensure_append_rule() {
|
||||||
|
local table_args=()
|
||||||
|
if [ "${1:-}" = "-t" ]; then
|
||||||
|
table_args=("$1" "$2")
|
||||||
|
shift 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
local chain="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
if ! iptables "${table_args[@]}" -C "${chain}" "$@" >/dev/null 2>&1; then
|
||||||
|
iptables "${table_args[@]}" -A "${chain}" "$@"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
EXT_IF="$(external_interface || true)"
|
||||||
|
if [ -z "${EXT_IF}" ]; then
|
||||||
|
EXT_IF="$(ip route show default | awk '{print $5; exit}')"
|
||||||
|
fi
|
||||||
|
if [ -z "${EXT_IF}" ]; then
|
||||||
|
echo "Unable to detect external interface"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
sysctl -w net.ipv4.ip_forward=1
|
||||||
|
|
||||||
|
delete_rule INPUT -i tailscale0 -p udp -m comment --comment amneziawg-block-tailscale -j DROP
|
||||||
|
ensure_insert_rule INPUT -i "${EXT_IF}" -p udp --dport "${PORT}" -m comment --comment amneziawg-allow-external -j ACCEPT
|
||||||
|
ensure_insert_rule INPUT -i tailscale0 -p udp --dport "${PORT}" -m comment --comment amneziawg-block-tailscale -j DROP
|
||||||
|
ensure_append_rule INPUT -i awg0 -m comment --comment amneziawg-awg-input -j ACCEPT
|
||||||
|
ensure_append_rule FORWARD -i awg0 -m comment --comment amneziawg-forward-in -j ACCEPT
|
||||||
|
ensure_append_rule FORWARD -o awg0 -m comment --comment amneziawg-forward-out -j ACCEPT
|
||||||
|
ensure_append_rule -t nat POSTROUTING -s "${VPN_CIDR}" -o "${EXT_IF}" -m comment --comment amneziawg-masquerade -j MASQUERADE
|
||||||
|
|
||||||
|
firewall-down.sh: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
PORT="${1:-5847}"
|
||||||
|
VPN_CIDR="${2:-10.8.0.0/16}"
|
||||||
|
|
||||||
|
external_interface() {
|
||||||
|
ip route get 1.1.1.1 | awk '{for (i=1;i<=NF;i++) if ($i=="dev") {print $(i+1); exit}}'
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_rule() {
|
||||||
|
local table_args=()
|
||||||
|
if [ "${1:-}" = "-t" ]; then
|
||||||
|
table_args=("$1" "$2")
|
||||||
|
shift 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
local chain="$1"
|
||||||
|
shift
|
||||||
|
|
||||||
|
while iptables "${table_args[@]}" -D "${chain}" "$@" >/dev/null 2>&1; do
|
||||||
|
true
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
EXT_IF="$(external_interface || true)"
|
||||||
|
if [ -z "${EXT_IF}" ]; then
|
||||||
|
EXT_IF="$(ip route show default | awk '{print $5; exit}')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "${EXT_IF}" ]; then
|
||||||
|
delete_rule INPUT -i "${EXT_IF}" -p udp --dport "${PORT}" -m comment --comment amneziawg-allow-external -j ACCEPT
|
||||||
|
delete_rule -t nat POSTROUTING -s "${VPN_CIDR}" -o "${EXT_IF}" -m comment --comment amneziawg-masquerade -j MASQUERADE
|
||||||
|
fi
|
||||||
|
|
||||||
|
delete_rule INPUT -i tailscale0 -p udp --dport "${PORT}" -m comment --comment amneziawg-block-tailscale -j DROP
|
||||||
|
delete_rule INPUT -i tailscale0 -p udp -m comment --comment amneziawg-block-tailscale -j DROP
|
||||||
|
delete_rule INPUT -i awg0 -m comment --comment amneziawg-awg-input -j ACCEPT
|
||||||
|
delete_rule FORWARD -i awg0 -m comment --comment amneziawg-forward-in -j ACCEPT
|
||||||
|
delete_rule FORWARD -o awg0 -m comment --comment amneziawg-forward-out -j ACCEPT
|
||||||
|
|
||||||
|
run.sh: |
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
SERVER_CONFIG="/etc/amnezia/server/awg0.conf"
|
||||||
|
CLIENTS_DIR="/etc/amnezia/clients"
|
||||||
|
RUNTIME_CONFIG="/run/amnezia/awg0.conf"
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
if awg show awg0 >/dev/null 2>&1; then
|
||||||
|
awg-quick down "${RUNTIME_CONFIG}" || ip link delete awg0 || true
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
render_config() {
|
||||||
|
mkdir -p "$(dirname "${RUNTIME_CONFIG}")"
|
||||||
|
cp "${SERVER_CONFIG}" "${RUNTIME_CONFIG}"
|
||||||
|
chmod 0600 "${RUNTIME_CONFIG}"
|
||||||
|
|
||||||
|
local clients_found=0
|
||||||
|
for client_config in "${CLIENTS_DIR}"/*; do
|
||||||
|
[ -f "${client_config}" ] || continue
|
||||||
|
[ -s "${client_config}" ] || continue
|
||||||
|
printf '\n' >> "${RUNTIME_CONFIG}"
|
||||||
|
cat "${client_config}" >> "${RUNTIME_CONFIG}"
|
||||||
|
clients_found=1
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ "${clients_found}" = "0" ]; then
|
||||||
|
echo "No client peer configs found in ${CLIENTS_DIR}; starting without peers"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
trap cleanup EXIT
|
||||||
|
trap 'exit 0' TERM INT
|
||||||
|
|
||||||
|
render_config
|
||||||
|
cleanup
|
||||||
|
awg-quick up "${RUNTIME_CONFIG}"
|
||||||
|
awg show awg0 || true
|
||||||
|
|
||||||
|
while true; do
|
||||||
|
sleep 3600 &
|
||||||
|
wait "$!"
|
||||||
|
done
|
||||||
@@ -0,0 +1,148 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: DaemonSet
|
||||||
|
metadata:
|
||||||
|
name: amneziawg
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
annotations:
|
||||||
|
reloader.stakater.com/auto: "true"
|
||||||
|
secret.reloader.stakater.com/reload: "amneziawg-server,amneziawg-clients"
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: amneziawg
|
||||||
|
updateStrategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
spec:
|
||||||
|
serviceAccountName: amneziawg
|
||||||
|
hostNetwork: true
|
||||||
|
dnsPolicy: ClusterFirstWithHostNet
|
||||||
|
nodeSelector:
|
||||||
|
amnezia-vpn: "true"
|
||||||
|
tolerations:
|
||||||
|
- operator: Exists
|
||||||
|
initContainers:
|
||||||
|
- name: register-endpoint
|
||||||
|
image: bitnami/kubectl:latest
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
env:
|
||||||
|
- name: NODE_NAME
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: spec.nodeName
|
||||||
|
- name: PORT
|
||||||
|
value: "5847"
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -lc
|
||||||
|
- |
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
NAMESPACE="$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace)"
|
||||||
|
ENDPOINT="$(kubectl get node "${NODE_NAME}" -o jsonpath="{.metadata.labels['external-ipv4']}")"
|
||||||
|
|
||||||
|
if [ -z "${ENDPOINT}" ]; then
|
||||||
|
ENDPOINT="$(kubectl get node "${NODE_NAME}" -o jsonpath='{range .status.addresses[?(@.type=="ExternalIP")]}{.address}{end}')"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -z "${ENDPOINT}" ]; then
|
||||||
|
echo "ERROR: node ${NODE_NAME} has no external-ipv4 label and no ExternalIP"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
VALUE="${ENDPOINT}:${PORT}"
|
||||||
|
echo "Registering AmneziaWG endpoint: ${NODE_NAME} -> ${VALUE}"
|
||||||
|
|
||||||
|
if kubectl get secret amneziawg-endpoints -n "${NAMESPACE}" >/dev/null 2>&1; then
|
||||||
|
kubectl patch secret amneziawg-endpoints -n "${NAMESPACE}" \
|
||||||
|
--type merge -p "{\"stringData\":{\"${NODE_NAME}\":\"${VALUE}\"}}"
|
||||||
|
else
|
||||||
|
kubectl create secret generic amneziawg-endpoints -n "${NAMESPACE}" \
|
||||||
|
--from-literal="${NODE_NAME}=${VALUE}"
|
||||||
|
fi
|
||||||
|
containers:
|
||||||
|
- name: amneziawg
|
||||||
|
image: amneziavpn/amneziawg-go:latest
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
securityContext:
|
||||||
|
privileged: true
|
||||||
|
capabilities:
|
||||||
|
add:
|
||||||
|
- NET_ADMIN
|
||||||
|
- SYS_MODULE
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- /scripts/run.sh
|
||||||
|
ports:
|
||||||
|
- name: awg
|
||||||
|
containerPort: 5847
|
||||||
|
protocol: UDP
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -lc
|
||||||
|
- awg show awg0 >/dev/null 2>&1
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 3
|
||||||
|
failureThreshold: 3
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command:
|
||||||
|
- /bin/bash
|
||||||
|
- -lc
|
||||||
|
- awg show awg0 >/dev/null 2>&1
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 30
|
||||||
|
timeoutSeconds: 5
|
||||||
|
failureThreshold: 3
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: "64Mi"
|
||||||
|
cpu: "50m"
|
||||||
|
limits:
|
||||||
|
memory: "256Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
volumeMounts:
|
||||||
|
- name: server-config
|
||||||
|
mountPath: /etc/amnezia/server
|
||||||
|
readOnly: true
|
||||||
|
- name: client-config
|
||||||
|
mountPath: /etc/amnezia/clients
|
||||||
|
readOnly: true
|
||||||
|
- name: scripts
|
||||||
|
mountPath: /scripts
|
||||||
|
readOnly: true
|
||||||
|
- name: runtime-config
|
||||||
|
mountPath: /run/amnezia
|
||||||
|
- name: dev-net-tun
|
||||||
|
mountPath: /dev/net/tun
|
||||||
|
volumes:
|
||||||
|
- name: server-config
|
||||||
|
secret:
|
||||||
|
secretName: amneziawg-server
|
||||||
|
defaultMode: 0600
|
||||||
|
items:
|
||||||
|
- key: awg0.conf
|
||||||
|
path: awg0.conf
|
||||||
|
- name: client-config
|
||||||
|
secret:
|
||||||
|
secretName: amneziawg-clients
|
||||||
|
optional: true
|
||||||
|
defaultMode: 0600
|
||||||
|
- name: scripts
|
||||||
|
configMap:
|
||||||
|
name: amneziawg-scripts
|
||||||
|
defaultMode: 0755
|
||||||
|
- name: runtime-config
|
||||||
|
emptyDir: {}
|
||||||
|
- name: dev-net-tun
|
||||||
|
hostPath:
|
||||||
|
path: /dev/net/tun
|
||||||
|
type: CharDevice
|
||||||
@@ -0,0 +1,50 @@
|
|||||||
|
---
|
||||||
|
apiVersion: external-secrets.io/v1
|
||||||
|
kind: ExternalSecret
|
||||||
|
metadata:
|
||||||
|
name: amneziawg-server
|
||||||
|
spec:
|
||||||
|
target:
|
||||||
|
name: amneziawg-server
|
||||||
|
deletionPolicy: Delete
|
||||||
|
template:
|
||||||
|
type: Opaque
|
||||||
|
data:
|
||||||
|
server-public-key: |-
|
||||||
|
{{ .server_public_key }}
|
||||||
|
awg0.conf: |-
|
||||||
|
[Interface]
|
||||||
|
PrivateKey = {{ .server_private_key }}
|
||||||
|
Address = 10.8.0.1/16
|
||||||
|
ListenPort = 5847
|
||||||
|
MTU = 1376
|
||||||
|
Jc = 4
|
||||||
|
Jmin = 64
|
||||||
|
Jmax = 128
|
||||||
|
S1 = 15
|
||||||
|
S2 = 18
|
||||||
|
S3 = 20
|
||||||
|
S4 = 23
|
||||||
|
H1 = 1020325451
|
||||||
|
H2 = 3288052141
|
||||||
|
H3 = 1766607858
|
||||||
|
H4 = 2528465083
|
||||||
|
PostUp = /scripts/firewall-up.sh 5847 10.8.0.0/16
|
||||||
|
PostDown = /scripts/firewall-down.sh 5847 10.8.0.0/16
|
||||||
|
data:
|
||||||
|
- secretKey: server_private_key
|
||||||
|
sourceRef:
|
||||||
|
storeRef:
|
||||||
|
name: vaultwarden-login
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
remoteRef:
|
||||||
|
key: 3092dc7c-41dd-461a-9f7a-377727f47e93
|
||||||
|
property: fields[0].value
|
||||||
|
- secretKey: server_public_key
|
||||||
|
sourceRef:
|
||||||
|
storeRef:
|
||||||
|
name: vaultwarden-login
|
||||||
|
kind: ClusterSecretStore
|
||||||
|
remoteRef:
|
||||||
|
key: 3092dc7c-41dd-461a-9f7a-377727f47e93
|
||||||
|
property: fields[1].value
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- app.yaml
|
||||||
|
- namespace.yaml
|
||||||
|
- external-secrets.yaml
|
||||||
|
- configmap-scripts.yaml
|
||||||
|
- rbac.yaml
|
||||||
|
- daemonset.yaml
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: amnezia
|
||||||
|
labels:
|
||||||
|
pod-security.kubernetes.io/enforce: privileged
|
||||||
|
pod-security.kubernetes.io/audit: privileged
|
||||||
|
pod-security.kubernetes.io/warn: privileged
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: ServiceAccount
|
||||||
|
metadata:
|
||||||
|
name: amneziawg
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRole
|
||||||
|
metadata:
|
||||||
|
name: amneziawg-node-reader
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["nodes"]
|
||||||
|
verbs: ["get", "list"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: ClusterRoleBinding
|
||||||
|
metadata:
|
||||||
|
name: amneziawg-node-reader
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: ClusterRole
|
||||||
|
name: amneziawg-node-reader
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: amneziawg
|
||||||
|
namespace: amnezia
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: Role
|
||||||
|
metadata:
|
||||||
|
name: amneziawg-endpoint-manager
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
rules:
|
||||||
|
- apiGroups: [""]
|
||||||
|
resources: ["secrets"]
|
||||||
|
verbs: ["get", "create", "patch"]
|
||||||
|
---
|
||||||
|
apiVersion: rbac.authorization.k8s.io/v1
|
||||||
|
kind: RoleBinding
|
||||||
|
metadata:
|
||||||
|
name: amneziawg-endpoint-manager
|
||||||
|
labels:
|
||||||
|
app: amneziawg
|
||||||
|
roleRef:
|
||||||
|
apiGroup: rbac.authorization.k8s.io
|
||||||
|
kind: Role
|
||||||
|
name: amneziawg-endpoint-manager
|
||||||
|
subjects:
|
||||||
|
- kind: ServiceAccount
|
||||||
|
name: amneziawg
|
||||||
@@ -41,18 +41,18 @@ spec:
|
|||||||
- name: GITEA__service__REGISTER_MANUAL_CONFIRM
|
- name: GITEA__service__REGISTER_MANUAL_CONFIRM
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: GITEA__service__ENABLE_CAPTCHA
|
- name: GITEA__service__ENABLE_CAPTCHA
|
||||||
value: "false"
|
|
||||||
- name: GITEA__service__REQUIRE_CAPTCHA_FOR_LOGIN
|
|
||||||
value: "true"
|
value: "true"
|
||||||
|
- name: GITEA__service__REQUIRE_CAPTCHA_FOR_LOGIN
|
||||||
|
value: "false"
|
||||||
- name: GITEA__service__REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA
|
- name: GITEA__service__REQUIRE_EXTERNAL_REGISTRATION_CAPTCHA
|
||||||
value: "true"
|
value: "true"
|
||||||
- name: GITEA__service__CAPTCHA_TYPE
|
- name: GITEA__service__CAPTCHA_TYPE
|
||||||
value: "hcaptcha"
|
value: "cfturnstile"
|
||||||
- name: GITEA__webhook__ALLOWED_HOST_LIST
|
- name: GITEA__webhook__ALLOWED_HOST_LIST
|
||||||
value: "*"
|
value: "*"
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
name: gitea-recapcha-creds
|
name: gitea-runner-act-runner-secrets
|
||||||
ports:
|
ports:
|
||||||
- name: http
|
- name: http
|
||||||
containerPort: 3000
|
containerPort: 3000
|
||||||
|
|||||||
@@ -13,6 +13,10 @@ spec:
|
|||||||
data:
|
data:
|
||||||
token: |-
|
token: |-
|
||||||
{{ .password }}
|
{{ .password }}
|
||||||
|
GITEA__service__CF_TURNSTILE_SITEKEY: |-
|
||||||
|
{{ .CF_TURNSTILE_SITEKEY }}
|
||||||
|
GITEA__service__CF_TURNSTILE_SECRET: |-
|
||||||
|
{{ .CF_TURNSTILE_SECRET }}
|
||||||
data:
|
data:
|
||||||
- secretKey: password
|
- secretKey: password
|
||||||
sourceRef:
|
sourceRef:
|
||||||
@@ -22,38 +26,19 @@ spec:
|
|||||||
remoteRef:
|
remoteRef:
|
||||||
key: e475b5ab-ea3c-48a5-bb4c-a6bc552fc064
|
key: e475b5ab-ea3c-48a5-bb4c-a6bc552fc064
|
||||||
property: login.password
|
property: login.password
|
||||||
|
- secretKey: CF_TURNSTILE_SITEKEY
|
||||||
---
|
|
||||||
apiVersion: external-secrets.io/v1
|
|
||||||
kind: ExternalSecret
|
|
||||||
metadata:
|
|
||||||
name: gitea-recapcha-creds
|
|
||||||
spec:
|
|
||||||
refreshInterval: 1m
|
|
||||||
target:
|
|
||||||
name: gitea-recapcha-creds
|
|
||||||
deletionPolicy: Delete
|
|
||||||
template:
|
|
||||||
type: Opaque
|
|
||||||
data:
|
|
||||||
GITEA__service__HCAPTCHA_SITEKEY: |-
|
|
||||||
{{ .HCAPTCHA_SITEKEY }}
|
|
||||||
GITEA__service__HCAPTCHA_SECRET: |-
|
|
||||||
{{ .HCAPTCHA_SECRET }}
|
|
||||||
data:
|
|
||||||
- secretKey: HCAPTCHA_SITEKEY
|
|
||||||
sourceRef:
|
sourceRef:
|
||||||
storeRef:
|
storeRef:
|
||||||
name: vaultwarden-login
|
name: vaultwarden-login
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: 89c8d8d2-6b53-42c5-805f-38a341ef163e
|
key: e475b5ab-ea3c-48a5-bb4c-a6bc552fc064
|
||||||
property: login.username
|
property: fields[0].value
|
||||||
- secretKey: HCAPTCHA_SECRET
|
- secretKey: CF_TURNSTILE_SECRET
|
||||||
sourceRef:
|
sourceRef:
|
||||||
storeRef:
|
storeRef:
|
||||||
name: vaultwarden-login
|
name: vaultwarden-login
|
||||||
kind: ClusterSecretStore
|
kind: ClusterSecretStore
|
||||||
remoteRef:
|
remoteRef:
|
||||||
key: 89c8d8d2-6b53-42c5-805f-38a341ef163e
|
key: e475b5ab-ea3c-48a5-bb4c-a6bc552fc064
|
||||||
property: login.password
|
property: fields[1].value
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: ConfigMap
|
||||||
|
metadata:
|
||||||
|
name: llamacpp-cuda-config
|
||||||
|
data:
|
||||||
|
LLAMA_CACHE: /models
|
||||||
|
LLAMA_ARG_HOST: 0.0.0.0
|
||||||
|
LLAMA_ARG_PORT: "8080"
|
||||||
|
LLAMA_ARG_HF_REPO: "unsloth/gemma-4-12b-it-GGUF:Q6_K"
|
||||||
|
LLAMA_ARG_CTX_SIZE: "128000"
|
||||||
|
LLAMA_ARG_FLASH_ATTN: auto
|
||||||
|
LLAMA_ARG_FIT: "on"
|
||||||
@@ -0,0 +1,72 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: llamacpp-cuda
|
||||||
|
annotations:
|
||||||
|
reloader.stakater.com/auto: "true"
|
||||||
|
labels:
|
||||||
|
app: llamacpp-cuda
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: llamacpp-cuda
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: llamacpp-cuda
|
||||||
|
spec:
|
||||||
|
dnsPolicy: Default
|
||||||
|
runtimeClassName: nvidia
|
||||||
|
nodeSelector:
|
||||||
|
kubernetes.io/hostname: uk-desktop.tail2fe2d.ts.net
|
||||||
|
tolerations:
|
||||||
|
- key: workload
|
||||||
|
operator: Equal
|
||||||
|
value: desktop
|
||||||
|
effect: NoSchedule
|
||||||
|
containers:
|
||||||
|
- name: llamacpp
|
||||||
|
image: ghcr.io/ggml-org/llama.cpp:server-cuda-b9501
|
||||||
|
imagePullPolicy: IfNotPresent
|
||||||
|
envFrom:
|
||||||
|
- configMapRef:
|
||||||
|
name: llamacpp-cuda-config
|
||||||
|
env:
|
||||||
|
- name: HF_TOKEN
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: llamacpp-hf-token
|
||||||
|
key: token
|
||||||
|
optional: true
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
containerPort: 8080
|
||||||
|
protocol: TCP
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: 1
|
||||||
|
startupProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: http
|
||||||
|
failureThreshold: 180
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /health
|
||||||
|
port: http
|
||||||
|
failureThreshold: 3
|
||||||
|
periodSeconds: 10
|
||||||
|
timeoutSeconds: 5
|
||||||
|
volumeMounts:
|
||||||
|
- name: models
|
||||||
|
mountPath: /models
|
||||||
|
volumes:
|
||||||
|
- name: models
|
||||||
|
hostPath:
|
||||||
|
path: /data/llama.cpp/models
|
||||||
|
type: DirectoryOrCreate
|
||||||
@@ -3,6 +3,9 @@ kind: Kustomization
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
- app.yaml
|
- app.yaml
|
||||||
|
- configmap-cuda.yaml
|
||||||
- configmap.yaml
|
- configmap.yaml
|
||||||
|
- deployment-cuda.yaml
|
||||||
- deployment.yaml
|
- deployment.yaml
|
||||||
|
- service-cuda.yaml
|
||||||
- service.yaml
|
- service.yaml
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: llamacpp-cuda
|
||||||
|
labels:
|
||||||
|
app: llamacpp-cuda
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: llamacpp-cuda
|
||||||
|
ports:
|
||||||
|
- name: http
|
||||||
|
port: 8080
|
||||||
|
targetPort: http
|
||||||
|
protocol: TCP
|
||||||
@@ -15,14 +15,14 @@ resources:
|
|||||||
- service.yaml
|
- service.yaml
|
||||||
- ingress.yaml
|
- ingress.yaml
|
||||||
|
|
||||||
helmCharts:
|
# helmCharts:
|
||||||
- name: yacy
|
# - name: yacy
|
||||||
repo: https://gt.hexor.cy/api/packages/ab/helm
|
# repo: https://gt.hexor.cy/api/packages/ab/helm
|
||||||
version: 0.1.2
|
# version: 0.1.2
|
||||||
releaseName: yacy
|
# releaseName: yacy
|
||||||
namespace: n8n
|
# namespace: n8n
|
||||||
valuesFile: values-yacy.yaml
|
# valuesFile: values-yacy.yaml
|
||||||
includeCRDs: true
|
# includeCRDs: true
|
||||||
|
|
||||||
commonLabels:
|
commonLabels:
|
||||||
app.kubernetes.io/name: n8n
|
app.kubernetes.io/name: n8n
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ spec:
|
|||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
app: pasarguard
|
app: pasarguard
|
||||||
replicas: 1
|
replicas: 2
|
||||||
strategy:
|
strategy:
|
||||||
type: RollingUpdate
|
type: RollingUpdate
|
||||||
template:
|
template:
|
||||||
@@ -34,7 +34,7 @@ spec:
|
|||||||
mountPath: /templates/subscription
|
mountPath: /templates/subscription
|
||||||
containers:
|
containers:
|
||||||
- name: pasarguard-web
|
- name: pasarguard-web
|
||||||
image: pasarguard/panel:v5.0.1
|
image: pasarguard/panel:v5.0.3
|
||||||
imagePullPolicy: Always
|
imagePullPolicy: Always
|
||||||
envFrom:
|
envFrom:
|
||||||
- secretRef:
|
- secretRef:
|
||||||
@@ -50,6 +50,10 @@ spec:
|
|||||||
value: "/app/tls/tls.crt"
|
value: "/app/tls/tls.crt"
|
||||||
- name: UVICORN_SSL_KEYFILE
|
- name: UVICORN_SSL_KEYFILE
|
||||||
value: "/app/tls/tls.key"
|
value: "/app/tls/tls.key"
|
||||||
|
- name: UVICORN_PROXY_HEADERS
|
||||||
|
value: "true"
|
||||||
|
- name: FORWARDED_ALLOW_IPS
|
||||||
|
value: "*"
|
||||||
- name: CUSTOM_TEMPLATES_DIRECTORY
|
- name: CUSTOM_TEMPLATES_DIRECTORY
|
||||||
value: "/code/app/templates/"
|
value: "/code/app/templates/"
|
||||||
- name: SUBSCRIPTION_PAGE_TEMPLATE
|
- name: SUBSCRIPTION_PAGE_TEMPLATE
|
||||||
|
|||||||
@@ -66,11 +66,11 @@ ingress:
|
|||||||
|
|
||||||
resources:
|
resources:
|
||||||
requests:
|
requests:
|
||||||
cpu: 200m
|
cpu: 500m
|
||||||
memory: 512Mi
|
|
||||||
limits:
|
|
||||||
cpu: "1"
|
|
||||||
memory: 1Gi
|
memory: 1Gi
|
||||||
|
limits:
|
||||||
|
cpu: "3"
|
||||||
|
memory: 2Gi
|
||||||
|
|
||||||
nodeSelector:
|
nodeSelector:
|
||||||
kubernetes.io/hostname: master.tail2fe2d.ts.net
|
kubernetes.io/hostname: master.tail2fe2d.ts.net
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ kind: Kustomization
|
|||||||
helmCharts:
|
helmCharts:
|
||||||
- name: longhorn
|
- name: longhorn
|
||||||
repo: https://charts.longhorn.io
|
repo: https://charts.longhorn.io
|
||||||
version: 1.11.2
|
version: 1.12.0
|
||||||
releaseName: longhorn
|
releaseName: longhorn
|
||||||
namespace: longhorn
|
namespace: longhorn
|
||||||
valuesFile: values.yaml
|
valuesFile: values.yaml
|
||||||
|
|||||||
@@ -1,7 +1,54 @@
|
|||||||
|
global:
|
||||||
|
tolerations:
|
||||||
|
- key: "workload"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoExecute"
|
||||||
|
|
||||||
|
longhornManager:
|
||||||
|
tolerations:
|
||||||
|
- key: "workload"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoExecute"
|
||||||
|
|
||||||
|
longhornDriver:
|
||||||
|
tolerations:
|
||||||
|
- key: "workload"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoExecute"
|
||||||
|
|
||||||
longhornUI:
|
longhornUI:
|
||||||
replicas: 1
|
replicas: 1
|
||||||
|
tolerations:
|
||||||
|
- key: "workload"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoSchedule"
|
||||||
|
- key: "node.kubernetes.io/unreachable"
|
||||||
|
operator: "Exists"
|
||||||
|
effect: "NoExecute"
|
||||||
|
|
||||||
defaultSettings:
|
defaultSettings:
|
||||||
|
taintToleration: "workload=ai:NoSchedule; workload=desktop:NoSchedule; node.kubernetes.io/unreachable:NoSchedule; node.kubernetes.io/unreachable:NoExecute"
|
||||||
# Keep new instance-manager pods schedulable on nodes with high CPU requests.
|
# Keep new instance-manager pods schedulable on nodes with high CPU requests.
|
||||||
guaranteedInstanceManagerCPU: '{"v1":"6","v2":"6"}'
|
guaranteedInstanceManagerCPU: '{"v1":"6","v2":"6"}'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user