Browse Source

feat: add gitea

pull/3/head
Karan Sharma 2 years ago
parent
commit
b4cc4a6e42
  1. 11
      k8s/gitea/Makefile
  2. 40
      k8s/gitea/base/gitea/gitea-deployment.yml
  3. 22
      k8s/gitea/base/gitea/gitea-nodeport-service.yml
  4. 22
      k8s/gitea/base/gitea/gitea-service.yml
  5. 7
      k8s/gitea/base/kustomization.yml
  6. 4
      k8s/gitea/base/namespace.yml
  7. 13
      k8s/gitea/base/patches/add-config-volume.yml
  8. 50
      k8s/gitea/kubekutr.yml
  9. 2
      k8s/ip/base/nginx-ip/nginx-deployment.yml
  10. 2
      k8s/unbound/base/unbound/unbound-deployment.yml
  11. 2
      k8s/unbound/kubekutr.yml

11
k8s/gitea/Makefile

@ -0,0 +1,11 @@
.PHONY: scaffold
scaffold:
@kubekutr -c kubekutr.yml scaffold -o .
.PHONY: build-k8s-local
build-k8s-local: scaffold
@kustomize build base --load_restrictor none
.PHONY: deploy-k8s-local
deploy-k8s-local: build-k8s-local
kustomize build base/ --load_restrictor none | kubectl apply -f -

40
k8s/gitea/base/gitea/gitea-deployment.yml

@ -0,0 +1,40 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
labels:
service: gitea
tier: web
spec:
replicas: 1
selector:
matchLabels:
service: gitea
tier: web
template:
metadata:
labels:
service: gitea
tier: web
spec:
containers:
- name: gitea
image: gitea/gitea:1.11
ports:
- containerPort: 3000
name: web-port
- containerPort: 22
name: ssh-port
resources:
requests:
memory: 150Mi
cpu: 200m
limits:
memory: 350Mi
cpu: 400m
volumeMounts:
- mountPath: /data
name: data
nodeSelector:
kubernetes.io/arch: amd64

22
k8s/gitea/base/gitea/gitea-nodeport-service.yml

@ -0,0 +1,22 @@
---
apiVersion: v1
kind: Service
metadata:
name: gitea-nodeport
labels:
service: gitea
spec:
ports:
- port: 3000
name: web
targetPort: web-port
nodePort: 30300
protocol: TCP
- port: 22
name: ssh
targetPort: ssh-port
nodePort: 30222
protocol: TCP
type: NodePort
selector:
service: gitea

22
k8s/gitea/base/gitea/gitea-service.yml

@ -0,0 +1,22 @@
---
apiVersion: v1
kind: Service
metadata:
name: gitea
labels:
service: gitea
tier: web
spec:
ports:
- port: 3000
name: web-port
targetPort: web-port
protocol: TCP
- port: 22
name: ssh-port
targetPort: ssh-port
protocol: TCP
type: ClusterIP
selector:
service: gitea
tier: web

7
k8s/gitea/base/kustomization.yml

@ -0,0 +1,7 @@
namespace: gitea
resources:
- namespace.yml
- gitea/gitea-deployment.yml
- gitea/gitea-nodeport-service.yml
patchesStrategicMerge:
- patches/add-config-volume.yml

4
k8s/gitea/base/namespace.yml

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

13
k8s/gitea/base/patches/add-config-volume.yml

@ -0,0 +1,13 @@
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: gitea
spec:
template:
spec:
volumes:
- name: data
hostPath:
path: "/data/gitea"
type: Directory

50
k8s/gitea/kubekutr.yml

@ -0,0 +1,50 @@
workloads:
- name: gitea
deployments:
- name: gitea
replicas: 1
labels:
- name: 'service: gitea'
- name: 'tier: web'
nodeSelector:
- name: 'kubernetes.io/arch: amd64'
containers:
- name: gitea
createService: true # will create nodeport
image: 'gitea/gitea:1.11'
ports:
- name: web-port
port: 3000
- name: ssh-port
port: 22
cpuLimits: 400m
memoryLimits: 350Mi
cpuRequests: 200m
memoryRequests: 150Mi
# envVars:
# - name: "USER_UID"
# value: "1000"
# - name: "USER_GID"
# value: "1000"
volumeMounts:
- name: data
mountPath: "/data"
services:
- name: gitea-nodeport
type: NodePort
ports:
- name: web
port: 3000
targetPort: web-port
nodePort: 30300
protocol: TCP
- name: ssh
port: 22
targetPort: ssh-port
nodePort: 30222
protocol: TCP
labels:
- name: 'service: gitea'
selectors:
- name: 'service: gitea'

2
k8s/ip/base/nginx-ip/nginx-deployment.yml

@ -38,4 +38,4 @@ spec:
name: nginxconfig-dir
volumes:
- name: app-conf-dir
- name: nginxconfig-dir
- name: nginxconfig-dir

2
k8s/unbound/base/unbound/unbound-deployment.yml

@ -7,7 +7,7 @@ metadata:
service: unbound
tier: dns
spec:
replicas: 2
replicas: 1
selector:
matchLabels:
service: unbound

2
k8s/unbound/kubekutr.yml

@ -2,7 +2,7 @@ workloads:
- name: unbound
deployments:
- name: unbound
replicas: 2
replicas: 1
labels:
- name: 'service: unbound'
- name: 'tier: dns'

Loading…
Cancel
Save