-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add link to sticky session doc (#138)
- Loading branch information
1 parent
9f451e1
commit 60a5633
Showing
6 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Using sticky session for Decision Center connection | ||
|
||
The aim of this complementary documentation is to explain how to enable sticky session for Decision Center connection, using NGINX ingress. | ||
|
||
Sticky sessions or session affinity, is a feature that allows you to keep a session alive for a certain period of time. In a Kubernetes cluster, if sticky session is enabled, all the traffic from a client to an application will be redirected to the same pod, even with multiple replicas. | ||
|
||
## Prerequisites | ||
|
||
This supposes that you already provision an NGINX Ingress Controller in your cluster. Refer to the documentation corresponding to your platform for more information. | ||
|
||
## Deploy ODM without Ingress | ||
|
||
To install ODM without Ingress: | ||
|
||
- Get the appropriate value file for your platform and set the `ingress.enabled` parameter to `false`: | ||
```yaml | ||
ingress: | ||
enabled: false | ||
``` | ||
> **Note** | ||
> `false` is the default value if not provided. | ||
|
||
- Run the helm install command: | ||
|
||
``` | ||
helm install mycompany ibm-helm/ibm-odm-prod --version 23.1.0 -f my-nginx-values.yaml | ||
``` | ||
|
||
## Configuring Ingress to use sticky sessions | ||
|
||
To be able to use sticky session in Decision Center but not enabling it in Decision Server, you will have to create to different Ingress instances: | ||
|
||
```bash | ||
kubeclt apply -f ingress-dc.yaml | ||
kubeclt apply -f ingress-ds.yaml | ||
``` | ||
|
||
The [ingress-dc.yaml](ingress-dc.yaml) configuration file uses the `nginx.ingress.kubernetes.io/affinity: cookie` annotation that enable sticky sessions. | ||
|
||
### 6. Access the ODM services | ||
|
||
After a couple of minutes, the Ingress configuration is updated. You can then access the ODM services by retrieving the URLs with this command: | ||
|
||
```bash | ||
export DC_ROOTURL=$(kubectl get ingress mycompany-odm-dc-ingress --no-headers |awk '{print $4}') | ||
export DS_ROOTURL=$(kubectl get ingress mycompany-odm-ds-ingress --no-headers |awk '{print $4}') | ||
``` | ||
|
||
The ODM services are accessible from the following URLs: | ||
|
||
| *Component* | *URL* | *Username/Password* | | ||
|---|---|---| | ||
| Decision Center | https://${DC_ROOTURL}/decisioncenter | odmAdmin/odmAdmin | | ||
| Decision Center Swagger | https://${DC_ROOTURL}/decisioncenter-api | odmAdmin/odmAdmin | | ||
| Decision Server Console |https://${DS_ROOTURL}/res| odmAdmin/odmAdmin | | ||
| Decision Server Runtime | https://${DS_ROOTURL}/DecisionService | odmAdmin/odmAdmin | | ||
| Decision Runner | https://${DS_ROOTURL}/DecisionRunner | odmAdmin/odmAdmin | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ${RELEASE_NAME}-odm-dc-ingress | ||
labels: | ||
app: ibm-odm-prod | ||
ingressroutes: ${RELEASE_NAME} | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/backend-protocol: https | ||
nginx.ingress.kubernetes.io/affinity: cookie | ||
|
||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /decisioncenter | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: ${RELEASE_NAME}-odm-decisioncenter | ||
port: | ||
number: 9453 | ||
- path: /decisioncenter-api | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: ${RELEASE_NAME-odm-decisioncenter | ||
port: | ||
number: 9453 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: ${RELEASE_NAME}-odm-ds-ingress | ||
labels: | ||
app: ibm-odm-prod | ||
ingressroutes: ${RELEASE_NAME} | ||
annotations: | ||
kubernetes.io/ingress.class: nginx | ||
nginx.ingress.kubernetes.io/backend-protocol: https | ||
|
||
spec: | ||
rules: | ||
- http: | ||
paths: | ||
- path: /res | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: ${RELEASE_NAME}-odm-decisionserverconsole | ||
port: | ||
number: 9443 | ||
- path: /DecisionService | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: ${RELEASE_NAME}-odm-decisionserverruntime | ||
port: | ||
number: 9443 | ||
- path: /DecisionRunner | ||
pathType: Prefix | ||
backend: | ||
service: | ||
name: ${RELEASE_NAME}-odm-decisionrunner | ||
port: | ||
number: 9443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters