NATS port not populated in NATS secret in some cases while re-deploying TFS and NATS together
Reporters
- Panagiotis Famelis (UBI)
- Georgios Katsikas (UBI)
- Lluis Gifre (CTTC)
Description
When re-deploying NATS together with TFS, in some cases the port for the NATS service is not properly populated in the nats-data
secret, which prevents Context from connecting to NATS for event distribution.
Seems a synchronization issue: while redeploying NATS, seems it is reported as ready
by Kubernetes before actually being ready. Consider adding a default value for the port in Common > Message Broker logic.
The issue comes because at some point, NATS helm chart changed and the client port in the K8s services was renamed from "client" to "nats" which prevents collecting the configured client port number.
The fix checks for port name "client" and if not found, then checks for port name "nats".
Deployment environment
- Operating System (include version): all
- MicroK8s (include version and add-ons): microk8s v1.24.*
- TeraFlowSDN (include release/branch-name/commit-id): develop
TFS deployment settings
- list of components deployed: all cases
- particular configurations you applied: redeploy NATS & TFS together
- any other particularity you might find important: none
Sequence of actions that resulted in the bug
- Update my_deploy.sh script setting NATS_REDEPLOY="YES"
source my_deploy.sh
- Re-Deploy TFS:
./deploy/all.sh
Document the explicit error
- Check log of Context component; it should retrieve a NATS URI with ":" but without port
- Context is not able to connect to NATS
- NATS secret
nats-data
shows no value for NATS_CLIENT_PORT
Expected behaviour
- NATS secret
nats-data
should be populated properly - If variable NATS_CLIENT_PORT is not provided, consider adding a default value for the port
References
None