From 08b902f8fe36c009e09a4836d865bf42aafed566 Mon Sep 17 00:00:00 2001 From: Antonin Filippi Date: Wed, 23 Apr 2025 07:35:26 +0000 Subject: [PATCH] Actualiser z2/deployment.yaml --- z2/deployment.yaml | 99 +++++++++++++++++++++++----------------------- 1 file changed, 49 insertions(+), 50 deletions(-) diff --git a/z2/deployment.yaml b/z2/deployment.yaml index 991b621..19aa985 100644 --- a/z2/deployment.yaml +++ b/z2/deployment.yaml @@ -1,50 +1,49 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: web - namespace: my-app -spec: - replicas: 2 - selector: - matchLabels: - app: web - template: - metadata: - labels: - app: web - spec: - initContainers: - - name: wait-for-postgres - image: busybox - command: - - sh - - -c - - | - until nc -z postgres 5432; do - echo "Waiting for PostgreSQL..." - sleep 2 - done - containers: - - name: web - # use the LOCAL image you just built, not the one on Docker Hub - image: simple-web-app:latest - imagePullPolicy: IfNotPresent - ports: - - containerPort: 5000 - env: - - name: DB_HOST - value: postgres - - name: DB_PORT - value: "5432" - - name: DB_NAME - value: postgres - - name: DB_USER - value: postgres - - name: DB_PASS - value: postgres - readinessProbe: - httpGet: - path: / - port: 5000 - initialDelaySeconds: 15 - periodSeconds: 10 +apiVersion: apps/v1 +kind: Deployment +metadata: + name: web + namespace: my-app +spec: + replicas: 2 + selector: + matchLabels: + app: web + template: + metadata: + labels: + app: web + spec: + initContainers: + - name: wait-for-postgres + image: busybox + command: + - sh + - -c + - | + until nc -z postgres 5432; do + echo "Waiting for PostgreSQL..." + sleep 2 + done + containers: + - name: web + image: simple-web-app:latest + imagePullPolicy: IfNotPresent + ports: + - containerPort: 5000 + env: + - name: DB_HOST + value: postgres + - name: DB_PORT + value: "5432" + - name: DB_NAME + value: postgres + - name: DB_USER + value: postgres + - name: DB_PASS + value: postgres + readinessProbe: + httpGet: + path: / + port: 5000 + initialDelaySeconds: 15 + periodSeconds: 10