apiVersion: apps/v1 kind: Deployment metadata: name: backend-api-internal namespace: app-notifications spec: replicas: 1 selector: matchLabels: app: backend-api-internal template: metadata: labels: app: backend-api-internal spec: imagePullSecrets: - name: ghcr-secret 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-api-internal-secrets mountPath: /secrets - name: writable-secrets mountPath: /etc/secrets containers: - name: backend-api-internal image: ghcr.io/gansejunge/app-notifications-backend-api-internal:22 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: "INFO" volumeMounts: - name: writable-secrets mountPath: /etc/secrets volumes: - name: backend-api-internal-secrets secret: secretName: backend-api-internal - name: writable-secrets emptyDir: {}