ibm-pem-standard-prod

by joaquinito2051

Helm chartv1.5.3App 6.2.4.7Apache-2.0

IBM® Sterling Partner Engagement Manager (PEM) reduces the time and resources required to onboard new partners while managing and maintaining existing partners. By automating the onboarding process, Partner Engagement Manager limits costly manual errors and increases efficiency as partners can maintain their own records. Documentation For additional details regarding install parameters check https://www.ibm.com/docs/en/spems/6.2.4?topic=container-prerequisites. License By installing this product you accept the license terms https://www14.software.ibm.com/cgi-bin/weblap/lap.pl?li_formnum=L-AZZP-8HTUVZ&title=IBM%20PEM%20Certified%20Container."

About this chart

IBM Partner Engagement Manager

Introduction

Chart Details

This chart deploys IBM Partner Engagement Manager Standard cluster on a container management platform with the following resources.

Prerequisites

  1. Kubernetes version >= 1.32 and <= 1.36

  2. Red Hat OpenShift Container Platform version >= 4.19

  3. Helm version >= 3.20.x

  4. Ensure that one of the supported database server (Oracle/DB2/MSSQL) is installed and the database is accessible from inside the cluster.

  5. Ensure that the docker images for IBM Partner Engagement Manager Standard from Entitlement registry are loaded to an appropriate docker registry.

  6. When volumeClaims.resources.enabled is true, create a persistent volume for application resources with access mode as 'ReadWriteMany' and place the database driver jar, SEAS jars and MQ jars in the mapped volume location.

  7. When volumeClaims.logs.enable is true, create a persistent volume for application logs with access mode as 'Read Write Many' and create required subfolders for IBM PEM, Partner Repository, Partner Provisioner, PCM Prod and PCM NonProd. The subfolders must have the 755 permission to read and execute, to be accessible by the pemuser (id:1011) container.

  8. When communitymanager.prod.archive.enabled is true, create a persistent volume for Prod PCM archive document storage with access mode as 'Read Write Many'.

  9. When communitymanager.nonprod.archive.enabled is true, create a persistent volume for Non-prod PCM archive document storage with access mode as 'Read Write Many'.

    Mount the archive persistent volume to PEM server

  10. When useDynamicProvisioning: true and existingClaim: i.e. empty, then the PVCs will get created automatically. By default it will be treated as true if kept empty.

  11. When useDynamicProvisioning: false and existingClaim: "your-manually-created-pvc-name", then Helm will bind to your pre-created PVCs.

Note: Dynamic PVCs are only created during the install phase, as the required pre-hook runs only at that stage.

  • To switch from dynamic PVC mode to manual PVC mode, a simple helm upgrade will work.
  • To switch from manual PVC mode to dynamic PVC mode, you must perform a fresh helm install or deployment — a helm upgrade will not work.

Steps to create a manual PVCs -

Prepare the NFS Server

i. On your NFS server VM, create the directory to be used by the PersistentVolume (PV).

ii. Ensure NFS is installed and running.

iii. Add the export path to /etc/exports, for example:

/srv/data/logs    *(rw,sync,no_root_squash)

iv. Reload exports:

exportfs -a

Create PersistentVolume (PV)

i. Save the following template as <your-pv-name> (e.g., pv-logs.yaml):

apiVersion: v1
kind: PersistentVolume
metadata:
    name: <your-pv-name>
    labels:
    intent: <your-pv-name>
spec:
    storageClassName: <storage-class>
    capacity:
    storage: <size>
    accessModes:
    - ReadWriteMany
    nfs:
    server: <nfs-server-ip>
    path: <exported-path>

ii. Apply the PV manifest:

oc apply -f <your-pv-name>.yaml

Create PersistentVolumeClaim (PVC)

i. In the OpenShift console, go to Storage → PersistentVolumeClaims.

ii. Click Create PVC, switch to YAML view, and edit the yaml and click create. Template -

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: <your-pvc-name>
  namespace: <target-namespace>
spec:
  accessModes:
    - ReadWriteMany
  volumeMode: Filesystem
  storageClassName: <storage-class>
  resources:
    requests:
      storage: <size>
  selector:
    matchLabels:
      intent: <your-pv-name>

