bunkerweb/examples/gogs/kubernetes.yml
2022-10-19 17:37:13 +02:00

86 lines
2 KiB
YAML

apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ingress
annotations:
bunkerweb.io/AUTO_LETS_ENCRYPT: "yes"
bunkerweb.io/www.example.com_MAX_CLIENT_SIZE: "1G"
spec:
rules:
- host: www.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: svc-gogs
port:
number: 3000
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cfg-bunkerweb-gogs
annotations:
bunkerweb.io/CONFIG_TYPE: "modsec-crs"
bunkerweb.io/CONFIG_SITE: "www.example.com"
data:
gogs.conf: |
SecAction \
"id:900220,\
phase:1,\
nolog,\
pass,\
t:none,\
setvar:'tx.allowed_request_content_type=|application/x-www-form-urlencoded| |multipart/form-data| |multipart/related| |text/xml| |application/xml| |application/soap+xml| |application/x-amf| |application/json| |application/cloudevents+json| |application/cloudevents-batch+json| |application/octet-stream| |application/csp-report| |application/xss-auditor-report| |text/plain| |application/x-git-upload-pack-request| |application/x-git-receive-pack-request|'"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gogs
labels:
app: gogs
spec:
replicas: 1
selector:
matchLabels:
app: gogs
template:
metadata:
labels:
app: gogs
spec:
containers:
- name: gogs
image: gogs/gogs
volumeMounts:
- name: config
mountPath: /data/gogs/conf/app.ini
subPath: app.ini
volumes:
- name: config
configMap:
name: cfg-gogs
---
apiVersion: v1
kind: Service
metadata:
name: svc-gogs
spec:
selector:
app: gogs
ports:
- protocol: TCP
port: 3000
targetPort: 3000
---
apiVersion: v1
kind: ConfigMap
metadata:
name: cfg-gogs
data:
app.ini: |
[server]
EXTERNAL_URL = https://www.example.com/
DOMAIN = www.example.com