This version defines a Tanzu GemFire Operator to use when creating a Tanzu GemFire cluster. See Operator pattern in the Kubernetes documentation.

A Tanzu GemFire Operator uses Helm charts and Docker images to define the Tanzu GemFire cluster.

Install the Operator

  1. Verify your current Kubernetes cluster:

    kubectl config current-context
  2. Create a namespace to be used for the Tanzu GemFire cluster operator and substitute its name in the following examples in place of NAMESPACE-NAME:

    kubectl create namespace NAMESPACE-NAME
  3. Create an image pull secret for the Kubernetes cluster namespace. Set the user name (USERNAME) and password (PASSWD) credentials to values that have permission to access VMware Tanzu Network, as they will be used to acquire the operator image from the registry:

    kubectl create secret docker-registry image-pull-secret --namespace=NAMESPACE-NAME --docker-username='USERNAME' --docker-password='PASSWD'

    where your USERNAME and user’s PASSWD are set.

    Surround both the USERNAME and the PASSWD by single quote marks to ensure that special characters within those values are handled correctly.

  4. If you are using Tanzu Kubernetes Grid (TKG) as your Kubernetes platform, create a role binding within the NAMESPACE-NAME namespace, such that pods can be created under the pod security policy that will be configured for your TKG platform:

    kubectl create rolebinding psp-gemfire --namespace=NAMESPACE-NAME \
    --clusterrole=psp:vmware-system-privileged --serviceaccount=NAMESPACE-NAME:default
  5. Complete the operator installation:

    Install with Helm

    1. Download the compressed TAR files for the operator and CRD from VMware Tanzu Network. They are gemfire-operator-2.0.0.tgz and gemfire-crd-2.0.0.tgz. Or use helm pull to retrieve the compressed TAR files:

      helm registry login -u myuser
          Login succeeded
      helm pull oci:// --version 2.0.0 --destination ./
      helm pull oci:// --version 2.0.0 --destination ./
    2. Use helm to install the CRD and operator:

      helm install gemfire-crd gemfire-crd-2.0.0.tgz --namespace NAMESPACE-NAME --set operatorReleaseName=gemfire-operator
      helm install gemfire-operator gemfire-operator-2.0.0.tgz --namespace NAMESPACE-NAME
    3. Verify that the Tanzu GemFire operator is successfully deployed:

      helm ls --namespace NAMESPACE-NAME

      A successfully deployed operator and CRD will output:

      helm ls --namespace NAMESPACE-NAME
      NAME              NAMESPACE       STATUS      
      gemfire-operator  NAMESPACE-NAME  deployed
      gemfire-crd       NAMESPACE-NAME  deployed

    Install with Carvel

    1. Use imgpkg to fetch the operator Carvel bundle:

      imgpkg pull -b -o workspace/tg4k8s_carvel_bundle
      cd workspace/tg4k8s_carvel_bundle && ls
    2. Modify values.yaml inside the Carvel bundle with your desired values:

      namespace: The kubernetes namespace in which the operator will be installed
      name: The value of this field is prepended to the names of all resources
      certManagerNamespace: The kubernetes namespace in which the cert manager is installed
      tlsSecretName: The name of the kubernetes secret for TLS
      server: Docker registry address from which to pull images
      username: required if using a private registry
      password: required if using a private registry
    3. Chain the Carvel tools to complete the operator manifest and deploy the application:

      ytt -f operator.yaml -f certificates.yaml -f values.yaml -f tlsVolume.lib.yml | kbld -f- | kapp -y deploy -a gemfire-operator -f-

Uninstall the Operator

  1. Delete all Tanzu GemFire clusters prior to uninstalling the operator, as described in Delete a Tanzu GemFire Cluster.

  2. Uninstall the Tanzu GemFire Operator and CRD.

    Uninstall with Helm

    1. Run:
      helm uninstall gemfire-operator --namespace NAMESPACE-NAME
      helm uninstall gemfire-crd --namespace NAMESPACE-NAME

    Uninstall with Carvel

    1. Run:

      kapp -y delete -a gemfire-operator
      kubectl delete namespace NAMESPACE-NAME

      This command sequence also destroys all Tanzu GemFire clusters created with the Tanzu GemFire Operator. However, it may not complete the operation, leaving pods forever in the terminating state. Any remaining pods may interfere with future installations, so destroy the pods.

    2. Discover any remaining pods:

      kubectl get pods
      NAME                READY   STATUS        RESTARTS   AGE
      gemfire1-server-0   1/1     Terminating   0          29m
      gemfire1-server-1   1/1     Terminating   0          29m
    3. Delete each remaining pod with the following two-command sequence:

      kubectl patch pod POD-NAME -p '{"metadata":{"finalizers":null}}'
      kubectl delete pod POD-NAME --grace-period=0 --force

      where POD-NAME is the pod’s name, as listed in the kubectl get pods command.

    4. Also remove any persistent volume claims as instructed in Delete a Tanzu GemFire Cluster.

check-circle-line exclamation-circle-line close-line
Scroll to top icon