Configure Session Stickiness with NGINX Ingress ¶
Default Configuration ¶
ingress:
create: true
nginx: true # Enables session stickiness automatically
host: bitbucket.example.com
bitbucket:
clustering:
enabled: true
Custom Configuration ¶
ingress:
create: true
nginx: true
host: bitbucket.example.com
annotations:
"nginx.ingress.kubernetes.io/session-cookie-name": "BITBUCKET-SESSION"
"nginx.ingress.kubernetes.io/session-cookie-max-age": "28800" # 8 hours
Verifying Session Stickiness ¶
Test that session stickiness is working:
# Check ingress annotations
kubectl describe ingress bitbucket -n atlassian
# Test with curl (look for Set-Cookie header)
curl -I https://bitbucket.example.com/status
Troubleshooting ¶
If users are experiencing random logouts or Git operation failures:
-
Verify NGINX annotations are applied:
kubectl get ingress bitbucket -n atlassian -o yaml
-
Check if requests hit the same pod:
kubectl logs -f -l app.kubernetes.io/name=bitbucket -n atlassian
-
Ensure clustering is enabled:
bitbucket: clustering: enabled: true
Production recommendation
Set session-cookie-max-age
to match your typical user session duration (e.g., 8 hours = 28800 seconds) to balance user experience with security.