iii. Command to check PVC status -

  oc get pvc
  1. Create secrets with requisite confidential credentials for passphrase.txt, Keystore.jks dbpasswords and keystore passwords. You can use the supplied configuration files under pak_extensions/pre-install/secret directory.

  2. Create a secret from the provided syntax file included in helm charts /ibm-cloudpak-extensons/preinstall/secrets.yaml

      oc apply -f app-secrets.yaml
    
  3. Create a secret to pull the image from a private registry or repository using following command:

    oc create secret docker-registry <name of secret> --docker-server=<your-registry-server> --docker-username=<your-username> --docker-password=<your-password> --docker-email=<your-email>
    
  4. Create secrets with confidential certificates (Keystore files for both Partner Engagement Manager and Community Manger) required by Database, MQ for SSL connectivity using below command:

    Note: Name of the secret and the keystore filename must be same for server keystore secret

     oc create secret generic <secret-name> --from-file=/path/to/<Keystore.jks>
    
  5. Create configmap with localtime file present in local machine using below command

     oc create configmap <configmap-name> --from-file=/etc/localtime
    
  6. When installing the chart on a new database which does not have IBM PEM standard Software schema tables and metadata,

  • ensure that dbsetup.upgrade parameter is set to false and dbsetup.enabled parameter is set to true. This will create the required database tables and metadata in the database before installing the chart.
  1. When installing the chart on a database with new image upgrade,
  • ensure that dbsetup.upgrade parameter is set to true.
  1. Create service account and apply security context contraints to created service account.

     oc create sa <service account name>
    
     oc adm policy add-scc-to-user ibm-pem-scc system:serviceaccount:<namespace>:<service account name>
    

    Note: Avoid installing multiple charts on same namespace

  2. For installing Community Manager, the JWT_SECRET_KEY must be defined in a Kubernetes/OpenShift Secret. If this value is not available, the Helm install or upgrade will fail. The name of the Secret containing the JWT_SECRET_KEY must be specified in the values.yaml file under communitymanager.prod.setupfile.jwt.secretkey or communitymanager.nonprod.setupfile.jwt.secretkey, depending on the environment.

  3. For installing Community Manager with SAML authentication enabled, the SAML_JWT_SECRET_KEY must also be defined in a Kubernetes/OpenShift Secret. The Helm install or upgrade will fail if this value is not provided. The name of the Secret containing the SAML_JWT_SECRET_KEY must be specified in the values.yaml file under communitymanager.prod.setupfile.saml.jwt.secretkey or communitymanager.nonprod.setupfile.saml.jwt.secretkey, depending on the environment.

PodSecurityPolicy Requirements

This chart requires a PodSecurityPolicy to be bound to the target namespace prior to installation. Choose either a predefined PodSecurityPolicy or have your cluster administrator create a custom PodSecurityPolicy for you:

This chart optionally defines a custom PodSecurityPolicy which is used to finely control the permissions/capabilities needed to deploy this chart. It is based on the predefined PodSecurityPolicy name: ibm-restricted-psp with extra required privileges. You can enable this policy by using the Platform User Interface or configuration file available under pak_extensions/pre-install/ directory

  • From the user interface, you can copy and paste the following snippets to enable the custom PodSecurityPolicy Note: For kubernetes version 1.25 or higher apiVersion for the PodSecurityPolicy should be policy/v1
    • Custom PodSecurityPolicy definition:

      apiVersion: policy/v1beta1
      kind: PodSecurityPolicy
      metadata:
        name: "ibm-pem-psp"
        labels:
          app: "ibm-pem-psp"
      
      spec:
        privileged: false
        allowPrivilegeEscalation: false
        hostPID: false
        hostIPC: false
        hostNetwork: false
        allowedCapabilities:
        requiredDropCapabilities:
        - MKNOD
        - AUDIT_WRITE
        - KILL
        - NET_BIND_SERVICE
        - NET_RAW
        - FOWNER
        - FSETID
        - SYS_CHROOT
        - SETFCAP
        - SETPCAP
        - CHOWN
        - SETGID
        - SETUID
        - DAC_OVERRIDE
        allowedHostPaths:
        runAsUser:
          rule: MustRunAs
          ranges:
          - min: 1
            max: 4294967294
        runAsGroup:
          rule: MustRunAs
          ranges:
          - min: 1
            max: 4294967294
        seLinux:
          rule: RunAsAny
        supplementalGroups:
          rule: MustRunAs
          ranges:
          - min: 1
            max: 4294967294
        fsGroup:
          rule: MustRunAs  
          ranges:
          - min: 1
            max: 4294967294
        volumes:
        - configMap
        - emptyDir
        - projected
        - secret
        - downwardAPI
        - persistentVolumeClaim
        - nfs
        forbiddenSysctls:
        - '*'
      
    • Custom ClusterRole for the custom PodSecurityPolicy:

      apiVersion: rbac.authorization.k8s.io/v1
      kind: ClusterRole
      metadata:
        name: "ibm-pem-psp"
        labels:
          app: "ibm-pem-psp"
      rules:
      - apiGroups:
        - policy
        resourceNames:
        - "ibm-pem-psp"
        resources:
        - podsecuritypolicies
        verbs:
        - use
      
    • apiGroups:

      • "" resources:
      • secrets verbs:
      • get
      • list
      • patch
      • update
    • apiGroups:

      • apps resources:
      • deployments verbs:
      • get
      • list
      • patch
      • update
  • Create a rolebinding for the above role and the service account:
    kind: RoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: <rolebinding name>
      namespace: <namespace>
    subjects:
      - kind: ServiceAccount
        name: <service account>
        namespace: <namespace>
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: Role
      name: ibm-pem-psp
    

