This topic describes how to install or uninstall the VMware GemFire Operator when using VMware GemFire for Kubernetes.


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

A VMware GemFire Operator uses Helm charts and Docker images to define the GemFire for Kubernetes cluster.

Install the Operator

  1. Verify your current Kubernetes cluster:

    kubectl config current-context
    
  2. Create a namespace to be used for the GemFire for Kubernetes 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-server=registry.tanzu.vmware.com --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

    Note: Helm v3.13.0 and later require adding the --plain-http flag when working with OCI registries like Harbor. Failure to use the --plain-http flag with Helm v13.13.0 and later results in a 401 Unauthorized error.

    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:

      export HELM_EXPERIMENTAL_OCI=1
      helm registry login -u myuser registry.tanzu.vmware.com
          Password:
          Login succeeded
      helm pull oci://registry.tanzu.vmware.com/tanzu-gemfire-for-kubernetes/gemfire-crd --version 2.0.0 --destination ./ --plain-http
      helm pull oci://registry.tanzu.vmware.com/tanzu-gemfire-for-kubernetes/gemfire-operator --version 2.0.0 --destination ./ --plain-http
      
    2. Use helm to install the CRD and operator. If cert-manager is installed in a namespace other than cert-manager, specify that namespace by appending --set certManagerNamespace=<namespace> to the helm install command.

      helm install gemfire-crd gemfire-crd-2.0.0.tgz --namespace NAMESPACE-NAME --set operatorReleaseName=gemfire-operator --plain-http
      helm install gemfire-operator gemfire-operator-2.0.0.tgz --namespace NAMESPACE-NAME --plain-http
      
    3. Verify that the VMware 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 registry.tanzu.vmware.com/tanzu-gemfire-for-kubernetes/gemfire-for-kubernetes-carvel-bundle:2.0.0 -o workspace/tg4k8s_carvel_bundle
      
      cd workspace/tg4k8s_carvel_bundle && ls
      
      .
      .imgpkg
      ..
      certificates.yaml
      operator.yaml
      tlsVolume.lib.yml
      values.yaml
      
    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
      
      registry:
      
      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 GemFire for Kubernetes clusters prior to uninstalling the operator, as described in Delete a VMware GemFire Cluster.

  2. Uninstall the VMware 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 GemFire for Kubernetes clusters created with the VMware 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 VMware GemFire Cluster.

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