feat(networking): Deploy gitea on primary node to allow faster traffic
This commit is contained in:
parent
1ea885f030
commit
f74fc704b6
17
manifests/database-local-service.yaml
Normal file
17
manifests/database-local-service.yaml
Normal file
@ -0,0 +1,17 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
labels:
|
||||
cnpg.io/cluster: gitea-db
|
||||
name: gitea-db-local
|
||||
namespace: gitea
|
||||
spec:
|
||||
internalTrafficPolicy: Local
|
||||
ports:
|
||||
- name: postgres
|
||||
port: 5432
|
||||
protocol: TCP
|
||||
targetPort: 5432
|
||||
selector:
|
||||
cnpg.io/cluster: gitea-db
|
||||
cnpg.io/instanceRole: primary
|
@ -51,3 +51,11 @@ spec:
|
||||
|
||||
monitoring:
|
||||
enablePodMonitor: true
|
||||
|
||||
topologySpreadConstraints:
|
||||
- maxSkew: 1
|
||||
topologyKey: zone
|
||||
whenUnsatisfiable: DoNotSchedule
|
||||
labelSelector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: gitea-db
|
||||
|
@ -15,6 +15,20 @@ spec:
|
||||
spec:
|
||||
hostname: gitea
|
||||
subdomain: gitea
|
||||
affinity:
|
||||
podAffinity:
|
||||
requiredDuringSchedulingIgnoredDuringExecution:
|
||||
- labelSelector:
|
||||
matchExpressions:
|
||||
- key: cnpg.io/cluster
|
||||
operator: In
|
||||
values:
|
||||
- gitea-db
|
||||
- key: cnpg.io/instanceRole
|
||||
operator: In
|
||||
values:
|
||||
- primary
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: gitea
|
||||
image: gitea/gitea:1.23.7
|
||||
@ -24,7 +38,7 @@ spec:
|
||||
- name: GITEA__database__DB_TYPE
|
||||
value: "postgres"
|
||||
- name: GITEA__database__HOST
|
||||
value: "gitea-db-rw.gitea.svc.cluster.local:5432"
|
||||
value: "gitea-db-local.gitea.svc.cluster.local:5432"
|
||||
- name: GITEA__database__NAME
|
||||
value: "gitea"
|
||||
- name: GITEA__database__SSL_MODE
|
||||
|
@ -5,6 +5,7 @@ resources:
|
||||
- namespace.yaml
|
||||
- secrets.yaml
|
||||
- database.yaml
|
||||
- database-local-service.yaml
|
||||
- database-backup.yaml
|
||||
- service.yaml
|
||||
- servicemonitor.yaml
|
||||
|
Loading…
x
Reference in New Issue
Block a user