Chapter 1. Deploying Data Grid clusters as Helm chart releases
Chapter 1. Deploying Data Grid clusters as Helm chart releases Build, configure, and deploy Data Grid clusters with Helm. Data Grid provides a Helm chart that packages resources for running Data Grid clusters on OpenShift. Install the Data Grid chart to create a Helm release, which instantiates a Data Grid cluster in your OpenShift project. 1.1. Installing the Data Grid chart through the OpenShift console Use the OpenShift Web Console to install the Data Grid chart from the Red Hat developer catalog. Installing the chart creates a Helm release that deploys a Data Grid cluster. Prerequisites Have access to OpenShift. Procedure Log in to the OpenShift Web Console. Select the Developer perspective. Open the Add view and then select Helm Chart to browse the Red Hat developer catalog. Locate and select the Data Grid chart. Specify a name for the chart and select a version. Define values in the following sections of the Data Grid chart: Images configures the container images to use when creating pods for your Data Grid cluster. Deploy configures your Data Grid cluster. Tip To find descriptions for each value, select the YAML view option and access the schema. Edit the yaml configuration to customize your Data Grid chart. Select Install . Verification Select the Helm view in the Developer perspective. Select the Helm release you created to view details, resources, and other information. 1.2. Installing the Data Grid chart on the command line Use the command line to install the Data Grid chart on OpenShift and instantiate a Data Grid cluster. Installing the chart creates a Helm release that deploys a Data Grid cluster. Prerequisites Install the helm client. Add the OpenShift Helm Charts repository . Have access to an OpenShift cluster. Have an oc client. Procedure Create a values file that configures your Data Grid cluster. For example, the following values file creates a cluster with two nodes: Install the Data Grid chart and specify your values file. Tip Use the --set flag to override configuration values for the deployment. For example, to create a cluster with three nodes: Verification Watch the pods to ensure all nodes in the Data Grid cluster are created successfully. 1.3. Upgrading Data Grid Helm releases Modify your Data Grid cluster configuration at runtime by upgrading Helm releases. Prerequisites Deploy the Data Grid chart. Have a helm client. Have an oc client. Procedure Modify the values file for your Data Grid deployment as appropriate. Use the helm client to apply your changes, for example: Verification Watch the pods rebuild to ensure all changes are applied to your Data Grid cluster successfully. 1.4. Uninstalling Data Grid Helm releases Uninstall a release of the Data Grid chart to remove pods and other deployment artifacts. Note This procedure shows you how to uninstall a Data Grid deployment on the command line but you can use the OpenShift Web Console instead. Refer to the OpenShift documentation for specific instructions. Prerequisites Deploy the Data Grid chart. Have a helm client. Have an oc client. Procedure List the installed Data Grid Helm releases. Use the helm client to uninstall a release and remove the Data Grid cluster: USD helm uninstall <helm_release_name> Use the oc client to remove the generated secret. USD oc delete secret <helm_release_name>-generated-secret 1.5. Deployment configuration values Deployment configuration values let you customize Data Grid clusters. Tip You can also find field and value descriptions in the Data Grid chart README . Field Description Default value deploy.clusterDomain Specifies the internal Kubernetes cluster domain. cluster.local deploy.replicas Specifies the number of nodes in your Data Grid cluster, with a pod created for each node. 1 deploy.container.extraJvmOpts Passes JVM options to Data Grid Server. No default value. deploy.container.libraries Libraries to be downloaded before server startup. Specify multiple, space-separated artifacts represented as URLs or as Maven coordinates. Archive artifacts in .tar, .tar.gz or .zip formats will be extracted. No default value. deploy.container.storage.ephemeral Defines whether storage is ephemeral or permanent. The default value is false , which means data is permanent. Set the value to true to use ephemeral storage, which means all data is deleted when clusters shut down or restart. deploy.container.storage.size Defines how much storage is allocated to each Data Grid pod. 1Gi deploy.container.storage.storageClassName Specifies the name of a StorageClass object to use for the persistent volume claim (PVC). No default value. By default, the persistent volume claim uses the storage class that has the storageclass.kubernetes.io/is-default-class annotation set to true . If you include this field, you must specify an existing storage class as the value. deploy.container.resources.limits.cpu Defines the CPU limit, in CPU units, for each Data Grid pod. 500m deploy.container.resources.limits.memory Defines the maximum amount of memory, in bytes, for each Data Grid pod. 512Mi deploy.container.resources.requests.cpu Specifies the maximum CPU requests, in CPU units, for each Data Grid pod. 500m deploy.container.resources.requests.memory Specifies the maximum memory requests, in bytes, for each Data Grid pod. 512Mi deploy.security.secretName Specifies the name of a secret that creates credentials and configures security authorization. No default value. If you create a custom security secret then deploy.security.batch does not take effect. deploy.security.batch Provides a batch file for the Data Grid command line interface (CLI) to create credentials and configure security authorization at startup. No default value. deploy.expose.type Specifies the service that exposes Hot Rod and REST endpoints on the network and provides access to your Data Grid cluster, including the Data Grid Console. Route Valid options are: "" (empty value), Route , LoadBalancer , and NodePort . Set an empty value ( "" ) if you do not want to expose Data Grid on the network. deploy.expose.nodePort Specifies a network port for node port services within the default range of 30000 to 32767. 0 If you do not specify a port, the platform selects an available one. deploy.expose.host Optionally specifies the hostname where the Route is exposed. No default value. deploy.expose.annotations Adds annotations to the service that exposes Data Grid on the network. No default value. deploy.logging.categories Configures Data Grid cluster log categories and levels. No default value. deploy.podLabels Adds labels to each Data Grid pod that you create. No default value. deploy.svcLabels Adds labels to each service that you create. No default value. deploy.resourceLabels Adds labels to all Data Grid resources including pods and services. No default value. deploy.makeDataDirWritable Allows write access to the data directory for each Data Grid Server node. false If you set the value to true , Data Grid creates an initContainer that runs chmod -R on the /opt/infinispan/server/data directory to change permissions. deploy.securityContext Configures the securityContext used by the StatefulSet pods. {} This can be used to change the group of mounted file systems. Set securityContext.fsGroup to 185 if you need to explicitly match the group owner for /opt/infinispan/server/data to the default Data Grid's group deploy.monitoring.enabled Enable or disable monitoring using ServiceMonitor . false Users must have monitoring-edit role assigned by the admin to deploy the Helm chart with ServiceMonitor enabled. deploy.nameOverride Specifies a name for all Data Grid cluster resources. Helm Chart release name. deploy.nodeAffinity Defines the nodeAffinity policy used by the cluster's StatefulSet {} deploy.podAffinity Defines the podAffinity policy used by the cluster's StatefulSet {} deploy.podAntiAffinity Defines the podAntiAffinity policy used by the cluster's StatefulSet preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchLabels: clusterName: {{ tpl include "infinispan-helm-charts.name" . }} app: infinispan-pod topologyKey: kubernetes.io/hostname weight: 100 deploy.infinispan Data Grid Server configuration. Data Grid provides default server configuration. For more information about configuring server instances, see Data Grid Server configuration values .
cat > infinispan-values.yaml<<EOF #Build configuration images: server: registry.redhat.io/datagrid/datagrid-8-rhel8:latest initContainer: registry.access.redhat.com/ubi8-micro #Deployment configuration deploy: #Add a user with full security authorization. security: batch: "user create admin -p changeme" #Create a cluster with two pods. replicas: 2 #Specify the internal Kubernetes cluster domain. clusterDomain: cluster.local EOF helm install infinispan openshift-helm-charts/redhat-data-grid --values infinispan-values.yaml --set deploy.replicas=3 oc get pods -w helm upgrade infinispan openshift-helm-charts/redhat-data-grid --values infinispan-values.yaml oc get pods -w helm list helm uninstall <helm_release_name> oc delete secret <helm_release_name>-generated-secret preferredDuringSchedulingIgnoredDuringExecution: - podAffinityTerm: labelSelector: matchLabels: clusterName: {{ tpl include "infinispan-helm-charts.name" . }} app: infinispan-pod topologyKey: kubernetes.io/hostname weight: 100