fix(oidc): removing deprecated and useless patch

fix container liveness and readyness probes
fix service with correct port
This commit is contained in:
Philippe Caseiro 2024-02-13 16:49:37 +01:00
parent 0084707bbc
commit 29f539f7ab
4 changed files with 93 additions and 110 deletions

View File

@ -2,43 +2,35 @@ apiVersion: kustomize.config.k8s.io/v1alpha1
kind: Component kind: Component
resources: resources:
- ./resources/hydra-oidc-deployment.yaml - ./resources/hydra-oidc-deployment.yaml
- ./resources/hydra-oidc-service.yaml - ./resources/hydra-oidc-service.yaml
generatorOptions: generatorOptions:
labels: labels:
com.cadoles.forge.sso-kustom/session: redis com.cadoles.forge.sso-kustom/session: redis
configMapGenerator: configMapGenerator:
- name: hydra-oidc-env - name: hydra-oidc-env
literals: literals:
- APP_ENV=prod - APP_ENV=prod
- APP_DEBUG=false - APP_DEBUG=false
- PHP_FPM_MEMORY_LIMIT=256m - PHP_FPM_MEMORY_LIMIT=256m
- NGINX_APP_SERVER_LISTEN=80 - NGINX_APP_SERVER_LISTEN=80
- HYDRA_ADMIN_BASE_URL=http://hydra-dispatcher - HYDRA_ADMIN_BASE_URL=http://hydra-dispatcher
- OIC_AUTHORIZE_ENDPOINT=https://oidc-idp/api/v1/authorize - OIC_AUTHORIZE_ENDPOINT=https://oidc-idp/api/v1/authorize
- OIDC_TOKEN_ENDPOINT=https://oidc-idp/api/v1/token - OIDC_TOKEN_ENDPOINT=https://oidc-idp/api/v1/token
- OIDC_USERINFO_ENDPOINT=https://oidc-idp/api/v1/userinfo - OIDC_USERINFO_ENDPOINT=https://oidc-idp/api/v1/userinfo
- POST_LOGOUT_REDIRECT_URL=http://oidc-sp/logout - POST_LOGOUT_REDIRECT_URL=http://oidc-sp/logout
- OIDC_LOGOUT_ENDPOINT=https://oidc-idp/api/v1/logout?%s - OIDC_LOGOUT_ENDPOINT=https://oidc-idp/api/v1/logout?%s
- BASE_URL=http://hydra-oidc - BASE_URL=http://hydra-oidc
- PARAMS_TO_DELETE=[] - PARAMS_TO_DELETE=[]
- PARAMS_TO_INSERT={} - PARAMS_TO_INSERT={}
- OIDC_SCOPE=openid email - OIDC_SCOPE=openid email
- CLIENT_ID_FC=MyClientID - CLIENT_ID_FC=MyClientID
- CLIENT_SECRET_FC=MyClientSecret - CLIENT_SECRET_FC=MyClientSecret
- COOKIE_PATH=/ - COOKIE_PATH=/
- TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR - TRUSTED_PROXIES=127.0.0.1,REMOTE_ADDR
- REDIS_DSN="redis://redis:6379" - REDIS_DSN="redis://redis:6379"
# - name: hydra-dispatcher-apps - HYDRA_DISPATCHER_OIDC_LOGIN_URL="http://hydra-oidc/login"
# behavior: merge - HYDRA_DISPATCHER_OIDC_CONSENT_URL="http://hydra-oidc/consent"
# files: - HYDRA_DISPATCHER_OIDC_LOGOUT_URL="http://hydra-oidc/logout"
# - apps.yaml=./files/hydra/oidc.yaml
patchesJson6902:
- target:
version: v1
kind: ConfigMap
name: hydra-oidc-env
path: patches/hydra-oidc-env.yaml

View File

@ -1,9 +0,0 @@
- op: replace
path: "/data/HYDRA_DISPATCHER_OIDC_LOGIN_URL"
value: http://hydra-oidc/login
- op: replace
path: "/data/HYDRA_DISPATCHER_OIDC_CONSENT_URL"
value: http://hydra-oidc/consent
- op: replace
path: "/data/HYDRA_DISPATCHER_OIDC_LOGOUT_URL"
value: http://hydra-oidc/logout

