The root cause of the issue is that the sessions are not shared across server instances, so if the authentication is enabled for TAP GUI, then scaling out the server instances will make the requests in a round-robin fashion. A successful login can be routed to an instance that is not logged in so the pages will display no records.
Currently the Tanzu Application Platform product team is still working on a permanent fix. Contour's
Session Affinity can be utilized to mitigate the issue before the fix is released. With this method, the same logged-in user will be routed to the same server instance.
1. Create the following overlay to enable Session Affinity for HTTPProxy in TAP GUI
$ cat EOF > tap-gui-session-affinity.yaml
#@ load("@ytt:overlay", "overlay")
#@overlay/match by=overlay.subset({"kind":"HTTPProxy","metadata":{"name":"tap-gui"}})
---
spec:
routes:
#@overlay/match by=overlay.subset({"services": [{"name": "server"}]})
- services: []
#@overlay/match missing_ok=True
loadBalancerPolicy:
strategy: Cookie
EOF
2. Create a Secret for the overlay
$ kubectl -n tap-install create secret generic tap-gui-session-affinity \
-o yaml \
--dry-run=client \
--from-file=tap-gui-session-affinity.yaml\
| kubectl apply -f-
3. Set the secret name of the created overlay to package_overlays in tap-values.yaml as follows:
package_overlays:
- name: tap-gui
secrets:
- name: tap-gui-session-affinity
4. Update the tap package
$ tanzu package installed update -n tap-install tap -f tap-values.yaml