docs/content/v2.25/yugabyte-platform/upgrade/upgrade-yp-kubernetes.md
You can use Helm to upgrade your YugabyteDB Anywhere (YBA) 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
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 {{<yb-version version="v2.25" format="short">}} -n yb-platform --reset-then-reuse-values --set image.tag={{<yb-version version="v2.25" format="build">}} --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 --reset-then-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.
The YugabyteDB Kubernetes Operator {{<tags/feature/ea idea="831">}} automates the deployment, scaling, and management of YugabyteDB clusters in Kubernetes environments. You can install the operator by upgrading an existing YBA as follows:
Apply the following Custom Resource Definition:
kubectl apply -f https://raw.github.com/yugabyte/charts/{{< yb-version version="v2.25" format="short">}}/crds/concatenated_crd.yaml
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
Run the following helm upgrade command to enable the YBA upgrade:
helm upgrade yba yugabytedb/yugaware --version 2.25.2 \
--set yugaware.kubernetesOperatorEnabled=true,yugaware.kubernetesOperatorNamespace=yb-platform-test
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");
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"
Create a universe using the custom resource, demo-universe.yaml as follows:
kubectl apply -f demo-universe.yaml -n yb-platform
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 YugabyteDB Kubernetes Operator.