Merge branch 'master' of lab.s-web.fr:ldc-web/cluster-k8s into develop

This commit is contained in:
thibault.raquet 2025-04-10 16:17:34 +02:00
commit a2a32f365f
2 changed files with 308 additions and 293 deletions

View file

@ -1,10 +1,15 @@
ci_access:
projects:
- id: ldc-web/projets/agis
- id: ldc-web/projets/auguste-lambert
- id: ldc-web/projets/boutique-cnc-sable
- id: ldc-web/projets/cailles-robin
- id: ldc-web/projets/crm
- id: ldc-web/projets/coupe-de-france-de-la-volaille
- id: ldc-web/projets/data-pfc
- id: ldc-web/projets/domaine-de-lanvaux
- id: ldc-web/projets/doux
- id: ldc-web/projets/espri-restauration
- id: ldc-web/projets/galina
- id: ldc-web/projets/gen-game-web-instances/janze
- id: ldc-web/projets/gen-game-web-instances/l-orleanais-jeu
@ -12,29 +17,38 @@ ci_access:
- id: ldc-web/projets/gen-game-web-instances/normandie
- id: ldc-web/projets/gen-game-web-instances/reghalal-jeu
- id: ldc-web/projets/gen-game-web-instances/tregalette-chandleur-2024
- id: ldc-web/projets/gen-game-web-prize-draw
- id: ldc-web/projets/id-halal
- id: ldc-web/projets/jeusselin
- id: ldc-web/projets/l-hours
- id: ldc-web/projets/la-toque-angevine
- id: ldc-web/projets/ldc
- id: ldc-web/projets/ldc-foods
- id: ldc-web/projets/ldc-restauration
- id: ldc-web/projets/ldc-web
- id: ldc-web/projets/le-gaulois
- id: ldc-web/projets/le-gaulois-pro
- id: ldc-web/projets/le-marche-de-beaufeu
- id: ldc-web/projets/les-fermiers-snv
- id: ldc-web/projets/lionor
- id: ldc-web/projets/loue
- id: ldc-web/projets/loue-action-reboisement
- id: ldc-web/projets/loue-magie-de-noel
- id: ldc-web/projets/maitre-coq
- id: ldc-web/projets/mairet
- id: ldc-web/projets/maison-couthouis
- id: ldc-web/projets/mas-d-auge
- id: ldc-web/projets/matines
- id: ldc-web/projets/medina
- id: ldc-web/projets/mesbr
- id: ldc-web/projets/nature-and-respect
- id: ldc-web/projets/nature-eleveurs
- id: ldc-web/projets/op-insta-instances/le-gaulois
- id: ldc-web/projets/ovoteam
- id: ldc-web/projets/parc-auto
- id: ldc-web/projets/poule-et-toque
- id: ldc-web/projets/prims
- id: ldc-web/projets/qrcollector/qrcollector-back
- id: ldc-web/projets/qrcollector/qrcollector-front
- id: ldc-web/projets/regalette
- id: ldc-web/projets/reghalal
- id: ldc-web/projets/report
@ -47,6 +61,7 @@ ci_access:
- id: ldc-web/projets/showroom-bo-instances/nature-and-respect
- id: ldc-web/projets/store-ldc
- id: ldc-web/projets/support-web
- id: ldc-web/projets/traditions-asie
- id: ldc-web/projets/tregalette
- id: ldc-web/projets/vdme
- id: ldc-web/projets/volena

View file

