From eff3e4e9a5535c5b0b45e44321620c35cccd12b9 Mon Sep 17 00:00:00 2001 From: Noah Lancien Date: Fri, 23 Jan 2026 10:03:59 +0100 Subject: [PATCH] ci: updated image version + target port 80 + added staging-resources.yaml + define pod resources + limit cronjobs --- Dockerfile | 4 ++-- manifest.yaml | 13 +++++++++++-- staging-resources.yaml | 20 ++++++++++++++++++++ 3 files changed, 33 insertions(+), 4 deletions(-) create mode 100644 staging-resources.yaml diff --git a/Dockerfile b/Dockerfile index a836b6e..e3436b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/ldcweb-production-8.2:latest +FROM registry.s-web.fr/ldc-web/projets/ldc-web-images-docker/ldcweb-production-8.2:170625-080812 COPY --chown=www-data:www-data . /app/srcs USER root RUN chmod -R 755 /app/srcs/storage -USER www-data \ No newline at end of file +USER www-data diff --git a/manifest.yaml b/manifest.yaml index 783ba85..c8f6fd1 100644 --- a/manifest.yaml +++ b/manifest.yaml @@ -10,7 +10,7 @@ data: APP_DEBUG: "${APP_APP_DEBUG}" APP_URL: "https://${REDIRECT}${APP_DOMAIN}" LOG_CHANNEL: "k8s" - DB_HOST: "mariadb.common-services" + DB_HOST: "${APP_DB_HOST}" DB_DATABASE: "${APP_DB_DATABASE}" DB_USERNAME: "${APP_DB_USERNAME}" DB_PASSWORD: "${APP_DB_PASSWORD}" @@ -74,6 +74,13 @@ spec: envFrom: - configMapRef: name: ${CI_PROJECT_PATH_SLUG}-config-map + resources: + limits: + cpu: "${APP_CI_CPU_LIMIT}" + memory: "${APP_CI_MEMORY_LIMIT}" + requests: + cpu: "${APP_CI_CPU_REQUEST}" + memory: "${APP_CI_MEMORY_REQUEST}" volumeMounts: - name: storage mountPath: /app/srcs/storage @@ -99,7 +106,7 @@ spec: app: ${CI_PROJECT_PATH_SLUG}-app ports: - port: 80 - targetPort: 443 + targetPort: 80 --- apiVersion: traefik.io/v1alpha1 @@ -128,6 +135,8 @@ metadata: name: ${CI_PROJECT_PATH_SLUG}-cronjob spec: schedule: "* * * * *" + successfulJobsHistoryLimit: 1 + failedJobsHistoryLimit: 1 concurrencyPolicy: Forbid jobTemplate: spec: diff --git a/staging-resources.yaml b/staging-resources.yaml new file mode 100644 index 0000000..a1cd413 --- /dev/null +++ b/staging-resources.yaml @@ -0,0 +1,20 @@ +--- +apiVersion: traefik.io/v1alpha1 +kind: IngressRoute +metadata: + name: ${CI_PROJECT_PATH_SLUG}-ingress-route +spec: + entryPoints: + - web + - websecure + routes: + - match: Host(`${APP_DOMAIN}`) + kind: Rule + services: + - name: ${CI_PROJECT_PATH_SLUG}-service + port: 80 + middlewares: + - name: admin-ldc-whitelist + namespace: common-services + tls: + secretName: ${CRT_TLS_NAME}