Files
k3s-cluster/gitea/gitea.yaml
Roger Oriol d5d0958502 init cluster
2025-11-02 18:13:46 +01:00

177 lines
3.4 KiB
YAML

---
apiVersion: v1
kind: Namespace
metadata:
name: gitea
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-data
namespace: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
namespace: gitea
labels:
app: gitea
spec:
replicas: 1
selector:
matchLabels:
app: gitea
template:
metadata:
labels:
app: gitea
spec:
nodeSelector:
kubernetes.io/arch: arm64
containers:
- name: gitea
image: gitea/gitea:1.24.6
env:
- name: USER_UID
value: "1000"
- name: USER_GID
value: "1000"
ports:
- containerPort: 3000
name: http
protocol: TCP
- containerPort: 22
name: ssh
protocol: TCP
volumeMounts:
- name: gitea-data
mountPath: /data
- name: timezone
mountPath: /etc/timezone
readOnly: true
- name: localtime
mountPath: /etc/localtime
readOnly: true
volumes:
- name: gitea-data
persistentVolumeClaim:
claimName: gitea-data
- name: timezone
hostPath:
path: /etc/timezone
type: File
- name: localtime
hostPath:
path: /etc/localtime
type: File
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: gitea-runner-data
namespace: gitea
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
name: gitea-runner-config
namespace: gitea
data:
GITEA_INSTANCE_URL: "http://gitea.rogi.casa"
---
apiVersion: v1
kind: Secret
metadata:
name: gitea-runner-secret
namespace: gitea
type: Opaque
stringData:
GITEA_RUNNER_REGISTRATION_TOKEN: "BqkIGoAiwSYUFm2CPXlvvKAdSw5fl6ayCAb60zsM"
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea-runner
namespace: gitea
labels:
app: gitea-runner
spec:
replicas: 1
selector:
matchLabels:
app: gitea-runner
template:
metadata:
labels:
app: gitea-runner
spec:
nodeSelector:
kubernetes.io/arch: arm64
containers:
- name: gitea-runner
image: vegardit/gitea-act-runner:0.1.6
env:
- name: GITEA_INSTANCE_URL
valueFrom:
configMapKeyRef:
name: gitea-runner-config
key: GITEA_INSTANCE_URL
- name: GITEA_RUNNER_REGISTRATION_TOKEN
valueFrom:
secretKeyRef:
name: gitea-runner-secret
key: GITEA_RUNNER_REGISTRATION_TOKEN
- name: GITEA_RUNNER_UID
value: "1000"
- name: GITEA_RUNNER_GID
value: "100"
volumeMounts:
- name: docker-socket
mountPath: /var/run/docker.sock
- name: runner-data
mountPath: /data
volumes:
- name: docker-socket
hostPath:
path: /var/run/docker.sock
type: Socket
- name: runner-data
persistentVolumeClaim:
claimName: gitea-runner-data
---
apiVersion: v1
kind: Service
metadata:
name: gitea
namespace: gitea
labels:
app: gitea
spec:
type: ClusterIP
ports:
- name: http
port: 80
targetPort: 3000
protocol: TCP
- name: ssh
port: 22
targetPort: 22
protocol: TCP
selector:
app: gitea