@ -1,292 +1,292 @@
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: traefik
namespace: common-services
spec:
interval: 1m0s
chart:
spec:
chart: traefik
version: 31.1.1
sourceRef:
kind: HelmRepository
name: traefik
namespace: common-services
values:
image:
tag: v3.1.4
rbac:
enabled: true
globalArguments:
- "--global.checknewversion"
- "--global.sendanonymoususage"
- "--accesslog=true"
- "--entryPoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--providers.kubernetescrd.allowCrossNamespace=true"
- "--entryPoints.web.proxyProtocol.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP}/32,10.124.0.0/16"
- "--entryPoints.websecure.proxyProtocol.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP}/32,10.124.0.0/16"
- "--entryPoints.websecure.forwardedHeaders.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP}/32"
- "--entryPoints.mariadb.proxyProtocol.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP},10.124.0.0/16"
additionalArguments:
- "--log.level=DEBUG"
ports:
traefik:
port: 9000
expose:
default: false
protocol: TCP
web:
redirectTo:
port: websecure
websecure:
port: 8443
expose:
default: true
exposedPort: 443
protocol: TCP
tls:
enabled: true
metrics:
port: 9100
expose:
default: false
protocol: TCP
mariadb:
port: 54322
expose:
default: true
protocol: TCP
providers:
kubernetesCRD:
enabled: true
ingresssClass: traefik
kubernetesIngress:
enabled: true
service:
enabled: true
type: LoadBalancer
annotations:
service.beta.kubernetes.io/ovh-loadbalancer-proxy-protocol: v2
spec:
loadBalancerIP: "${TRAEFIK_LOAD_BALANCER_IP}"
externalTrafficPolicy: Local
ingressRoute:
dashboard:
enabled: false
extraObjects:
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: common-services
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: production
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: staging
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: review
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
# Redirection to www for common-services namespace
# TODO: remove this middleware when all sites been updated
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: common-services
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://(?:www\\.)?(.+)"
# How to modify the URL to have the new target URL
replacement: "https://www.${1}"
# Redirection to www for production namespace
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: production
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://(?:www\\.)?(.+)"
# How to modify the URL to have the new target URL
replacement: "https://www.${1}"
# Redirection from www to domain for staging
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: staging
spec:
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
# Redirection from www to domain for review
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: review
spec:
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
# customResponseHeaders middleware
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: coop-middleware
namespace: review
spec:
headers:
customResponseHeaders:
Cross-Origin-Opener-Policy: "same-origin"
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: coop-middleware
namespace: staging
spec:
headers:
customResponseHeaders:
Cross-Origin-Opener-Policy: "same-origin"
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: coop-middleware
namespace: production
spec:
headers:
customResponseHeaders:
Cross-Origin-Opener-Policy: "same-origin"
- apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipwhitelist-acces-mariadb
namespace: common-services
spec:
ipAllowList:
sourceRange:
- 46.18.126.208/28 # LDC
- 62.193.56.48/32 # OPENevents - Bureau Neuville
- 80.15.14.76/32 # LDC web - Box externe
- 86.65.205.240/28 # LDC
- 135.125.42.176/28 # LDC
- 149.202.23.64/26 # LDC
- 151.80.95.176/28 # LDC
- 217.15.92.64/28 # LDC
- 10.124.0.0/16 # Kubernetes internal resources
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: admin-ldc-whitelist
namespace: common-services
spec:
ipAllowList:
sourceRange:
- 46.18.126.208/28 # LDC
- 62.193.56.48/32 # OPENevents - Bureau Neuville
- 80.15.14.76/32 # LDC web - Box externe
- 86.65.205.240/28 # LDC
- 135.125.42.176/28 # LDC
- 149.202.23.64/26 # LDC
- 151.80.95.176/28 # LDC
- 217.15.92.64/28 # LDC
- apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: mariadb-ingressroutetcp
namespace: common-services
spec:
entryPoints:
- mariadb
routes:
- match: HostSNI(`*`) # Hostname to match
middlewares:
- name: ipwhitelist-acces-mariadb
namespace: common-services
services:
- name: mariadb
port: 3306
---
apiVersion: helm.toolkit.fluxcd.io/v2
kind: HelmRelease
metadata:
name: traefik
namespace: common-services
spec:
interval: 1m0s
chart:
spec:
chart: traefik
version: 31.1.1
sourceRef:
kind: HelmRepository
name: traefik
namespace: common-services
values:
image:
tag: v3.1.4
rbac:
enabled: true
globalArguments:
- "--global.checknewversion"
- "--global.sendanonymoususage"
- "--accesslog=true"
- "--entryPoints.web.http.redirections.entryPoint.to=websecure"
- "--entrypoints.web.http.redirections.entrypoint.scheme=https"
- "--providers.kubernetescrd.allowCrossNamespace=true"
- "--entryPoints.web.proxyProtocol.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP}/32,10.124.0.0/16"
- "--entryPoints.websecure.proxyProtocol.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP}/32,10.124.0.0/16"
- "--entryPoints.websecure.forwardedHeaders.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP}/32"
- "--entryPoints.mariadb.proxyProtocol.trustedIPs=${TRAEFIK_LOAD_BALANCER_IP},10.124.0.0/16"
additionalArguments:
- "--log.level=DEBUG"
ports:
traefik:
port: 9000
expose:
default: false
protocol: TCP
web:
redirectTo:
port: websecure
websecure:
port: 8443
expose:
default: true
exposedPort: 443
protocol: TCP
tls:
enabled: true
metrics:
port: 9100
expose:
default: false
protocol: TCP
mariadb:
port: 54322
expose:
default: true
protocol: TCP
providers:
kubernetesCRD:
enabled: true
ingresssClass: traefik
kubernetesIngress:
enabled: true
service:
enabled: true
type: LoadBalancer
annotations:
service.beta.kubernetes.io/ovh-loadbalancer-proxy-protocol: v2
spec:
loadBalancerIP: "${TRAEFIK_LOAD_BALANCER_IP}"
externalTrafficPolicy: Local
ingressRoute:
dashboard:
enabled: true
extraObjects:
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: common-services
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: production
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: staging
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
- apiVersion: traefik.io/v1alpha1 # Redirect www URLs to their no-www equivalent
kind: Middleware
metadata:
name: redirect-www-to-no-www
namespace: review
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
# Redirection to www for common-services namespace
# TODO: remove this middleware when all sites been updated
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: common-services
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://(?:www\\.)?(.+)"
# How to modify the URL to have the new target URL
replacement: "https://www.${1}"
# Redirection to www for production namespace
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: production
spec:
# Redirect a request from an url to another with regex matching and replacement
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://(?:www\\.)?(.+)"
# How to modify the URL to have the new target URL
replacement: "https://www.${1}"
# Redirection from www to domain for staging
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: staging
spec:
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
# Redirection from www to domain for review
- apiVersion: traefik.io/v1alpha1 # Redirect no-www URLs to their www equivalent
kind: Middleware
metadata:
name: redirect-no-www-to-www
namespace: review
spec:
redirectRegex:
# Apply a permanent redirection (HTTP 301)
permanent: true
# The regular expression to match and capture elements from the request URL
regex: "^https?://www\\.(.+)"
# How to modify the URL to have the new target URL
replacement: "https://${1}"
# customResponseHeaders middleware
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: coop-middleware
namespace: review
spec:
headers:
customResponseHeaders:
Cross-Origin-Opener-Policy: "same-origin"
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: coop-middleware
namespace: staging
spec:
headers:
customResponseHeaders:
Cross-Origin-Opener-Policy: "same-origin"
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: coop-middleware
namespace: production
spec:
headers:
customResponseHeaders:
Cross-Origin-Opener-Policy: "same-origin"
- apiVersion: traefik.io/v1alpha1
kind: MiddlewareTCP
metadata:
name: ipwhitelist-acces-mariadb
namespace: common-services
spec:
ipAllowList:
sourceRange:
- 46.18.126.208/28 # LDC
- 62.193.56.48/32 # OPENevents - Bureau Neuville
- 80.15.14.76/32 # LDC web - Box externe
- 86.65.205.240/28 # LDC
- 135.125.42.176/28 # LDC
- 149.202.23.64/26 # LDC
- 151.80.95.176/28 # LDC
- 217.15.92.64/28 # LDC
- 10.124.0.0/16 # Kubernetes internal resources
- apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: admin-ldc-whitelist
namespace: common-services
spec:
ipAllowList:
sourceRange:
- 46.18.126.208/28 # LDC
- 62.193.56.48/32 # OPENevents - Bureau Neuville
- 80.15.14.76/32 # LDC web - Box externe
- 86.65.205.240/28 # LDC
- 135.125.42.176/28 # LDC
- 149.202.23.64/26 # LDC
- 151.80.95.176/28 # LDC
- 217.15.92.64/28 # LDC
- apiVersion: traefik.io/v1alpha1
kind: IngressRouteTCP
metadata:
name: mariadb-ingressroutetcp
namespace: common-services
spec:
entryPoints:
- mariadb
routes:
- match: HostSNI(`*`) # Hostname to match
middlewares:
- name: ipwhitelist-acces-mariadb
namespace: common-services
services:
- name: mariadb
port: 3306