ibm-business-automation-insights-dev
by Helm
A Helm chart for IBM Business Automation Insights
About this chart
IBM Business Automation Insights Helm Chart, developer edition
Introduction
This Helm chart deploys IBM Business Automation Insights, developer edition. IBM Business Automation Insights is a platform-level component that provides visualization insights to business owners and that feeds a data lake to infuse artificial intelligence into IBM Digital Business Automation.
You can read specific instructions for the installation on Minikube at https://github.com/icp4a/cert-kubernetes/blob/19.0.1/BAI/platform/minikube/README.md .
Chart Details
This chart deploys:
- An Apache Flink processing engine, which includes:
-
A Kubernetes deployment which creates a pod running Flink job manager
-
A Kubernetes statefulset which creates pods running Flink task managers
-
A Kubernetes statefulset which creates pods running Apache Zookeeper
-
Kubernetes jobs to register Flink jobs to the Flink job manager:
- A processor for IBM Business Automation Workflow BPMN events
- A processor for IBM Business Automation Workflow Advanced events
- A processor for IBM Case Manager events
- A processor for IBM Operational Decision Manager events
- A processor for IBM Content Platform Engine events
-
- A Kubernetes job which initializes Kafka topics and Elasticsearch/Kibana data.
- A Kubernetes deployment which creates pods running the administration REST API.
Prerequisites
- A Kubernetes cluster, version 1.11 or later
- Tiller 2.9.1 or later
- Persistent volumes for long-term storage
- Ideally, at least 3 amd64 Kubernetes nodes
- Elasticsearch resource needs are entirely based on your environment. For helpful information to plan the necessary resources, read the capacity planning guide.
- An Apache Kafka cluster, version 1.0.x, 1.1.x, or 2.0.x
Resources Required
By default, this Developer Edition of the Helm chart requires the following minimum resources:
| Component | Number of replicas | CPU/pod | Memory/pod (Mi) |
|---|---|---|---|
| Flink task managers | 2** | 1 | 1280 |
| Flink job manager | 1 | 0.1* | 256* |
| ZooKeeper | 1 | 0.1 | 640 |
| Administration REST API | 1 | 0.003* | 50* |
| Setup Job | 1 | 0.2* | 50* |
The settings marked with an asterisk (*) can be configured.
(**) TaskManager replicas are added or removed depending on the number of installed processing jobs and their parallelism.
PodSecurityPolicy Requirements
This chart requires a PodSecurityPolicy resource to be bound to the target namespace before installation. To meet this requirement, you might have to scope a specific cluster and namespace.
The predefined PodSecurityPolicy resource named ibm-anyuid-psp has been verified for this chart. If your target namespace is bound to it, you can proceed to install the chart.
However, since with this Developer Edition you have no other choice than to install Elasticsearch and Kibana as part of IBM Business Automation Insights through the ibm-dba-ek subchart, you must also set up the proper PodSecurityPolicy, Role, ServiceAccount, and RoleBinding Kubernetes resources to allow the pods running Elasticsearch to run privileged containers. The reason for this requirement is to meet the production settings stated officially by the Elasticsearch documentation. To achieve this, you must set up a Custom PodSecurityPolicy definition:
1- Adapt the following YAML content to reference your Kubernetes namespace and Business Automation Insights Helm release name, and save it to a file as bai-psp.yml, which sets up the Custom PodSecurityPolicy definition:
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
annotations:
kubernetes.io/description: "This policy is required to allow `ibm-dba-ek` pods running Elasticsearch to use privileged containers."
name: <RELEASE_NAME>-bai-psp
spec:
privileged: true
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
fsGroup:
rule: RunAsAny
volumes:
- '*'
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: <RELEASE_NAME>-bai-role
namespace: <NAMESPACE>
rules:
- apiGroups:
- extensions
resourceNames:
- <RELEASE_NAME>-bai-psp
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: <RELEASE_NAME>-bai-psp-sa
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: <RELEASE_NAME>-bai-rolebinding
namespace: <NAMESPACE>
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: <RELEASE_NAME>-bai-role
subjects:
- kind: ServiceAccount
name: <RELEASE_NAME>-bai-psp-sa
namespace: <NAMESPACE>
2- execute:
kubectl create -f bai-psp.yaml -n <NAMESPACE>
This allows pods running Elasticsearch to execute sysctl commands to set:
max_map_count=262144vm.swappiness=1
If you cannot or do not want to allow running privileged Elasticsearch containers, you can still install IBM Business Automation Insights but you must configure it to use an external Elasticsearch (in the Helm values, set elasticsearch.install: false).
Note also that when deploying IBM Business Automation Insights on IBM Cloud, the Flink init container needs to be run as privileged, such that it can
change the ownership and permissions of its storage directory. For details, see https://cloud.ibm.com/docs/containers?topic=containers-cs_troubleshoot_storage#file_app_failures
and https://cloud.ibm.com/docs/containers?topic=containers-cs_troubleshoot_storage#cs_storage_nonroot. As it is not needed on other deployment platforms, the
initialization is not done by default. If required by the deployment platform, specify flink.initStorageDirectory: true in the Helm values.
If you are upgrading from a previous version of IBM Business Automation Insights, undo the previous security policy changes:
- If you are upgrading from 18.0.0, roll back the changes that you made through the
kubectl edit clusterrolebinding privileged-psp-userscommand when you installed IBM Business Automation Insights 18.0.0. To achieve this, you must call againkubectl edit clusterrolebinding privileged-psp-usersto edit the ClusterRoleBinding and delete the following lines:
- apiGroup: rbac.authorization.k8s.io
kind: Group
name: system:serviceaccounts:<NAMESPACE>
-
If you are upgrading from IBM Business Automation Insights 18.0.1 or 18.0.2 , remove the ClusterRole and ClusterRoleBinding resources.
kubectl delete clusterrole <your-clusterrole> kubectl delete clusterrolebinding <your-clusterrole-binding>
Network Policy
The deployment of IBM Business Automation Insights includes a default Kubernetes network policy which allows all ingress and egress traffic. You can deploy more restrictive policies. For further information on network policies, see https://kubernetes.io/docs/concepts/services-networking/network-policies/.
Red Hat OpenShift SecurityContextConstraints Requirements
If you are installing the chart on Red Hat OpenShift or OKD, the ibm-anyuid-scc SecurityContextConstraint is required to install the chart.
If you are planning to install Elasticsearch and Kibana as part of IBM Business Automation Insights on Red Hat OpenShift or OKD, you must also create a service account that has the ibm-privileged-scc SecurityContextConstraint to allow running privileged containers:
$ oc create serviceaccount <RELEASE_NAME>-bai-psp-sa
$ oc adm policy add-scc-to-user ibm-privileged-scc -z <RELEASE_NAME>-bai-psp-sa
If you cannot or do not want to allow running privileged containers, you can still install IBM Business Automation Insights but you must configure it to use an external Elasticsearch (in the Helm values, set elasticsearch.install: false).
Storage
In the current section, <nfs-shared-path> is a path that is NFS-shared by the NFS server with IP equals to <server-ip>. You must ensure that your Kubernetes nodes have a very fast access to the NFS shared folders. Usually, the NFS share is set up on the master node of your Kubernetes cluster.
IBM Business Automation Insights required storage
A persistent volume is required if no dynamic provisioning has been set up. It must provide enough space to fit the
flinkPv.capacity requirement in values.yaml (20Gi by default).
apiVersion: v1
kind: PersistentVolume
metadata:
name: ibm-bai-pv
spec:
accessModes:
- ReadWriteMany
capacity:
storage: 20Gi
nfs:
path: <nfs-shared-path>/ibm-bai-pv
server: <server-ip>
persistentVolumeReclaimPolicy: Retain
claimRef:
namespace: <my-namespace>
name: <my-pvc-name>
The persistent volume path must be readable and writable by the bai user and group under ID 9999. It is recommended to use the Retain
reclaim policy to make sure data is kept on release.
The chart automatically picks a volume that matches its requirements, which should be sufficient for evaluation purposes.
The claimRef section is optional but you must use it in production mode to make sure your release will always use the same
volume and not lose your data. The claimRef section and the flinkPv.existingClaimName property must then reference a
specific claim created as follows:
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: <my-pvc-name>
spec:
storageClassName: ""
accessModes:
- ReadWriteMany
resources:
requests:
storage: <storage_size>
Setting up persistent volumes for Elasticsearch data
If you plan to install Elasticsearch and Kibana as part of IBM Business Automation Insights through the ibm-dba-ek subchart and if no dynamic provisioning has been set up, it is required that you create a persistent volume per data and master pods. For details, see the official documentation describing how to setup Elasticsearch storage
Documentation
The IBM Business Automation Insights online documentation is here.
Installing the Chart
To install the chart with release name my-release:
$ helm install --name my-release ibm-business-automation-insights-dev -f my-values.yaml
The command deploys ibm-business-automation-insights-dev onto the Kubernetes cluster, based on the values specified in my-values.yaml file. The configuration section lists the parameters that can be configured during installation.
Note: If you are running on IBM Cloud Private, you must add --tls argument to all helm commands referenced in this README.
Verifying the Chart
See the instruction after the Helm installation completes for chart verification. You can also execute the following command to retrieve the instruction of the Helm release:
$ helm status my-release
Note: If you are running on IBM Cloud Private, you can also display the instruction by viewing the installed Helm release under Menu -> Workloads -> Helm Releases.
Upgrading or rolling back the release
Prerequisite
Before upgrading or rolling back the release, you must first delete all the Kubernetes jobs that are running:
- To retrieve the job names, run the Kubernetes get command:
$ kubectl get jobs -–selector=release=<release-name> --namespace <my-namespace>
- Run the Kubernetes delete command on each job in the list.
$ kubectl delete job <job-name> --namespace <my-namespace>
Upgrading the release
To upgrade the release, execute the following command where bai-values.yaml contains the Helm values that you want to add or override. If you don't want or don't need to add or override Helm values, do not provide the --values bai-values.yaml argument:
$ helm upgrade my-release ibm-business-automation-insights-dev --reuse-values --values bai-values.yaml
Important: If the release upgrade also includes a new Helm chart version, do not pass the --reuse-values argument.
Rolling back the release
You can roll back the Helm release to a previous revision.
To retrieve the release upgrade history, execute the following command:
$ helm history my-release
You can roll back the current release to a previous version by executing the following helm command where <REVISION> is the upgrade revision from the release upgrade history:
$ helm rollback my-release <REVISION>
Uninstalling the Chart
To uninstall or delete the my-release deployment:
$ helm delete my-release --purge
The command removes all the Kubernetes components associated with the chart and deletes the release.
Configuration
Gen
Deploy ibm-business-automation-insights-dev with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has ibm-business-automation-insights-dev 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartibm-business-automation-insights-dev is pinned at v3.2.0 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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