View File

@ -17,70 +17,70 @@ spec:
io.kompose.service: hydra-oidc io.kompose.service: hydra-oidc
spec: spec:
containers: containers:
- name: hydra-oidc-php-fpm - name: hydra-oidc-php-fpm
image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.12.15-develop.1012.d57f2ad image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.12.15-develop.1012.d57f2ad
imagePullPolicy: Always imagePullPolicy: Always
args: ["/usr/sbin/php-fpm81", "-F", "-e"] args: ["/usr/sbin/php-fpm81", "-F", "-e"]
readinessProbe: readinessProbe:
exec: exec:
command: command:
- sh - sh
- -c - -c
- test -f /etc/php81/php-fpm.d/www.conf - test -f /etc/php81/php-fpm.d/www.conf
livenessProbe: livenessProbe:
exec: exec:
command: command:
- php - php
- bin/console - bin/console
- -V - -V
initialDelaySeconds: 10 initialDelaySeconds: 10
periodSeconds: 30 periodSeconds: 30
env: env:
- name: PHP_FPM_LISTEN - name: PHP_FPM_LISTEN
value: 127.0.0.1:9000 value: 127.0.0.1:9000
- name: PHP_MEMORY_LIMIT - name: PHP_MEMORY_LIMIT
value: 128m value: 128m
- name: PHP_FPM_MEMORY_LIMIT - name: PHP_FPM_MEMORY_LIMIT
value: 128m value: 128m
envFrom: envFrom:
- configMapRef: - configMapRef:
name: hydra-oidc-env name: hydra-oidc-env
resources: {} resources: {}
- image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.12.15-develop.1012.d57f2ad - image: reg.cadoles.com/cadoles/hydra-oidc-base:2023.12.15-develop.1012.d57f2ad
imagePullPolicy: Always imagePullPolicy: Always
name: hydra-oidc-nginx name: hydra-oidc-nginx
args: ["/usr/sbin/nginx"] args: ["/usr/sbin/nginx"]
readinessProbe: readinessProbe:
httpGet: httpGet:
path: /healthy path: /healthy
port: 80 port: 8080
initialDelaySeconds: 5 initialDelaySeconds: 5
timeoutSeconds: 5 timeoutSeconds: 5
periodSeconds: 10 periodSeconds: 10
livenessProbe: livenessProbe:
httpGet: httpGet:
path: /healthy path: /healthy
port: 80 port: 8080
initialDelaySeconds: 15 initialDelaySeconds: 15
timeoutSeconds: 5 timeoutSeconds: 5
periodSeconds: 15 periodSeconds: 15
envFrom: envFrom:
- configMapRef: - configMapRef:
name: hydra-oidc-env name: hydra-oidc-env
env: env:
- name: NGINX_APP_UPSTREAM_BACKEND_SERVER - name: NGINX_APP_UPSTREAM_BACKEND_SERVER
value: 127.0.0.1:9000 value: 127.0.0.1:9000
- name: NGINX_APP_ROOT - name: NGINX_APP_ROOT
value: "/public/" value: "/public/"
- name: NGINX_APP_PHP_INDEX - name: NGINX_APP_PHP_INDEX
value: "/index.php" value: "/index.php"
- name: NGINX_ERROR_LOG_LEVEL - name: NGINX_ERROR_LOG_LEVEL
value: "warn" value: "warn"
- name: NGINX_APP_PHP_NON_FILE_PATTERN - name: NGINX_APP_PHP_NON_FILE_PATTERN
value: "^/index\\.php(/|$)" value: "^/index\\.php(/|$)"
ports: ports:
- containerPort: 8080 - containerPort: 8080
resources: {} resources: {}
restartPolicy: Always restartPolicy: Always

View File

@ -6,8 +6,8 @@ metadata:
name: hydra-oidc name: hydra-oidc
spec: spec:
ports: ports:
- name: hydra-oidc - name: hydra-oidc
port: 80 port: 8080
selector: selector:
io.kompose.service: hydra-oidc io.kompose.service: hydra-oidc
status: status: