From 212b05f6cb4b7ed902c12f92fa9dff1403f7d6bd Mon Sep 17 00:00:00 2001 From: Florian Date: Mon, 12 Oct 2026 14:32:51 +0200 Subject: [PATCH] Local developoment --- backend-api-internal/deployment.yaml | 7 +- backend-api/deployment.yaml | 7 +- backend-pull-notifications/deployment.yaml | 71 +++++++++++++++++++ .../service-internal.yaml | 14 ++++ .../service-metrics.yaml | 15 ++++ backend-push-notifications/deployment.yaml | 7 +- .../deployment.yaml | 5 +- service-royalroad-chapters/deployment.yaml | 7 +- 8 files changed, 114 insertions(+), 19 deletions(-) create mode 100644 backend-pull-notifications/deployment.yaml create mode 100644 backend-pull-notifications/service-internal.yaml create mode 100644 backend-pull-notifications/service-metrics.yaml diff --git a/backend-api-internal/deployment.yaml b/backend-api-internal/deployment.yaml index 16f2adf..3d37151 100644 --- a/backend-api-internal/deployment.yaml +++ b/backend-api-internal/deployment.yaml @@ -13,8 +13,6 @@ spec: labels: app: backend-api-internal spec: - imagePullSecrets: - - name: ghcr-secret initContainers: - name: wait-for-mysql image: busybox @@ -50,7 +48,8 @@ spec: mountPath: /etc/secrets containers: - name: backend-api-internal - image: ghcr.io/gansejunge/app-notifications-backend-api-internal:19 + image: app-notifications-backend-api-internal:1 + imagePullPolicy: Never ports: - containerPort: 8101 env: @@ -59,7 +58,7 @@ spec: - name: DB_HOST value: "mysql.app-notifications.svc.cluster.local" - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" volumeMounts: - name: writable-secrets mountPath: /etc/secrets diff --git a/backend-api/deployment.yaml b/backend-api/deployment.yaml index 9b5d1b5..b14ab0e 100644 --- a/backend-api/deployment.yaml +++ b/backend-api/deployment.yaml @@ -13,8 +13,6 @@ spec: labels: app: backend-api spec: - imagePullSecrets: - - name: ghcr-secret initContainers: - name: wait-for-mysql image: busybox @@ -50,14 +48,15 @@ spec: mountPath: /etc/secrets containers: - name: backend-api - image: ghcr.io/gansejunge/app-notifications-backend-api:30 + image: app-notifications-backend-api:1 + imagePullPolicy: Never ports: - containerPort: 8100 env: - name: DB_HOST value: "mysql.app-notifications.svc.cluster.local" - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" volumeMounts: - name: writable-secrets mountPath: /etc/secrets diff --git a/backend-pull-notifications/deployment.yaml b/backend-pull-notifications/deployment.yaml new file mode 100644 index 0000000..18b6a49 --- /dev/null +++ b/backend-pull-notifications/deployment.yaml @@ -0,0 +1,71 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: backend-pull-notifications + namespace: app-notifications +spec: + replicas: 1 + selector: + matchLabels: + app: backend-pull-notifications + template: + metadata: + labels: + app: backend-pull-notifications + spec: + initContainers: + - name: wait-for-mysql + image: busybox + command: + - sh + - -c + - | + until nslookup mysql.app-notifications.svc.cluster.local; do + echo "Waiting for MySQL DNS..." + sleep 2 + done + + until nc -z mysql.app-notifications.svc.cluster.local 3306; do + echo "Waiting for MySQL..." + sleep 2 + done + + echo "MySQL is available" + - name: copy-secrets + image: busybox + command: + - sh + - -c + - | + for f in /secrets/*; do + cp "$f" /etc/secrets/ + chmod 666 "/etc/secrets/$(basename $f)" + done + volumeMounts: + - name: backend-pull-notifications-secrets + mountPath: /secrets + - name: writable-secrets + mountPath: /etc/secrets + containers: + - name: backend-pull-notifications + image: app-notifications-backend-pull-notifications:1 + imagePullPolicy: Never + ports: + - containerPort: 8101 + env: + - name: RMQ_HOST + value: "rabbitmq.app-notifications.svc.cluster.local" + - name: DB_HOST + value: "mysql.app-notifications.svc.cluster.local" + - name: LOG_LEVEL + value: "DEBUG" + volumeMounts: + - name: writable-secrets + mountPath: /etc/secrets + volumes: + - name: backend-pull-notifications-secrets + secret: + secretName: backend-pull-notifications + - name: writable-secrets + emptyDir: {} + diff --git a/backend-pull-notifications/service-internal.yaml b/backend-pull-notifications/service-internal.yaml new file mode 100644 index 0000000..551da3c --- /dev/null +++ b/backend-pull-notifications/service-internal.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Service +metadata: + name: backend-pull-notifications + namespace: app-notifications +spec: + selector: + app: backend-pull-notifications + ports: + - protocol: TCP + port: 8101 + targetPort: 8101 + name: fastapi + type: ClusterIP diff --git a/backend-pull-notifications/service-metrics.yaml b/backend-pull-notifications/service-metrics.yaml new file mode 100644 index 0000000..72e56fb --- /dev/null +++ b/backend-pull-notifications/service-metrics.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: backend-pull-notifications-prometheus-metrics + namespace: app-notifications +spec: + selector: + app: backend-pull-notifications + ports: + - protocol: TCP + port: 9000 + targetPort: 9000 + nodePort: 30905 + name: prometheus-metrics + type: NodePort diff --git a/backend-push-notifications/deployment.yaml b/backend-push-notifications/deployment.yaml index 1b351ac..4ebfe6d 100644 --- a/backend-push-notifications/deployment.yaml +++ b/backend-push-notifications/deployment.yaml @@ -13,8 +13,6 @@ spec: labels: app: backend-push-notifications spec: - imagePullSecrets: - - name: ghcr-secret initContainers: - name: wait-for-mysql image: busybox @@ -50,7 +48,8 @@ spec: mountPath: /etc/secrets containers: - name: backend-push-notifications - image: ghcr.io/gansejunge/app-notifications-backend-push-notifications:12 + image: app-notifications-backend-push-notifications:1 + imagePullPolicy: Never ports: - containerPort: 9000 name: metrics @@ -60,7 +59,7 @@ spec: - name: BACKEND_PN_DB_HOST value: "mysql.app-notifications.svc.cluster.local" - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" volumeMounts: - name: writable-secrets mountPath: /etc/secrets diff --git a/service-docker-repository-query/deployment.yaml b/service-docker-repository-query/deployment.yaml index da755af..268e981 100644 --- a/service-docker-repository-query/deployment.yaml +++ b/service-docker-repository-query/deployment.yaml @@ -13,8 +13,6 @@ spec: labels: app: service-docker-repository-query spec: - imagePullSecrets: - - name: ghcr-secret initContainers: - name: wait-for-mysql image: busybox @@ -50,7 +48,8 @@ spec: mountPath: /etc/secrets containers: - name: service-docker-repository-query - image: ghcr.io/gansejunge/app-notifications-service-docker-repository-query:19 + image: app-notifications-service-docker-repository-query:1 + imagePullPolicy: Never ports: - containerPort: 5000 name: fastapi diff --git a/service-royalroad-chapters/deployment.yaml b/service-royalroad-chapters/deployment.yaml index c213f86..64ce180 100644 --- a/service-royalroad-chapters/deployment.yaml +++ b/service-royalroad-chapters/deployment.yaml @@ -13,8 +13,6 @@ spec: labels: app: service-royalroad-chapters spec: - imagePullSecrets: - - name: ghcr-secret initContainers: - name: wait-for-mysql image: busybox @@ -50,7 +48,8 @@ spec: mountPath: /etc/secrets containers: - name: service-royalroad-chapters - image: ghcr.io/gansejunge/app-notifications-service-royalroad-chapters:27 + image: app-notifications-service-royalroad-chapters:1 + imagePullPolicy: Never ports: - containerPort: 5000 name: fastapi @@ -62,7 +61,7 @@ spec: - name: BACKEND_API_URL value: "http://backend-api-internal.app-notifications.svc.cluster.local:8101/internal/receive-notifications" - name: LOG_LEVEL - value: "INFO" + value: "DEBUG" volumeMounts: - name: writable-secrets mountPath: /etc/secrets