Upgrade YugabyteDB Anywhere

You can use Helm to upgrade your YugabyteDB Anywhere installed on Kubernetes to a newer version.

If you are upgrading a YugabyteDB Anywhere installation with high availability enabled, follow the instructions provided in Upgrade instances.

Before running an upgrade, execute the following command to obtain the latest versions of YugabyteDB Anywhere from Helm charts:

helm repo update

Upgrade using Helm

To upgrade to a specific version while preserving overrides you might have applied to your initial YugabyteDB Anywhere installation or previous upgrades, execute the following command:

helm upgrade yw-test yugabytedb/yugaware --version 2.15.2 -n yb-platform --reuse-values --set image.tag=2.15.2.0-b87 --wait

To obtain the value for --set image.tag, execute the following command:

helm list | awk '{if (NR!=1) print $NF}'

If you do not wish to port your overrides, do not include reuse-values. Instead, you may choose to pass your existing overrides file by adding --values custom-values.yaml to your command during the upgrade.

If you have upgraded YugabyteDB Anywhere to version 2.12 or later and xCluster replication for your universe was set up via yb-admin instead of the UI, follow the instructions provided in Synchronize replication after upgrade.

Install Yugabyte Kubernetes Operator by upgrading an existing YBA

The Yugabyte Kubernetes Operator TP automates the deployment, scaling, and management of YugabyteDB clusters in Kubernetes environments. You can install the operator by upgrading an existing YBA as follows:

  1. Apply the following Custom Resource Definition:

    kubectl apply -f https://github.com/yugabyte/charts/blob/2024.1/crds/concatenated_crd.yaml
    
  2. Get a list of Helm chart releases in namespace using the following command:

    helm ls
    
    NAME    NAMESPACE       REVISION        UPDATED                                 STATUS          CHART           APP VERSION
    yba         yb-platform-test      1               2024-05-08 16:42:47.480260572 +0000 UTC deployed        yugaware-2.19.3 2.19.3.0-b140
    
  3. Run the following helm upgrade command to enable the YBA upgrade:

    helm upgrade yba yugabytedb/yugaware --version 2024.1.0 --set kubernetesOperatorEnabled=true,kubernetesOperatorNamespace="yb-platform-test"
    
  4. Verify that YBA is up, and the Kubernetes Operator is installed successfully using the following commands:

    kubectl get pods -n <yba_namespace>
    
    kubectl get pods -n <operator_namespace>
    
    NAME                                       READY   STATUS    RESTARTS   AGE
    chart-1706728534-yugabyte-k8s-operator-0   3/3     Running   0          26h
    

    Additionally, you should see no stack traces, but the following messages in the KubernetesOperatorReconciler log:

    LOG.info("Finished running ybUniverseController");
    
  5. Create the following custom resource, and save it as demo-universe.yaml.

    # demo-universe.yaml
    apiVersion: operator.yugabyte.io/v1alpha1
    kind: YBUniverse
    metadata:
      name: demo-test
    spec:
      numNodes: 1
      replicationFactor: 1
      enableYSQL: true
      enableNodeToNodeEncrypt: true
      enableClientToNodeEncrypt: true
      enableLoadBalancer: true
      ybSoftwareVersion: "2024.1.0-b2" <- This will be the YBA  version
      enableYSQLAuth: false
      enableYCQL: true
      enableYCQLAuth: false
      gFlags:
        tserverGFlags: {}
        masterGFlags: {}
      deviceInfo:
        volumeSize: 100
        numVolumes: 1
        storageClass: "yb-standard"
    
  6. Create a universe using the custom resource, demo-universe.yaml as follows:

    kubectl apply -f demo-universe.yaml -n yb-platform
    
  7. Check the status of the universe as follows:

    kubectl get ybuniverse  -n yb-operator
    
    NAME                STATE   SOFTWARE VERSION
    anab-test-2         Ready   2.23.0.0-b33
    anab-test-backups   Ready   2.21.1.0-b269
    anab-test-restore   Ready   2.21.1.0-b269
    

For more information, see Yugabyte Kubernetes Operator.