[]
        
(Showing Draft Content)

Deploying to Kubernetes Cluster using Helm Chart

Kubernetes (K8S) Cluster is a set of interconnected nodes that are used to run containerized applications. Kubernetes provides an automated framework for deploying, scaling, and managing containerized applications across a cluster of nodes. In the K8S cluster, there are two types of nodes,

  1. Control Plane Nodes: Control plane nodes manage the cluster and coordinate the overall system. Control plane nodes run components such as API server, scheduler, and controller manager.

  2. Worker Nodes: Worker nodes are the nodes where the actual containerized applications are deployed and executed. Worker nodes are managed by the control plane nodes and execute tasks as directed.

Each worker node in a K8S Cluster can run multiple containers, which are grouped into logical units called Pods. Pods are the smallest deployable units in Kubernetes. Pods contain one or more containers and are used to share networking and storage resources.

K8S uses a declarative approach to manage applications where you define the desired state of the application, including the resource requirements, number of replicas, and other configuration items in a set of YAML or JSON files called Manifests. To learn more about Kubernetes' various components, refer to the Kubernetes Documentation.

Combining the capabilities of Helm with Kubernetes you can simplify the deployment and management of applications on the K8S cluster. Helm uses packages called Charts that allow you to define, install, and upgrade even the most complex Kubernetes applications. Helm Chart is a tool used to deploy the Wyn Enterprise application in a Kubernetes cluster. Helm charts simplify the deployment process by encapsulating all the necessary configurations, dependencies, and resources required for an application to run within Kubernetes. For more information on Helm Charts see the Helm Documentation.

In this help article, you will find the information on the following,

Design Concept of Helm Charts

