Enable Redis sessions for prod validation
Main-Build / build-and-push (push) Has been cancelled

This commit is contained in:
2026-06-01 14:58:33 +09:00
parent ffce1ef370
commit 432c54b58e
3 changed files with 75 additions and 1 deletions
Vendored
+7
View File
@@ -162,8 +162,15 @@ spec:
done done
fi fi
if [ -f "k8s/${TARGET_ENV}/session-redis.yaml" ]; then
kubectl apply -f "k8s/${TARGET_ENV}/session-redis.yaml"
kubectl -n ${APP_NS} rollout status deploy/sayit-helpdesk-session-redis --timeout=120s
fi
if [ "${TARGET_ENV}" = "dev" ]; then if [ "${TARGET_ENV}" = "dev" ]; then
kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=strategic -p '{"spec":{"template":{"spec":{"containers":[{"name":"'${DEPLOY}'","env":[{"name":"SPRING_PROFILES_ACTIVE","value":"redis-session"}],"volumeMounts":[{"name":"heapdumps","mountPath":"/heapdumps"}]}],"volumes":[{"name":"heapdumps","nfs":{"server":"192.168.0.120","path":"/volume2/NFS/helpdesk-dev/heapdumps"}}]}}}}' kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=strategic -p '{"spec":{"template":{"spec":{"containers":[{"name":"'${DEPLOY}'","env":[{"name":"SPRING_PROFILES_ACTIVE","value":"redis-session"}],"volumeMounts":[{"name":"heapdumps","mountPath":"/heapdumps"}]}],"volumes":[{"name":"heapdumps","nfs":{"server":"192.168.0.120","path":"/volume2/NFS/helpdesk-dev/heapdumps"}}]}}}}'
elif [ "${TARGET_ENV}" = "prod" ]; then
kubectl -n ${APP_NS} patch deploy ${DEPLOY} --type=strategic -p '{"spec":{"template":{"spec":{"containers":[{"name":"'${DEPLOY}'","env":[{"name":"SPRING_PROFILES_ACTIVE","value":"redis-session"}]}]}}}}'
fi fi
kubectl -n ${APP_NS} set image deploy/${DEPLOY} ${DEPLOY}=${REG}/${IMAGE}:${IMAGE_TAG} kubectl -n ${APP_NS} set image deploy/${DEPLOY} ${DEPLOY}=${REG}/${IMAGE}:${IMAGE_TAG}
+67
View File
@@ -0,0 +1,67 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: sayit-helpdesk-session-redis
namespace: sayit-helpdesk
labels:
app: sayit-helpdesk-session-redis
spec:
replicas: 1
selector:
matchLabels:
app: sayit-helpdesk-session-redis
template:
metadata:
labels:
app: sayit-helpdesk-session-redis
spec:
containers:
- name: redis
image: redis:7.2-alpine
imagePullPolicy: IfNotPresent
args:
- redis-server
- --save
- ""
- --appendonly
- "no"
ports:
- name: redis
containerPort: 6379
readinessProbe:
tcpSocket:
port: redis
initialDelaySeconds: 3
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 3
livenessProbe:
tcpSocket:
port: redis
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
resources:
requests:
cpu: 50m
memory: 64Mi
limits:
cpu: 500m
memory: 256Mi
---
apiVersion: v1
kind: Service
metadata:
name: sayit-helpdesk-session-redis
namespace: sayit-helpdesk
labels:
app: sayit-helpdesk-session-redis
spec:
type: ClusterIP
selector:
app: sayit-helpdesk-session-redis
ports:
- name: redis
port: 6379
targetPort: redis
@@ -152,7 +152,7 @@ ldap.username =uid=admin,ou=system
ldap.password =secret ldap.password =secret
# Spring Session Redis # Spring Session Redis
Session.Redis.Enabled=false Session.Redis.Enabled=true
Session.Redis.Host=sayit-helpdesk-session-redis Session.Redis.Host=sayit-helpdesk-session-redis
Session.Redis.Port=6379 Session.Redis.Port=6379
Session.Redis.Database=0 Session.Redis.Database=0