1
0
Fork 0
distrust-stack/kustomizations/forgejo/resources.yaml

179 lines
4.2 KiB
YAML
Raw Permalink Normal View History

2023-05-16 01:51:42 +00:00
apiVersion: v1
kind: Service
metadata:
name: forgejo
labels:
app: forgejo
spec:
ports:
- name: http
port: 80
2023-05-16 04:03:01 +00:00
targetPort: http
- name: ssh
port: 22
targetPort: ssh
2023-05-16 01:51:42 +00:00
selector:
app: forgejo
type: ClusterIP
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: forgejo
labels:
app: forgejo
spec:
replicas: 1
selector:
matchLabels:
app: forgejo
serviceName: forgejo
template:
metadata:
labels:
app: forgejo
spec:
securityContext:
runAsNonRoot: true
runAsUser: 1000
runAsGroup: 1000
2023-05-17 05:02:04 +00:00
fsGroup: 1000
fsGroupChangePolicy: OnRootMismatch
seccompProfile:
type: RuntimeDefault
2023-05-16 01:51:42 +00:00
initContainers:
2023-05-17 05:02:04 +00:00
- name: forgejo-ensure-directories
image: codeberg.org/forgejo/forgejo:1.20.5-0
2023-05-17 05:02:04 +00:00
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
command: ["sh"]
args:
- -c
- |-
mkdir -p /data/git/.ssh
mkdir -p /data/gitea
chmod go-rwx /data/git/.ssh
chmod go-rwx /data/gitea
volumeMounts:
- name: forgejo-data
mountPath: /data
2023-05-16 01:51:42 +00:00
- name: config-templater
image: codeberg.org/forgejo/forgejo:1.20.5-0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
2023-05-16 01:51:42 +00:00
command: ["environment-to-ini"]
args:
- --config
- /input/app_template.ini
- --out
- /output/app.ini
volumeMounts:
- name: forgejo-config-template
mountPath: /input
- name: forgejo-config
mountPath: /output
- name: forgejo-migrate
image: codeberg.org/forgejo/forgejo:1.20.5-0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
2023-05-16 01:51:42 +00:00
command: ["forgejo"]
args:
- -c
- /etc/forgejo/app.ini
- migrate
volumeMounts:
- name: forgejo-data
mountPath: /data
- name: forgejo-config
mountPath: /etc/forgejo
- name: forgejo-oidc
image: codeberg.org/forgejo/forgejo:1.20.5-0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
2023-05-16 01:51:42 +00:00
command: ["sh"]
args:
- -c
- >-
forgejo -c /etc/forgejo/app.ini admin auth add-oauth
--name $(AUTH_PROVIDER_NAME)
--provider openidConnect
--key $(AUTH_PROVIDER_KEY)
--secret $(AUTH_PROVIDER_SECRET)
--auto-discover-url $(AUTH_PROVIDER_URL)
|| true
volumeMounts:
- name: forgejo-data
mountPath: /data
- name: forgejo-config
mountPath: /etc/forgejo
containers:
- name: forgejo-web
image: codeberg.org/forgejo/forgejo:1.20.5-0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
2023-05-16 01:51:42 +00:00
command: ["forgejo"]
args:
- -c
- /etc/forgejo/app.ini
- web
ports:
- containerPort: 8080
name: http
volumeMounts:
- name: forgejo-data
mountPath: /data
- name: forgejo-config
mountPath: /etc/forgejo
2023-05-16 04:03:01 +00:00
- name: forgejo-ssh
image: codeberg.org/forgejo/forgejo:1.20.5-0
securityContext:
allowPrivilegeEscalation: false
capabilities:
drop:
- ALL
2023-05-16 04:03:01 +00:00
command: ["/usr/sbin/sshd"]
args:
- -D
- -e
- -p
- "2222"
- -o
- PidFile=/tmp/sshd.pid
ports:
- containerPort: 2222
name: ssh
volumeMounts:
- name: forgejo-data
mountPath: /data
- name: forgejo-config
mountPath: /etc/forgejo
2023-05-16 01:51:42 +00:00
volumes:
- name: forgejo-config
emptyDir: {}
- name: forgejo-config-template
configMap:
name: forgejo-config-template
volumeClaimTemplates:
- metadata:
name: forgejo-data
spec:
accessModes: ["ReadWriteOnce"]
resources:
requests:
storage: 10Gi