diff --git a/manifests/database.yaml b/manifests/database.yaml new file mode 100644 index 0000000..e86f8ce --- /dev/null +++ b/manifests/database.yaml @@ -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 diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml new file mode 100644 index 0000000..47ba508 --- /dev/null +++ b/manifests/deployment.yaml @@ -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" diff --git a/manifests/ingress.yaml b/manifests/ingress.yaml new file mode 100644 index 0000000..fce869c --- /dev/null +++ b/manifests/ingress.yaml @@ -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 diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml new file mode 100644 index 0000000..131512f --- /dev/null +++ b/manifests/kustomization.yaml @@ -0,0 +1,9 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization + +resources: + - namespace.yaml + - database.yaml + - service.yaml + - ingress.yaml + - deployment.yaml diff --git a/manifests/namespace.yaml b/manifests/namespace.yaml new file mode 100644 index 0000000..09a988f --- /dev/null +++ b/manifests/namespace.yaml @@ -0,0 +1,4 @@ +apiVersion: v1 +kind: Namespace +metadata: + name: gitea diff --git a/manifests/service.yaml b/manifests/service.yaml new file mode 100644 index 0000000..9029eee --- /dev/null +++ b/manifests/service.yaml @@ -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