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:
customapi with openjdk:8-jre-slim-stretch as base image which handles api request, which runs on 8080 port.
ui with nginx:1.22.0-alpine-perl base image, which runs on port 80 & 443.
mongodb with mongo:4.4.1-bionic as base image, which runs on port 27017.
Jira-processor with openjdk:8-jre-slim-stretch base image which is a jira collector.
devops-processor with openjdk:8-jre-slim-stretch base image which collects jenkins, github, gitlab, bamboo, bitbucket, zephyr, sonar, teamcity.
azure-board-processor with openjdk:8-jre-slim-stretch base image and which collects azure board.
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:
Customapi : 8GB RAM & 2 CPU
MongoDB : 2GB & 1CPU
UI : 1GB RAM & 1CPU
Jira-processor: 6GB RAM & 1CPU
devops-Processor: 8GB RAM & 2 CPU
Azure-board-Processor: 4GB RAM & 1CPU
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:
MONGODB_ADMIN_USER=<DB ROOT USER>
MONGODB_ADMIN_PASS=<DB ROOT PASSWORD>
MONGODB_APPLICATION_DATABASE=kpidashboard
MONGODB_APPLICATION_USER=<DB APPLICATION USER>
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
corsFilterValidOrigin = "UI laodbalancer IP/DNS"
forgotPassword.uiHost= "UI laodbalancer IP/DNS"
versionnumber="the current version"
JAVA_OPTS=
(Optional) This will assign external variables to the applicationauth.secret: <Pass your auth key>
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:
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.
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.
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:
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()"
Edit the deployment in following order
mongodb
customapi
ui
jira-processor
devops-processor
azure-pipeline-repo
azure-board-processor
bykubectl edit deploy <Deploy name> -o yaml
Replace the tag version with the latest version in image section
Check for environmental variable section and add if any variables are missing in current manifest file Refer this docs . And save it.