With Wyn Enterprise, Helm charts use template files to create highly customizable K8S clusters. A few important configurations are listed and described below,

  1. Docker Image: The docker image is used to deploy services in the K8S cluster and is specified in the Values YAML file. Using this configuration, you can deploy multiple environments with a single Helm chart.

  2. ConfigMap: You can use ConfigMap as the configuration file. Configuration items will be exposed in the "values.yaml" file, allowing customers to customize these configurations during the installation of the Helm chart. The exposed configuration items include:

        image:
      repository: mescius/wyn-enterprise-k8s
      # tag: latest
      # secret: yourSecretName
    
    pvcName: pvc-wyn-data
    
    ingress:
      enabled: true
      apiVersion: networking.k8s.io/v1
      name: wyn-ingress
      # annotations:
      #   kubernetes.io/ingress.class: nginx
      # className: yourIngressClassName
      # tls:
      #   - hosts:
      #       - your.host.name
      #     secret: yourSecretName
      rules:
        - paths:
            - /
          # host: your.host.name
    
    #nodePort: 30000
    
    identityServerUrl: http://wyn-server:51980
    database:
      provider: Postgres|SqlServer|MySql|Oracle
      connectionStrings:
        dataExtraction: Host=server_host;Port=server_port;UserName=db_user;Password=db_password;Database=wyndatacache;
        serverStorage:  Host=server_host;Port=server_port;UserName=db_user;Password=db_password;Database=wynserverdata;
        identityServer: Host=server_host;Port=server_port;UserName=db_user;Password=db_password;Database=wynis;
    
    # importSamples: true
    # singleServer: false
    # logLevel: Debug
    # pathBase: /wyn
    # requireHttps: false
    # removeLineBreakFromConsoleLog: false
    # dataWarehouse:
    #   provider: MonetDB
    #   connectionString: host=localhost;port=54321;username=monetdb;password=monetdb;database=wyndw;
    # cookie:
    #   shareCookie: false
    #   sameSite: Lax
    #   secure: false
    # sso:
    #   authenticationProtocol: OIDC|CAS
    #   scheme: yourSchemeName
    #   disabled: false
    #   allowIncognizantUser: true
    #   casServerUrlBase: https://localhost:8443/cas
    #   casServerLogoutUrl: https://localhost:8443/cas/logout
    #   casServerProtocolVersion: 3
    #   authority: https://your.authority.com
    #   metadataAddress: https://your.authority.com/.well-known/openid-configuration?uid=xxx
    #   clientId: yourClientId
    #   clientSecret: yourClientSecret
    #   scopes:
    #     - openid
    #     - profile
    #     - email
    #   callbackPath: /signin-oidc
    #   responseType: code id_token
    #   responseMode: from_post
    #   requireHttpsMetadata: false
    #   getClaimsFromUserInfoEndpoint: true
    #   saveTokens: true
    #   usePkce: false
    #   claimMappings:
    #     - key: sub
    #       value: sub
    #     - key: name
    #       value: nickname
    # cors:
    #   allowedOrigins:
    #     - http://localhost:3000
    #     - http://localhost:8080
    #   exposedHeaders:
    #     - Options
    #     - Location
    
    server:
      replicas: 1
      enabled: true
      # image:
      #   repository: mescius/wyn-enterprise-k8s
      #   tag: 6.1.00225.0
      #   secret:
      # resources:
      #   requests:
      #     cpu: "1"
      #     memory: "2Gi"
      #   limits:
      #     cpu: "2"
      #     memory: "4Gi"
    analysisDbService:
      enabled: true
    schedulerService:
      enabled: true
    memoryDbService:
      enabled: true
    dataSourceService:
      enabled: true
    cotWorker:
      enabled: true
      replicas: 1
    reportingWorker:
      enabled: true
      replicas: 1
    dashboardWorker:
      enabled: true
      replicas: 1
    
    # redis:
    #   image:
    #     repository: redis
    #     tag: latest
  3. Persistent Volume (PV) and Persistent Volume Claim (PVC): In the above sample Values YAML file, configurations to create PV and PVC are available using which the Wyn services can store data. In general, Persistent Volume (PV) is provisioned by an administrator or is dynamically provisioned using a storage class and for Helm charts, you only need a PVC definition. However, when uninstalling a helm chart, both PV and PVC defined in the Helm chart will be removed and the PV cannot be bound again. In such a scenario, both PV and PVC should be retained by you in order to reuse the PV. You only need the name of the PVC to use it instead of creating or deleting it. Below is a sample instance of the configuration of PV and PVC,

        apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: pv-wyn-data
      labels:
        type: local
    spec:
      capacity:
        storage: 30Gi
      accessModes:
        - ReadWriteMany
      hostPath:
        path: /mnt/nfs/share/wyn/
    ---
    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: pvc-wyn-data
    spec:
      accessModes:
        - ReadWriteMany
      resources:
        requests:
          storage: 30Gi
  4. Ingress: Ingress introduces HTTP and HTTPS routes outside the K8S cluster to the services within the K8S cluster. Ingress provides features like load balancing, SSL termination, and name-based virtual hosting. Various Ingress controllers are provided on different platforms and below is an instance of Ingress configuration from a sample Values YAML file,

        ingress:
      enabled: true
      apiVersion: networking.k8s.io/v1
      name: wyn-ingress
      # annotations:
      #   kubernetes.io/ingress.class: nginx
      # className: yourIngressClassName
      # tls:
      #   - hosts:
      #       - your.host.name
      #     secret: yourSecretName
      rules:
        - host: your.host.name
          paths:
            - /
  5. Resource Limits: Kubernetes (K8S) empowers you to precisely define resource requirements and limits for containers, primarily focusing on crucial resources like CPU and memory. For instance, customers can effectively control the resource utilization of the Wyn service by configuring settings within the Values YAML (values.yaml) file as follows,

        wynConfig:
      services:
        server:
          resources:
            requests:
              cpu: "1"
              memory: "1Gi"
            limits:
              cpu: "2"
              memory: "2Gi"
        schedulerService:
          resources:
            requests:
              cpu: "0.5"
              memory: "200Mi"
            limits:
              cpu: "1"
              memory: "500Mi"

Deployment Steps

Before deploying the Wyn Enterprise application in the K8S cluster using Helm Chart ensure the following;

  1. You have installed a K8s environment with at least two worker nodes.

  2. You have installed the Helm package manager. Refer to the Installing Helm help article for information on installing Helm.

  3. You have an understanding of the common K8S objects such as PV, PVC, StorageClass, Ingress, etc. For more information on the common K8S objects see the Using Helm help article.

