125 lines
3.0 KiB
YAML
125 lines
3.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: gitea
|
|
labels:
|
|
app.kubernetes.io/name: gitea
|
|
spec:
|
|
replicas: 1 # replica count must be set to 1 in database is sqlite
|
|
selector:
|
|
matchLabels:
|
|
app.kubernetes.io/name: gitea
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app.kubernetes.io/name: gitea
|
|
spec:
|
|
containers:
|
|
- name: gitea
|
|
image: gitea/gitea
|
|
env:
|
|
# - name: INSTALL_LOCK
|
|
# value: "yes"
|
|
- name: DISABLE_REGISTRATION
|
|
value: "yes"
|
|
- name: APP_NAME
|
|
value: Badjware's code stash
|
|
- name: RUN_MODE
|
|
value: prod
|
|
- name: ROOT_URL
|
|
value: https://${GITEA_EXTERNAL_HOST}
|
|
- name: SSH_DOMAIN
|
|
value: ${GITEA_EXTERNAL_HOST}
|
|
- name: GITEA__METRICS__ENABLED
|
|
value: "true"
|
|
# - name: DB_TYPE
|
|
# value: postgres
|
|
# - name: DB_HOST
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: host
|
|
# - name: DB_NAME
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: database
|
|
# - name: DB_USER
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: username
|
|
# - name: DB_PASSWD
|
|
# valueFrom:
|
|
# secretKeyRef:
|
|
# name: postgres-credentials-secret
|
|
# key: password
|
|
ports:
|
|
- name: http
|
|
containerPort: 3000
|
|
- name: ssh
|
|
containerPort: 22
|
|
resources:
|
|
requests:
|
|
cpu: 500m
|
|
memory: 1Gi
|
|
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
|
|
protocol: TCP
|
|
port: 80
|
|
targetPort: http
|
|
- name: ssh
|
|
protocol: TCP
|
|
port: 22
|
|
targetPort: ssh |