Deploying across multiple instances

Using operator-based deployment, you can also deploy multiple instances of the same version of the Product Master within a single namespace or across multiple namespaces.

Before you begin

  • Ensure that each instance uses a separate secret for database credentials.
  • Ensure that the secret is defined in the CR file by using the app_secret_name.
    app_secret_name: dev-app-secret
  • Ensure that each instance has its own TLS certificate.
    certs_secret_name: dev-tls-secret
  • Ensure that each instance uses separate domain names to enable ingress to create distinct routes for each instance, and thus ensuring proper access to the application.
  • Ensure that you create a unique certs_secret_name for each instance and provide the corresponding domain certificates. (Example: dev-tls-secret, prod-tls-secret).
    kubectl get ingress
    Output
    
    NAME                               HOSTS                  PORTS   AGE
    dev-productmaster-ingress         dev.example.com        80      10d
    prod-productmaster-ingress        prod.example.com       80      10d
    
  • Ensure that hardware and software requirements are met.
  • Reserve cluster resources based on the number of instances to be deployed.
  • You have completed Steps#1 to 6 of the Installation (containerized) topic.

About this task

Each instance is identified by a unique instance_name that ensures that the resources (Pods, Services, ConfigMaps, and so on) are correctly provisioned without any conflicts. The instance_name is defined in the Custom Resource (CR) file.

Following are some key benefits of the multi-instance deployment.
Enhanced security
Ensures that the organization-wide security policies remain intact.
Scalability
Ensures that multiple applications can be deployed efficiently.
Customizable single-sign on (SSO)
Each instance can have its own SSO integration.
Resource optimization
Ensures optimal utilization of cluster resources.
Independent upgrades
Ensures that specific instances can be independently upgraded.

Procedure

For deploying separate instances in different namespaces, proceed as follows.

  1. Create directories for volumes by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    mkdir -p /mnt/ipm14/<instance_name> 
    cd /mnt/ipm14/<instance_name> 
    mkdir admin
    mkdir ftsindlog
    mkdir ftspimlog
    mkdir gds
    mkdir ml
    mkdir mongodb
    mkdir mongodblog
    mkdir mq-data
    mkdir personaui
    mkdir sch
    mkdir wfl
    mkdir appdata
    mkdir elasticsearch-data
    mkdir restapi
    mkdir magento-connector
  2. Download the multiInstance_volumes.yaml file by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-appdata-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-appdata-volume
    spec:
      capacity:
        storage: 10Gi
      accessModes:
        - ReadWriteMany
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/instance_name/appdata
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-admin-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-admin-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/admin
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-ftsind-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-ftsind-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/ftsindlog
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-ftspim-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-ftspim-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/ftspimlog
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-gds-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-gds-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/gds
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-ml-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-ml-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/ml
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-mongodb-data-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-mongodb-data-volume
    spec:
      capacity:
        storage: 1Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/mongodb
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-mongodb-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-mongodb-log-volume
    spec:
      capacity:
        storage: 1Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/mongodblog
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-mq-data-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-mq-data-volume
    spec:
      capacity:
        storage: 1Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /home/mq-data
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-personaui-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-personaui-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/personaui
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-restapi-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-restapi-log-volume
    spec:
      capacity:
        storage: 5Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/restapi
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-sch-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-sch-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/sch
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-wfl-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-wfl-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/wfl
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-magento-connector-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-magento-connector-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/magento-connector
    ---
    kind: PersistentVolume
    apiVersion: v1
    metadata:
      name: ${instance_name}-messagearchive-log-volume
      namespace: productmaster
      labels:
        svc: ${instance_name}-messagearchive-log-volume
    spec:
      capacity:
        storage: 2Gi
      accessModes:
        - ReadWriteOnce
      storageClassName: standard
      hostPath:
        path: /mnt/ipm14/${instance_name}/messagearchive
  3. Apply the volume configurations by using the following command.
    Self-managed Kubernetes cluster Amazon EKS cluster
    export INSTANCE_NAME="<instance_name>"
    envsubst < multiInstance_volumes.yaml | kubectl apply -f -
  4. Specify the following properties in the CR file depending upon your instance type.
    Red Hat® OpenShift® cluster Self-managed Kubernetes cluster Amazon EKS cluster

    The instance_name is used as a prefix for all the Kubernetes objects created by the operator.

    Instance type name instance name domain name
    Development instance dev-namespace dev dev.example.com
    Production instance prod-namespace prod prod.example.com
    Clean instance productmaster productmaster-prod host.example.com