Follow the below instructions to deploy the Wyn Enterprise application in a K8S cluster using Helm Chart,

  1. Add the Helm repository using the following command,

    helm repo add wyn https://{your-official-Helm-chart-repository-address}/packages/helm/
  2. Update the Helm repository using the following command,

    helm repo update
  3. Create PV and PVC resources: Deploying the Wyn Enterprise application in a K8S cluster requires a PVC resource and the recommended storage request of the resource is 50 GB. The following code snippets show a sample YAML file that defines the PV and PVC resources in a local environment,

    • PV Resource:

          apiVersion: v1
      kind: PersistentVolume
      metadata:
      name: pv-wyn-data
      labels:
          type: local
      spec:
      capacity:
          storage: 30Gi
      accessModes:
          - ReadWriteMany
      hostPath:
          path: /mnt/nfs/share/wyn/
    • PVC Resource:

      apiVersion: v1
      kind: PersistentVolumeClaim
      metadata:
      name: pvc-wyn-data
      spec:
      accessModes:
          - ReadWriteMany
      resources:
          requests:
          storage: 30Gi
  4. Prepare Configurations: All available configurations are listed below, edit them as needed,

        image:
            repository: mescius/wyn-enterprise-k8s
            # tag: latest
            # secret: yourSecretName
    
        pvcName: pvc-wyn-data
    
        ingress:
            enabled: true
            apiVersion: networking.k8s.io/v1
            name: wyn-ingress
            # annotations:
            #   kubernetes.io/ingress.class: nginx
            # className: yourIngressClassName
            # tls:
            #   - hosts:
            #       - your.host.name
            #     secret: yourSecretName
            rules:
                - paths:
                    - /
                # host: your.host.name
    
        #nodePort: 30000
    
        identityServerUrl: http://wyn-server:51980
        database:
          provider: Postgres|SqlServer|MySql|Oracle
          connectionStrings:
            dataExtraction: Host=server_host;Port=server_port;UserName=db_user;Password=db_password;Database=wyndatacache;
            serverStorage:  Host=server_host;Port=server_port;UserName=db_user;Password=db_password;Database=wynserverdata;
            identityServer: Host=server_host;Port=server_port;UserName=db_user;Password=db_password;Database=wynis;
    
        # importSamples: true
        # singleServer: false
        # logLevel: Debug
        # pathBase: /wyn
        # requireHttps: false
        # removeLineBreakFromConsoleLog: false
        # dataWarehouse:
        #   provider: MonetDB
        #   connectionString: host=localhost;port=54321;username=monetdb;password=monetdb;database=wyndw;
        # cookie:
        #   shareCookie: false
        #   sameSite: Lax
        #   secure: false
        # sso:
        #   authenticationProtocol: OIDC|CAS
        #   scheme: yourSchemeName
        #   disabled: false
        #   allowIncognizantUser: true
        #   casServerUrlBase: https://localhost:8443/cas
        #   casServerLogoutUrl: https://localhost:8443/cas/logout
        #   casServerProtocolVersion: 3
        #   authority: https://your.authority.com
        #   metadataAddress: https://your.authority.com/.well-known/openid-configuration?uid=xxx
        #   clientId: yourClientId
        #   clientSecret: yourClientSecret
        #   scopes:
        #     - openid
        #     - profile
        #     - email
        #   callbackPath: /signin-oidc
        #   responseType: code id_token
        #   responseMode: from_post
        #   requireHttpsMetadata: false
        #   getClaimsFromUserInfoEndpoint: true
        #   saveTokens: true
        #   usePkce: false
        #   claimMappings:
        #     - key: sub
        #       value: sub
        #     - key: name
        #       value: nickname
        # cors:
        #   allowedOrigins:
        #     - http://localhost:3000
        #     - http://localhost:8080
        #   exposedHeaders:
        #     - Options
        #     - Location
    
        server:
        replicas: 1
        enabled: true
        # image:
        #   repository: mescius/wyn-enterprise-k8s
        #   tag: 6.1.00225.0
        #   secret:
        # resources:
        #   requests:
        #     cpu: "1"
        #     memory: "2Gi"
        #   limits:
        #     cpu: "2"
        #     memory: "4Gi"
        analysisDbService:
            enabled: true
        schedulerService:
            enabled: true
        memoryDbService:
            enabled: true
        dataSourceService:
            enabled: true
        cotWorker:
            enabled: true
            replicas: 1
        reportingWorker:
            enabled: true
            replicas: 1
        dashboardWorker:
            enabled: true
            replicas: 1
    
        # redis:
        #   image:
        #     repository: redis
        #     tag: latest
  5. Install the Helm package using the following command,

    helm install wyn \
        -f ./values.yaml \
        wyn/wyn-enterprise

    You can also specify a namespace using the following command,

    helm install wyn \
      -f ./values.yaml \
      wyn/wyn-enterprise \
      --namespace wyn \
      --create-namespace
  6. To uninstall the Helm package use the following command,

    helm uninstall wyn

    Or

    helm uninstall wyn -n wyn