1
0
Fork 0
home-stack-kustomize/kustomize/bases/gitea/gitea-deployment.yaml

122 lines
2.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
labels:
app.kubernetes.io/name: gitea
spec:
replicas: 1 # gitea doesn't handle HA well
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: gitea
template:
metadata:
labels:
app.kubernetes.io/name: gitea
spec:
containers:
- name: gitea
image: gitea/gitea
env:
- name: GITEA__SERVER__ROOT_URL
value: https://${GITEA_EXTERNAL_HOST}
- name: GITEA__WEBHOOK_ALLOWED_HOST_LIST
value: ${DRONE_EXTERNAL_HOST}
- name: GITEA__DEFAULT__APP_NAME
value: Badjware's code stash
- name: GITEA__SERVICE__DISABLE_REGISTRATION
value: "yes"
- name: GITEA__SERVER__SSH_DOMAIN
value: ${GITEA_EXTERNAL_HOST}
- name: GITEA__SERVER__SSH_PORT
value: "30022"
- name: GITEA__METRICS__ENABLED
value: "true"
- name: GITEA__REPOSITORY__DISABLED_REPO_UNITS
value: repo.wiki
- name: GITEA__REPOSITORY__DEFAULT_REPO_UNITS
value: repo.code,repo.releases
ports:
- name: http
containerPort: 3000
- name: ssh
containerPort: 22
resources:
requests:
cpu: 250m
memory: 500Mi
limits:
cpu: 250m
memory: 500Mi
volumeMounts:
- name: gitea-pv
mountPath: /data
volumes:
- name: gitea-pv
persistentVolumeClaim:
claimName: gitea-pvc
# ---
# apiVersion: v1
# kind: PersistentVolume
# metadata:
# name: gitea-data-nfs
# labels:
# app.kubernetes.io/name: gitea
# spec:
# accessModes:
# - ReadWriteMany
# capacity:
# storage: 100Mi
# nfs:
# server: nfs-localhost
# path: /gitea
# mountOptions: ["vers=4"]
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-pvc
labels:
app.kubernetes.io/name: gitea
spec:
# storageClassName: ""
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
# selector:
# matchLabels:
# app.kubernetes.io/name: gitea
---
apiVersion: v1
kind: Service
metadata:
name: gitea
labels:
app.kubernetes.io/name: gitea
monitor: prometheus
spec:
selector:
app.kubernetes.io/name: gitea
ports:
- name: http
port: 80
targetPort: http
---
apiVersion: v1
kind: Service
metadata:
name: gitea-ssh
labels:
app.kubernetes.io/name: gitea
spec:
type: NodePort
selector:
app.kubernetes.io/name: gitea
ports:
- port: 22
targetPort: ssh
nodePort: 30022