feat(manifests): Add k8s manifests for argo based deployment

This commit is contained in:
Tanguy Herbron 2023-06-30 23:22:44 +02:00
parent 1a1adb1998
commit 6bb2dc2d16
6 changed files with 120 additions and 0 deletions

30
manifests/database.yaml Normal file
View File

@ -0,0 +1,30 @@
kind: "postgresql"
apiVersion: "acid.zalan.do/v1"
metadata:
name: "gitea"
namespace: "gitea"
labels:
team: acid
spec:
teamId: "acid"
postgresql:
version: "15"
numberOfInstances: 1
volume:
size: "1Gi"
storageClass: "flat-storage-class"
users:
gitea: []
databases:
gitea: gitea
allowedSourceRanges:
# IP ranges to access your cluster go here
resources:
requests:
cpu: 100m
memory: 100Mi
limits:
cpu: 500m
memory: 500Mi

41
manifests/deployment.yaml Normal file
View File

@ -0,0 +1,41 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
namespace: gitea
spec:
replicas: 1
selector:
matchLabels:
app: gitea
template:
metadata:
labels:
app: gitea
spec:
hostname: gitea
subdomain: gitea
containers:
- name: gitea
image: gitea/server
ports:
- containerPort: 80
env:
- name: DB_PASSWORD
valueFrom:
secretKeyRef:
name: gitea.gitea.credentials.postgresql.acid.zalan.do
key: password
- name: SIGNUPS_ALLOWED
value: "true"
- name: DATABASE_URL
value: "postgresql://gitea:$(DB_PASSWORD)@gitea.gitea.svc.cluster.local:5432/gitea"
- name: ADMIN_TOKEN
valueFrom:
secretKeyRef:
name: gitea-admin
key: token
volumes:
- name: gitea-pv
hostPath:
path: "/mnt/gitea"

23
manifests/ingress.yaml Normal file
View File

@ -0,0 +1,23 @@
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: gitea-ingress
namespace: gitea
annotations:
kubernetes.io/ingress.class: "traefik"
spec:
tls:
- secretName: gitea-beta-tls
hosts:
- git.beta.halia.dev
rules:
- host: git.beta.halia.dev
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: gitea-svc
port:
number: 80

View File

@ -0,0 +1,9 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- namespace.yaml
- database.yaml
- service.yaml
- ingress.yaml
- deployment.yaml

4
manifests/namespace.yaml Normal file
View File

@ -0,0 +1,4 @@
apiVersion: v1
kind: Namespace
metadata:
name: gitea

13
manifests/service.yaml Normal file
View File

@ -0,0 +1,13 @@
apiVersion: v1
kind: Service
metadata:
name: gitea-svc
namespace: gitea
spec:
ports:
- name: http
port: 80
protocol: TCP
targetPort: 80
selector:
app: gitea