Microservices
R24 AMR | Min(s) read

One-Helm Implementation for SRMS2.0 Microservice in K8

SRMS2.0 One-helm deployment package contains simplified deployment scripts with consolidated deployment parameters, deployment types, and databases. Only the .sh scripts are retained in the deployment packages. Earlier separate helmcharts maintained for K8/AKS/EKS deployments and now it is consolidated as single helm chart (one-helm).

This section provides steps and configurations to deploy SRMS2.0 microservice in the K8 environment.

This package deployment for SRMS2.0 microservice is applicable from 202311 release.

Pre-Installation

Refer Pre-installation Requirements section to know more about the steps required to deploy SRMS2.0 Microservice in K8 deployment.

Installing K8 On-premise Deployment

Before you proceed with the deployment, ensure to have the Helm and kubectl – Kubernetes command-line tool installed in the system.

To install K8 on-premise deployment,

  1. Unzip ms-servicerequest2-helm-mongo-pack-XXX.zip/ms-servicerequest2-helm-postgres-pack-XXX.zip
  2. Load the images from local to the Docker container.
    1. The images for the services are available in the unziped pack > Images folder. These images should be pushed into the repository.
    2. Load the images from ms-servicerequest2-helm-mongo-pack-XXX.zip/ms-servicerequest2-helm-postgres-pack-XXX.zip > Images

    3. Use the docker load command to get the images. For example, docker load --input ms-servicerequest-appinit-XXX.tar.
    4. Load all the images available in the folder using the command prompt from the above location as shown in the screenshot below.

  3. Create a Kafka topic in Kubernetes Cluster.

    You can perform the configuration changes required for on-premise deployment using Strimzi operator.

    Instead of Strimzi, other KAFKA deployment package can be used to bring up Kafka Streaming service. Ensure that the Kafka bootstrap port is configured in the microservice start-up script.

    Check whether all the Kafka pods are up and running using the below commands.

    • kubectl get kakfatopics -n Kafka.
    • kubectl get pods -n Kafka.

  4. Configure kubectl to connect to your system.
  5. Deploy database in Kubernetes for adapter to connect.

    Before starting the database delete all the existing running service using the Kubectl delete ns namespace command. For example, Kubectl delete ns servicerequest.

    Navigate to ms-servicerequest2-helm-mongo-pack-XXX.zip/ms-servicerequest2-helm-postgres-pack-XXX.zip > Samples > db and start the database as shown in the screenshot below:

    To start the database, open the git bash and run the following commands:

    • mysql Database > sh start-sqldb-scripts.sh 
    • mssql Database > sh start-mssql-db-scripts.sh
  6. Deploy the generic config in Kubernetes. Refer One-Helm Implementation for Genericconfig Microservice in K8 to know more about the steps to deploy GeneriConfig microservice.
  7. Deploy the SRMS2.0 microservice in Kubernetes.

    Once database is up and running without any errors, perform the below steps.

    • Navigate to the scripts folder.
    • Open shell or git bash and run teh follwoing commands to deploy servicerequest with postgresql and mongo db.
      • ./start-servicerequest.sh onpremise postgresql
      • ./start-servicerequest.sh onpremise mongodb

  8. Validate the running status of Api, Ingester, and kafka pods.

    To check the logs and to describe the running pods, use the command of recent age (time) running one.

    • kubectl logs -f <podname> -n <namespace>
    • kubectl describe pod <podname> -n <namespace>
  9. Navigate to samples > external to apply nodeport.

    Check for the API selector name and version. Replace them inside the file servicerequest-nodeport.yaml. Run the kubectl apply -f servicerequest-nodeport.yaml -n servicerequest command to apply node port.

    For example,

    • Selector name - <<APP_ENVIRONMENT_NAME>>-servicerequest-api
    • Selector version - $BLUEGREEN_VERSION set in servicerequest-env.sh

    The IP address which is used to hit from the local is generated as External-IP in the servicerequest-srapisvc pod. Initially, the External-IP output for servicerequest-gcapisvc pod shows pending, later it changes to an actual public IP address such as 20.90.203.237 and the port can be 7101, which is used to connect servicerequest microservice from local.

Deployment Validation

         To check whether the connection is up and running, run the below sample service.

Create the Service Request Schema
This API is used to whether the Azure AKS connection is up and running.

POST/order/serviceRequests/serviceRequestConfiguration?requestType={requestType}

Sample URL
[http/https]://<<HOST_NAME>>[:<<PORT>>]/ms-servicerequest-api/api/v1.0.0/order/serviceRequests/serviceRequestConfiguration?requestType={requestType}
Request
{
    "serviceRequestSchema": {
        "$schema": "http://json-schema.org/draft-04/schema#",
        "type": "object",
        "properties": {
            "accountNo": {
                "type": "string",
                "title": "Account Number",
                "description": "Account No of the user"
            },
            "chequeType": {
                "type": "string",
                "title": "ChequeBook Type",
                "description": "Type of the chequebook"
            },
            "notes": {
                "type": "string",
                "title": "Notes",
                "description": "Notes"
            }
        },
        "required": [
            "accountNo",
            "chequeType",
            "notes"
        ]
    },
    "serviceRequestProperties": [
        {
            "key": "id",
            "value": "CHQ"
        },
        {
            "key": "noofapproval",
            "value": "3"
        }
    ]
}
Sample Response
{    "serviceRequestId": "chequebook",
    "message": "Service Request Type Schema Created Successfully",
    "responseStatus": "Created"
}

Copyright © 2020- Temenos Headquarters SA

Published on :
Wednesday, June 12, 2024 3:49:50 PM IST