This topic describes how to install the NGINX Ingress controller in the Kubernetes
cluster and expose the IBM control desk workloads outside the Kubernetes Cluster.
Procedure
-
Install NGINX Ingress Controller. Refer NGINX Documentation for more details.
- Create a new ingress installation file, name it icd-ingress.yaml. It
is used to expose the IBM®
Control Desk
workloads outside the cluster. Refer content below:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: icd-ingress
namespace: icd
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/affinity: "cookie"
nginx.ingress.kubernetes.io/session-cookie-expires: "172800"
nginx.ingress.kubernetes.io/session-cookie-max-age: "172800"
nginx.ingress.kubernetes.io/ssl-redirect: "false"
nginx.ingress.kubernetes.io/affinity-mode: persistent
nginx.ingress.kubernetes.io/session-cookie-hash: sha1
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
ingress.kubernetes.io/backend-protocol: "HTTPS"
kubernetes.io/tls-acme: "true"
spec:
tls:
- hosts:
- icd.ibm.com
secretName: icd-secret
rules:
- host: icd.ibm.com
http:
paths:
- path: /maximoapi
backend:
serviceName: icd-api
servicePort: 9080
- path: /cron
backend:
serviceName: icd-cron
servicePort: 9080
- path: /mea
backend:
serviceName: icd-mea
servicePort: 9080
- path: /
backend:
serviceName: icd-ui
servicePort: 9080
Here icd.ibm.com is the hostname and http protocol
used to expose the different services like icd-ui on service port 9080. Secret Name
icd-secret contains the TLS secret.
- Apply the
icd-ingress using the below command. This will enable the
ingress in your cluster for IBM
Control Desk workloads:
kubectl apply -f icd-ingress.yaml
- Similarly, Create an ingress resource for Service Portal, name it as
sp-ingress.yaml. This ingress would be required for accessing service portal
frontend. Refer content below:
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ssp-ingress
namespace: icd
annotations:
kubernetes.io/ingress.class: "nginx"
nginx.ingress.kubernetes.io/secure-backends: "true"
nginx.ingress.kubernetes.io/backend-protocol: "HTTPS"
ingress.kubernetes.io/backend-protocol: "HTTPS"
kubernetes.io/tls-acme: "true"
spec:
tls:
- hosts:
- ssp.ibm.com
secretName: icd-secret
rules:
- host: ssp.ibm.com
http:
paths:
- path: /
backend:
serviceName: icd-ssp
servicePort: 3000
Here ssp.ibm.com is the hostname and http protocol is
used to expose the different services like icd-ssp on service port 3000. Secret Name
icd-secret contains the TLS secret.
- Apply the
ssp-ingress using the below command:
kubectl apply -f sp-ingress.yaml
Results
After enabling the above steps, ingress is enabled on the Kubernetes setup. IBM
Control Desk and Service Portal user interfaces can be
accessed using ingress.Note: Entries for icd.ibm.com and
ssp.ibm.com with worker nodes IP addresses are required to be added in the hosts
file of the machine to resolve hostnames.