SecurityContextConstraints Requirements

This chart optionally defines a custom SecurityContextConstraints (on Red Hat OpenShift Container Platform) which is used to finely control the permissions/capabilities needed to deploy this chart. It is based on the predefined SecurityContextConstraint name: ibm-restricted-scc with extra required privileges.

  • Custom SecurityContextConstraints definition:

    apiVersion: security.openshift.io/v1
    kind: SecurityContextConstraints
    metadata:
      name: ibm-pem-scc
      labels:
       app: "ibm-pem-scc"
    allowHostDirVolumePlugin: false
    allowHostIPC: false
    allowHostNetwork: false
    allowHostPID: false
    allowHostPorts: false
    privileged: false
    allowPrivilegeEscalation: false
    allowPrivilegedContainer: false
    allowedCapabilities:
    allowedFlexVolumes: []
    allowedUnsafeSysctls: []
    defaultAddCapabilities: []
    defaultAllowPrivilegeEscalation: false
    forbiddenSysctls:
      - "*"
    fsGroup:
      type: MustRunAs
      ranges:
      - min: 1
        max: 4294967294
    readOnlyRootFilesystem: false
    requiredDropCapabilities:
    - MKNOD
    - AUDIT_WRITE
    - KILL
    - NET_BIND_SERVICE
    - NET_RAW
    - FOWNER
    - FSETID
    - SYS_CHROOT
    - SETFCAP
    - SETPCAP
    - CHOWN
    - SETGID
    - SETUID
    - DAC_OVERRIDE
    runAsUser:
      type: MustRunAsRange
    # This can be customized for your host machine
    seLinuxContext:
      type: RunAsAny
    # seLinuxOptions:
    #   level:
    #   user:
    #   role:
    #   type:
    supplementalGroups:
      type: MustRunAs
      ranges:
      - min: 1
        max: 4294967294
    # This can be customized for your host machine
    volumes:
    - configMap
    - downwardAPI
    - emptyDir
    - persistentVolumeClaim
    - projected
    - secret
    - nfs
    priority: 0
    
  • Custom ClusterRole for the custom SecurityContextConstraints:

    apiVersion: rbac.authorization.k8s.io/v1
    kind: ClusterRole
    metadata:
     name: "ibm-pem-scc"
     labels:
      app: "ibm-pem-scc"
    rules:
    - apiGroups:
      - security.openshift.io
      resourceNames:
      - "ibm-pem-scc"
      resources:
      - securitycontextconstraints
      verbs:
      - use
    - apiGroups:
      - ""
      resources:
      - secrets
      verbs:
      - get
      - list
      - patch
      - update
    - apiGroups:
      - apps
      resources:
      - deployments
      verbs:
      - get
      - list
      - patch
      - update
    
  • Create a rolebinding for the above role and the service account:

    kind: RoleBinding
    apiVersion: rbac.authorization.k8s.io/v1
    metadata:
      name: <rolebinding name>
      namespace: <namespace>
    subjects:
      - kind: ServiceAccount
        name: <service account>
        namespace: <namespace>
    roleRef:
      apiGroup: rbac.authorization.k8s.io
      kind: Role
      name: ibm-pem-scc
    

Resources Required

Configuration

The following table lists the configurable parameters for the chart

PodMemory RequestedMemory LimitCPU RequestedCPU Limit
PEM Portal pod4 Gi8 Gi12
PP pod2 Gi4 Gi12
PR pod2 Gi4 Gi12
API Gateway pod2 Gi

Deploy ibm-pem-standard-prod with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-pem-standard-prod on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartibm-pem-standard-prod is pinned at v1.5.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply