beckn / beckn-onix

beckn onix
MIT License
41 stars 23 forks source link

K8s Setup for Protocol Server BAP #128

Closed viraj89 closed 3 months ago

viraj89 commented 4 months ago

Description

Set up a Kubernetes (K8s) cluster with 1 master node and 1 worker node for the BAP Protocol Server. This setup will facilitate the deployment, management, and scaling of the BAP Protocol Server within the Beckn infrastructure.

Goals

DevOps Tasks

  1. Provision Infrastructure

    • Launch EC2 instances or equivalent virtual machines for the master and worker nodes.
    • Ensure instances have adequate resources (CPU, RAM, Storage) for Kubernetes.
  2. Install Kubernetes

    • Install Kubernetes on both the master and worker nodes.
    • Set up kubectl on the master node for cluster management.
  3. Configure Master Node

    • Initialize the Kubernetes cluster on the master node.
    • Install necessary network plugins (e.g., Calico) for pod networking.
    • Set up appropriate security configurations.
  4. Add Worker Node

    • Join the worker node to the cluster.
    • Verify communication between master and worker nodes.
  5. Deploy BAP Protocol Server

    • Create and apply deployment configurations for the BAP Protocol Server.
    • Ensure the BAP Protocol Server is running smoothly within the cluster.
  6. Monitoring and Maintenance

    • Set up monitoring tools to keep track of cluster health and performance.
    • Ensure regular maintenance and updates are performed on the cluster.

Expected Outcome

A fully functional Kubernetes cluster with 1 master and 1 worker node, ready to host the BAP Protocol Server for the Beckn infrastructure.

Acceptance Criteria

Product Name

Beckn

Domain

DevOps

Tech Skills Needed

Complexity

Medium

Category

Infrastructure Setup

prasad-takale-eminds commented 3 months ago

We have created the k8s deployment yml files for BAP PS and deployed it on k8s cluster for performance testing.

prasad-takale-eminds commented 3 months ago

We deployed the PS server using k8s. Please find the deployment file for PS below.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: bap-network
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bap-network
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: bap-network
    spec:
      containers:
      - image: fidedocker/protocol-server:develop
        name: bap-network
        ports:
        - containerPort: 5002
          protocol: TCP
        volumeMounts:
        - mountPath: /usr/src/app/config
          name: bap-network-configmap
      volumes:
      - name: bap-network-configmap
        configMap:
          name: bap-network-configmap

Client

apiVersion: apps/v1
kind: Deployment
metadata:
  name: bap-client
spec:
  replicas: 1
  selector:
    matchLabels:
      app: bap-client
  strategy:
    type: Recreate
  template:
    metadata:
      labels:
        app: bap-client
    spec:
      containers:
      - image: fidedocker/protocol-server:develop
        name: bap-client
        ports:
        - containerPort: 5001
          protocol: TCP
        volumeMounts:
        - mountPath: /usr/src/app/config
          name: bap-client-data-volume
        resources:
          requests:
            cpu: 500m
            memory: "1Gi"
          limits:
            cpu: 900m
            memory: "2Gi"
      volumes:
      - name: bap-client-data-volume
        persistentVolumeClaim:
          claimName: bap-client-data-pvc