stabilize prod statefulset gitops drift

This commit is contained in:
Prodiglagla
2026-06-14 12:41:42 +08:00
parent 5932f37fc0
commit a89e26b839
6 changed files with 85 additions and 5 deletions
+21
View File
@@ -0,0 +1,21 @@
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: ircs-prod-migrator
namespace: argocd
labels:
app.kubernetes.io/part-of: ircs
environment: prod
spec:
project: default
source:
repoURL: https://gitea.mnnu.eu.org/gitea-admin/ircs-prod-config.git
targetRevision: main
path: ircs-prod/migration
destination:
server: https://kubernetes.default.svc
namespace: ircs-prod
syncPolicy:
syncOptions:
- CreateNamespace=true
- ServerSideApply=true
-1
View File
@@ -17,7 +17,6 @@ resources:
- manifests/interaction-service.yaml - manifests/interaction-service.yaml
- manifests/magnet-service.yaml - manifests/magnet-service.yaml
- manifests/metadata-worker.yaml - manifests/metadata-worker.yaml
- manifests/migrator-job.yaml
- manifests/normalization-worker.yaml - manifests/normalization-worker.yaml
- manifests/notification-worker.yaml - manifests/notification-worker.yaml
- manifests/observability-monitoring.yaml - manifests/observability-monitoring.yaml
+24 -2
View File
@@ -51,9 +51,15 @@ spec:
app.kubernetes.io/part-of: ircs app.kubernetes.io/part-of: ircs
environment: prod environment: prod
spec: spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
initContainers: initContainers:
- name: install-plugins - name: install-plugins
image: alpine:3.19 image: alpine:3.19
imagePullPolicy: IfNotPresent
command: command:
- sh - sh
- -c - -c
@@ -87,6 +93,8 @@ spec:
volumeMounts: volumeMounts:
- name: plugins-volume - name: plugins-volume
mountPath: /plugins mountPath: /plugins
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
containers: containers:
- name: elasticsearch - name: elasticsearch
image: docker.elastic.co/elasticsearch/elasticsearch:9.1.4 image: docker.elastic.co/elasticsearch/elasticsearch:9.1.4
@@ -94,8 +102,10 @@ spec:
ports: ports:
- name: http - name: http
containerPort: 9200 containerPort: 9200
protocol: TCP
- name: transport - name: transport
containerPort: 9300 containerPort: 9300
protocol: TCP
env: env:
- name: discovery.type - name: discovery.type
value: single-node value: single-node
@@ -115,31 +125,43 @@ spec:
port: http port: http
failureThreshold: 60 failureThreshold: 60
periodSeconds: 10 periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
readinessProbe: readinessProbe:
tcpSocket: tcpSocket:
port: http port: http
failureThreshold: 3
periodSeconds: 10 periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
livenessProbe: livenessProbe:
tcpSocket: tcpSocket:
port: http port: http
failureThreshold: 3
periodSeconds: 30 periodSeconds: 30
successThreshold: 1
timeoutSeconds: 1
resources: resources:
requests: requests:
cpu: 100m cpu: 100m
memory: 1Gi memory: 1Gi
limits: limits:
cpu: 1000m cpu: "1"
memory: 2Gi memory: 2Gi
volumeMounts: volumeMounts:
- name: elasticsearch-data - name: elasticsearch-data
mountPath: /usr/share/elasticsearch/data mountPath: /usr/share/elasticsearch/data
- name: plugins-volume - name: plugins-volume
mountPath: /usr/share/elasticsearch/plugins mountPath: /usr/share/elasticsearch/plugins
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumes: volumes:
- name: plugins-volume - name: plugins-volume
emptyDir: {} emptyDir: {}
volumeClaimTemplates: volumeClaimTemplates:
- metadata: - apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: elasticsearch-data name: elasticsearch-data
labels: labels:
app: elasticsearch app: elasticsearch
+19 -1
View File
@@ -48,6 +48,11 @@ spec:
app.kubernetes.io/part-of: ircs app.kubernetes.io/part-of: ircs
environment: prod environment: prod
spec: spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
containers: containers:
- name: postgres - name: postgres
image: postgres:18-alpine image: postgres:18-alpine
@@ -55,6 +60,7 @@ spec:
ports: ports:
- name: postgres - name: postgres
containerPort: 5432 containerPort: 5432
protocol: TCP
env: env:
- name: POSTGRES_DB - name: POSTGRES_DB
value: ircs value: ircs
@@ -72,14 +78,22 @@ spec:
command: ["pg_isready", "-U", "postgres", "-d", "ircs"] command: ["pg_isready", "-U", "postgres", "-d", "ircs"]
failureThreshold: 30 failureThreshold: 30
periodSeconds: 5 periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
readinessProbe: readinessProbe:
exec: exec:
command: ["pg_isready", "-U", "postgres", "-d", "ircs"] command: ["pg_isready", "-U", "postgres", "-d", "ircs"]
failureThreshold: 3
periodSeconds: 10 periodSeconds: 10
successThreshold: 1
timeoutSeconds: 1
livenessProbe: livenessProbe:
exec: exec:
command: ["pg_isready", "-U", "postgres", "-d", "ircs"] command: ["pg_isready", "-U", "postgres", "-d", "ircs"]
failureThreshold: 3
periodSeconds: 30 periodSeconds: 30
successThreshold: 1
timeoutSeconds: 1
resources: resources:
requests: requests:
cpu: 100m cpu: 100m
@@ -90,8 +104,12 @@ spec:
volumeMounts: volumeMounts:
- name: postgres-data - name: postgres-data
mountPath: /var/lib/postgresql/data mountPath: /var/lib/postgresql/data
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeClaimTemplates: volumeClaimTemplates:
- metadata: - apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-data name: postgres-data
labels: labels:
app: postgres app: postgres
+17 -1
View File
@@ -51,6 +51,11 @@ spec:
app.kubernetes.io/part-of: ircs app.kubernetes.io/part-of: ircs
environment: prod environment: prod
spec: spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
schedulerName: default-scheduler
securityContext: {}
terminationGracePeriodSeconds: 30
containers: containers:
- name: rabbitmq - name: rabbitmq
image: rabbitmq:4.1.8-management image: rabbitmq:4.1.8-management
@@ -58,8 +63,10 @@ spec:
ports: ports:
- name: amqp - name: amqp
containerPort: 5672 containerPort: 5672
protocol: TCP
- name: management - name: management
containerPort: 15672 containerPort: 15672
protocol: TCP
env: env:
- name: RABBITMQ_DEFAULT_USER - name: RABBITMQ_DEFAULT_USER
value: admin value: admin
@@ -73,16 +80,21 @@ spec:
command: ["rabbitmq-diagnostics", "-q", "ping"] command: ["rabbitmq-diagnostics", "-q", "ping"]
failureThreshold: 30 failureThreshold: 30
periodSeconds: 10 periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10 timeoutSeconds: 10
readinessProbe: readinessProbe:
exec: exec:
command: ["rabbitmq-diagnostics", "-q", "ping"] command: ["rabbitmq-diagnostics", "-q", "ping"]
failureThreshold: 3
periodSeconds: 10 periodSeconds: 10
successThreshold: 1
timeoutSeconds: 10 timeoutSeconds: 10
livenessProbe: livenessProbe:
exec: exec:
command: ["rabbitmq-diagnostics", "-q", "ping"] command: ["rabbitmq-diagnostics", "-q", "ping"]
failureThreshold: 3
periodSeconds: 30 periodSeconds: 30
successThreshold: 1
timeoutSeconds: 10 timeoutSeconds: 10
resources: resources:
requests: requests:
@@ -94,8 +106,12 @@ spec:
volumeMounts: volumeMounts:
- name: rabbitmq-data - name: rabbitmq-data
mountPath: /var/lib/rabbitmq mountPath: /var/lib/rabbitmq
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeClaimTemplates: volumeClaimTemplates:
- metadata: - apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rabbitmq-data name: rabbitmq-data
labels: labels:
app: rabbitmq app: rabbitmq
+4
View File
@@ -0,0 +1,4 @@
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../core/manifests/migrator-job.yaml