TABLE OF CONTENTS

1. When / how to update DS after deployment

2. When / how to update flows after deployment

3. When / how to update IEG + PartnerAgent + AppAgent

4. Components that cannot be scaled

5. Why/How to set imagePullPolicy as Always

6. Core pod reconnect scenarios

7. Log pattern to grep on the logs to know that it has connected to mongodb/redis/nats

8. Update agent



1. When / how to update DS after deployment

When -  Whenever there is hotfix on SM and Base image,DS needs to be redeployed.


How - Once you applied latest hot fix of SM you can update your DS using the following methods


1. Using Repair DS api:


API Details :

    URL - 'http://{domain}/api/a/sm/{serviceId}/repair'

    Method - PUT

    Header - Authorization : JWT {Auth token}

    Payload - N/A

Where domain is your ODP app name and serviceId is the id of DS you want to update

Note: Use http or https in endpoint as per your domain configuration.


2. Deleting DS deployment and service :


Minimum Permissions required - App Admin Access to the system where ODP is running

Below are the steps to update DS:

a). From App panel UI, Stop All DS

b). Log in to system and delete deployment and service with this command

 `kubectl delete deploy,svc -n capiot-{appName} {dsName}`

 where dsName is the name of DS you want to update and appName is the name of app 

c). From App panel UI, Start All DS


3. Modifying DS definition:

Minimum Permissions required - Edit DS

Use this as method only when you can't follow above mentioned methods.

    a) Add a dummy field in your DS and deploy.

    b) Once deployed you can remove that field and redeploy your DS.



2. When / how to update flows after deployment

 When - Whenever there is a hotfix on B2B or config map variable is changed from backend(LOG_LEVEL)


How - Restart the B2B Pod, Save and deploy the flow from UI for creation of new flow pod. 


Incase of scenarios where the save and deploy doesn't work for some flows, try deleting the b2b,dm and pm pod and try to save and deploy the pending flows again. This does not need you to deploy all the already deployed flows. Also please note that when a new hotfix for b2b is deployed, all the flows need to be saved and deployed.


3. When / how to update IEG + PartnerAgent + AppAgent

When - If changes are made in the Config map related to IEG/PA/AA


How - Restart the B2BGW pod and re-download IEG/PA/AA and start them


4. Components that cannot be scaled

Any component can be scaled except REDIS,PM and NATS.


5. Why/How to set imagePullPolicy as Always

Why -Required when you are using docker registry for ODP. When you try to update DS without changing its definition, a docker image of DS is created with same version and tag as last docker image of DS. Now next time when DS tries to come up and you have imagePullPolicy as "IfNotPresent" then the old image (if exists) could be used for deployment, which means DS failure of update. To avoid this conflict you need to set imagePullPolicy as Always. It makes sure that you get latest image from your docker registry. This should be always set for sm,pm and the data service pods.


How -Below are the steps for same :

1. Login to system where ODP is running.

2. Edit the deployment using command

'kubectl edit deploy -n {namespace} {deploymentName}`

where namespace is the kubernetes namespace where DS is running and deploymentName is the DS name in small case.

3. Find imagePullPolicy property under spec -> spec -> containers -> imagePullPolicy and set as Always and save the deployment.


Note: This should be always set for sm,pm and the data service pods.

6. Core pod reconnect scenarios

All components are capable of reconnecting itself. Though there is a limit on number of attempts to retry connections for few services which is configurable in config map. These are such services and respective config map variables:


a) NATS:

Variable : NATS_RECONN_ATTEMPTS

Default:  500

Used by all components. In case of manual restart all pods need to be restarted.1        


b) Mongo:

Variable: MONGO_RECONN_TRIES

Default: 21600 (Picked from config map)

Used by all components.In case of manual restart all pods need to be restarted.


c) Redis:

Default: 50

Used by user and gateway only.


Order in which pods need to be restarted: mongo => redis => nats => sec => user => dm => sm => pm => wf => b2b => b2bgw => mon => ne => gw => nginx


7. Log pattern to grep on the logs to know that it has connected to mongodb/redis/nats

MongoDB -

DS DB - Connected - "Connected to ${dbName}} DB" (dbName would be same k8s namespace of DS)

Disconnected - "---${dbName} lost connection---"

Reconnected - "---${dbName} reconnected---"

Reconnect Failed - "—-${dbName} failed to reconnect---"

Flows - "Mongo DB Details"

B2BGW - "Connected to mongoDB"


Logs DB -

 "Connected to Logs DB"


NATS -

Connected - "NATS connected"

Disconnected - "NATS disconnect"

Reconnecting - "NATS reconnecting"

Reconnected - "NATS reconnect"


Redis -

Connected - "Redis client connected"


8. Update Agent

When there is a hotfix on b2bgw component, agent must be updated and the same can be achieved by doing an Over-the-Air(OTA) using the update option from Author UI.(Screenshot provided below for reference).

Update should not be done in between interactions as this action will stop the upload or download. Agent update may take some time based on the network. The organisation must inform their customer about the update to avoid any upload/download process during the update process.