Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

The PSknowhow application is composed of seven containers that must be deployed on a Kubernetes cluster. This document will guide you through the installation process step by step. The containers are:

  1. customapi with openjdk:8-jre-slim-stretch as base image which handles api request, which runs on 8080 port.

  2. ui with nginx:1.22.0-alpine-perl base image, which runs on port 80 & 443.

  3. mongodb with mongo:4.4.1-bionic as base image, which runs on port 27017.

  4. Jira-processor with openjdk:8-jre-slim-stretch base image which is a jira collector.

  5. devops-processor with openjdk:8-jre-slim-stretch base image which collects jenkins, github, gitlab, bamboo, bitbucket, zephyr, sonar, teamcity.

  6. azure-board-processor with openjdk:8-jre-slim-stretch base image and which collects azure board.

  7. azure-pipeline-repo which collects azure pipeline and azure repo.

The ui container should run on a LoadBalancer server with port 443. The remaining six containers should run on the default service i.e ClusterIP.

Resource requirement:

  1. Customapi : 8GB RAM & 2 CPU

  2. MongoDB : 2GB & 1CPU

  3. UI : 1GB RAM & 1CPU

  4. Jira-processor: 6GB RAM & 1CPU

  5. devops-Processor: 8GB RAM & 2 CPU

  6. Azure-board-Processor: 4GB RAM & 1CPU

  7. Azure-pipeline-repo-Processor: 4GB RAM & 1CPU

Step 1: Create registry login credentials Secret .

kubectl create secret docker-registry regcred --docker-server=setup-speedy.tools.publicis.sapient.com --docker-username=xxxx --docker-password=xxxxx --docker-email=email.demo.com

Step 2: Create the MongoDB Pod

The MongoDB container must be deployed in its own pod. To create the MongoDB pod, create a YAML file and run the following command:

kubectl apply -f mongodb.yaml

Here is an example YAML file for the MongoDB container:

The YAML file specifies the name of the pod, the container image to use, the container port 27017 to expose. and the environmental variables to use

Environmental Variable’s for MongoDB:

  1. MONGODB_ADMIN_USER=<DB ROOT USER>

  2. MONGODB_ADMIN_PASS=<DB ROOT PASSWORD>

  3. MONGODB_APPLICATION_DATABASE=kpidashboard

  4. MONGODB_APPLICATION_USER=<DB APPLICATION USER>

  5. MONGODB_APPLICATION_PASS=<DB APPLICATION PASSWORD>

Step 3: Deploy customapi Pod

Download the customapi-deploy.yaml manifest file

The YAML file specifies the name of the Deployment, the container image to use, the container port 8080 to expose, and the Environmental variable for MongoDB host to connect to.

Replace the Environmental Variable’s with appropriate once

  1. corsFilterValidOrigin = "UI laodbalancer IP/DNS"

  2. forgotPassword.uiHost= "UI laodbalancer IP/DNS"

  3. versionnumber="the current version"

  4. JAVA_OPTS= (Optional) This will assign external variables to the application

  5. auth.secret: <Pass your auth key>

  6. aesEncryptionKey: <Pass your aes key >

Step 4: Deploy the UI Containers

Deploy the UI containers in the same way as the customapi and MongoDB containers. Here is an example YAML file for the ui container:

The YAML file specifies the name of the pod, the container image to use, and the container port to expose.

Step 5: Deploy the Processor Containers

Attaching the list of all the processor you may run

Jira-Processor

Devops-processor

Azure-board-processor

Azure-pipeline-repo-Processor

Step 6: Verify the Deployment

You can verify that the containers are running run the following command:

kubectl get pod


To persist the MongoDB data, you can use your preferred cloud provider's storage solution. Here are the steps you can follow:

  1. Create a persistent volume and claim in your cloud provider's storage solution. This will provide a storage location that will persist even if the MongoDB pod is deleted.

  2. Modify the MongoDB YAML file to use the persistent volume. Here's an example of how to modify the YAML file:

apiVersion: v1
kind: Pod
metadata:
  name: mongodb
spec:
  replicas: 1
  containers:
  - name: mongodb
    image: setup-speedy.tools.publicis.sapient.com/speedy/mongodb:latest
    ports:
    - containerPort: 27017
    volumeMounts:
    - name: mongodb-data
      mountPath: /data/db
  volumes:
  - name: mongodb-data
    persistentVolumeClaim:
      claimName: mongodb-pvc

The volumeMounts section specifies where the persistent volume should be mounted inside the container. The volumes section specifies the name of the volume and where it should be claimed from.

  1. Create the persistent volume claim by running the following command:

kubectl apply -f mongodb-pvc.yaml

Here's an example YAML file for the persistent volume claim:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mongodb-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

The YAML file specifies the name of the persistent volume claim, the access mode, and the requested storage size.

By following these steps, you can persist the MongoDB data in your preferred cloud provider's storage solution.


Upgrade Steps:

  1. If you are upgrading PSknowhow from 7.0.0 to 7.x.x please execute the bellow step

    kubectl exec -it <Mongodb Pod name> sh
    mongo admin --username="${MONGODB_ADMIN_USER}" --password="${MONGODB_ADMIN_PASS}" --eval "db.shutdownServer()"
  2. Edit the deployment in following order
    mongodb
    customapi
    ui
    jira-processor
    devops-processor
    azure-pipeline-repo
    azure-board-processor
    by

    kubectl edit deploy <Deploy name> -o yaml
  3. Replace the tag version with the latest version in image section

  4. Check for environmental variable section and add if any variables are missing in current manifest file Refer this docs . And save it.

  • No labels