diff --git a/apps/ircs-prod-migrator-application.yaml b/apps/ircs-prod-migrator-application.yaml new file mode 100644 index 0000000..12f82bb --- /dev/null +++ b/apps/ircs-prod-migrator-application.yaml @@ -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 diff --git a/ircs-prod/core/kustomization.yaml b/ircs-prod/core/kustomization.yaml index eea08bb..13a93aa 100644 --- a/ircs-prod/core/kustomization.yaml +++ b/ircs-prod/core/kustomization.yaml @@ -17,7 +17,6 @@ resources: - manifests/interaction-service.yaml - manifests/magnet-service.yaml - manifests/metadata-worker.yaml - - manifests/migrator-job.yaml - manifests/normalization-worker.yaml - manifests/notification-worker.yaml - manifests/observability-monitoring.yaml diff --git a/ircs-prod/core/manifests/elasticsearch.yaml b/ircs-prod/core/manifests/elasticsearch.yaml index 885f0fe..3fa3717 100644 --- a/ircs-prod/core/manifests/elasticsearch.yaml +++ b/ircs-prod/core/manifests/elasticsearch.yaml @@ -51,9 +51,15 @@ spec: app.kubernetes.io/part-of: ircs environment: prod spec: + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 initContainers: - name: install-plugins image: alpine:3.19 + imagePullPolicy: IfNotPresent command: - sh - -c @@ -87,6 +93,8 @@ spec: volumeMounts: - name: plugins-volume mountPath: /plugins + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File containers: - name: elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:9.1.4 @@ -94,8 +102,10 @@ spec: ports: - name: http containerPort: 9200 + protocol: TCP - name: transport containerPort: 9300 + protocol: TCP env: - name: discovery.type value: single-node @@ -115,31 +125,43 @@ spec: port: http failureThreshold: 60 periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 readinessProbe: tcpSocket: port: http + failureThreshold: 3 periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 livenessProbe: tcpSocket: port: http + failureThreshold: 3 periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 1 resources: requests: cpu: 100m memory: 1Gi limits: - cpu: 1000m + cpu: "1" memory: 2Gi volumeMounts: - name: elasticsearch-data mountPath: /usr/share/elasticsearch/data - name: plugins-volume mountPath: /usr/share/elasticsearch/plugins + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File volumes: - name: plugins-volume emptyDir: {} volumeClaimTemplates: - - metadata: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: name: elasticsearch-data labels: app: elasticsearch diff --git a/ircs-prod/core/manifests/postgres.yaml b/ircs-prod/core/manifests/postgres.yaml index f14e1c2..8277bfa 100644 --- a/ircs-prod/core/manifests/postgres.yaml +++ b/ircs-prod/core/manifests/postgres.yaml @@ -48,6 +48,11 @@ spec: app.kubernetes.io/part-of: ircs environment: prod spec: + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 containers: - name: postgres image: postgres:18-alpine @@ -55,6 +60,7 @@ spec: ports: - name: postgres containerPort: 5432 + protocol: TCP env: - name: POSTGRES_DB value: ircs @@ -72,14 +78,22 @@ spec: command: ["pg_isready", "-U", "postgres", "-d", "ircs"] failureThreshold: 30 periodSeconds: 5 + successThreshold: 1 + timeoutSeconds: 1 readinessProbe: exec: command: ["pg_isready", "-U", "postgres", "-d", "ircs"] + failureThreshold: 3 periodSeconds: 10 + successThreshold: 1 + timeoutSeconds: 1 livenessProbe: exec: command: ["pg_isready", "-U", "postgres", "-d", "ircs"] + failureThreshold: 3 periodSeconds: 30 + successThreshold: 1 + timeoutSeconds: 1 resources: requests: cpu: 100m @@ -90,8 +104,12 @@ spec: volumeMounts: - name: postgres-data mountPath: /var/lib/postgresql/data + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File volumeClaimTemplates: - - metadata: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: name: postgres-data labels: app: postgres diff --git a/ircs-prod/core/manifests/rabbitmq.yaml b/ircs-prod/core/manifests/rabbitmq.yaml index 0cd9085..f65cc49 100644 --- a/ircs-prod/core/manifests/rabbitmq.yaml +++ b/ircs-prod/core/manifests/rabbitmq.yaml @@ -51,6 +51,11 @@ spec: app.kubernetes.io/part-of: ircs environment: prod spec: + dnsPolicy: ClusterFirst + restartPolicy: Always + schedulerName: default-scheduler + securityContext: {} + terminationGracePeriodSeconds: 30 containers: - name: rabbitmq image: rabbitmq:4.1.8-management @@ -58,8 +63,10 @@ spec: ports: - name: amqp containerPort: 5672 + protocol: TCP - name: management containerPort: 15672 + protocol: TCP env: - name: RABBITMQ_DEFAULT_USER value: admin @@ -73,16 +80,21 @@ spec: command: ["rabbitmq-diagnostics", "-q", "ping"] failureThreshold: 30 periodSeconds: 10 + successThreshold: 1 timeoutSeconds: 10 readinessProbe: exec: command: ["rabbitmq-diagnostics", "-q", "ping"] + failureThreshold: 3 periodSeconds: 10 + successThreshold: 1 timeoutSeconds: 10 livenessProbe: exec: command: ["rabbitmq-diagnostics", "-q", "ping"] + failureThreshold: 3 periodSeconds: 30 + successThreshold: 1 timeoutSeconds: 10 resources: requests: @@ -94,8 +106,12 @@ spec: volumeMounts: - name: rabbitmq-data mountPath: /var/lib/rabbitmq + terminationMessagePath: /dev/termination-log + terminationMessagePolicy: File volumeClaimTemplates: - - metadata: + - apiVersion: v1 + kind: PersistentVolumeClaim + metadata: name: rabbitmq-data labels: app: rabbitmq diff --git a/ircs-prod/migration/kustomization.yaml b/ircs-prod/migration/kustomization.yaml new file mode 100644 index 0000000..01b3531 --- /dev/null +++ b/ircs-prod/migration/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - ../core/manifests/migrator-job.yaml