# Upgrade

Use this page to upgrade a Kubernetes (Helm) deployment.

{% hint style="warning" %}
Back up your PostgreSQL metadata databases before upgrading. See [Back up PostgreSQL](/deploy-syntho/deploy-syntho-using-kubernetes/back-up-postgresql.md).
{% endhint %}

{% stepper %}
{% step %}
**Update values**

* **Syntho License key upgrade**
  * In `helm/ray/values.yaml`
    * <pre class="language-yaml"><code class="lang-yaml"><strong>SynthoLicense: &#x3C;new-license-key>
      </strong></code></pre>
  * In `helm/syntho-ui/values.yaml`
    * <pre class="language-yaml"><code class="lang-yaml"><strong>SynthoLicense: &#x3C;new-license-key>
      </strong></code></pre>
* **Application version upgrade**
  * `helm/ray/values.yaml`
    * ```yaml
      ray-cluster:
        image:
          tag: <new-version-number>
      ```
  * `helm/syntho-ui/values.yaml`
    * ```yaml
      frontend:
        image:
          tag: <new-version-number>
      backend:
        image:
          tag: <new-version-number>
      core:
        image:
          tag: <new-version-number>
      ```

{% endstep %}

{% step %}
**Rotate ImagePullSecret (if registry credentials changed)**

```bash
kubectl delete secret syntho-cr-secret -n syntho
kubectl create secret docker-registry syntho-cr-secret \
  --namespace syntho \
  --docker-server=<REGISTRY_HOST> \
  --docker-username=<USERNAME> \
  --docker-password=<PASSWORD>
```

{% endstep %}

{% step %}
**Apply the upgrade**

```bash
helm upgrade ray-cluster ./helm/ray/chart \
  --values helm/ray/values.yaml \
  --namespace syntho

helm upgrade syntho-ui ./helm/syntho-ui \
  --values helm/syntho-ui/values.yaml \
  --namespace syntho
```

{% endstep %}

{% step %}
**Verify**

```bash
kubectl get pods -n syntho
kubectl get events -n syntho --sort-by=.lastTimestamp | tail -n 30
```

If pods are restarting:

```bash
kubectl logs -n syntho <pod-name>
```

{% endstep %}
{% endstepper %}

<details>

<summary>Ray CRDs (only for some upgrades)</summary>

Some Ray/KubeRay upgrades require CRD changes.

If Helm reports CRD-related errors, upgrade the CRDs first (or reinstall Ray following the guidance from Syntho Support).

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.syntho.ai/deploy-syntho/deploy-syntho-using-kubernetes/upgrade.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
