---
title: Charmhub | Deploy mongos-k8s using Charmhub - The Open Operator Collection
description: Deploy the latest version of mongos-k8s as a Kubernetes Operator on any
  cloud.
url: https://charmhub.io/mongos-k8s/docs/h-minor-upgrade
---

# mongos-k8s

[Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

* [Canonical](https://charmhub.io/publisher/data-platform "View all packages from Canonical")

Platform:

6/stable 75

```
juju deploy mongos-k8s --channel 6/stable
```

[Learn to deploy on juju >](https://juju.is/docs/juju/manage-applications)

---

#### Relevant links

* [Homepage](https://github.com/canonical/mongos-k8s-operator)

---

#### Contacts

* [Submit a bug](https://github.com/canonical/mongos-k8s-operator/issues)

---

Share your thoughts on this charm with the community on discourse.

[Join the discussion](https://discourse.charmhub.io/)

# Perform a minor upgrade on a mongos-k8s router

This page contains:

* [Supported charm revisions](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#supported-revisions) that are safe to upgrade to or from
* [Minor upgrade steps](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#minor-upgrade-steps)

> To perform an upgrade on a MongoDB sharded cluster, see the [Charmed MongoDB K8s documentation](https://charmhub.io/mongodb-k8s/docs/h-upgrade-sharding).

---

## [Supported revisions](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#p-34291-supported-revisions)

Below is a list of revisions of Charmed Mongos K8s that support upgrades.

Only upgrade to or from these supported revisions in a production environment.

* [Revision 16](https://charmhub.io/mongos-k8s/docs/r-revision-17)

## [Minor upgrade steps](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#p-34291-minor-upgrade-steps)

Here is a summary of the steps to perform a minor upgrade:

1. [Determine your current revision](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#step-1-determine-your-current-revision)
2. [Determine new revision](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#step-2-determine-new-revision)
3. [Upgrade the router](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#step-3-upgrade-the-router)

### [Step 1: Determine your current revision](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#p-34291-step-1-determine-your-current-revision)

Find determine your current revision:

```
juju status | grep <juju-app-name> | head -1 | awk '{print $5}'
```

If your current revision is not in the list, then upgrade is not supported.

In the case that your upgrade is not successful, you will need this revision number to roll back your application.

### [Step 2: Determine new revision](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#p-34291-step-2-determine-new-revision)

Choose a revision to upgrade to from the [list of available revisions to upgrade to](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#supported-revisions)

### [Step 3: Upgrade the router](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#p-34291-step-3-upgrade-the-router)

Using the revision from [Step 2](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#step-2-determine-new-revision), upgrade your application

```
juju refresh mongos-k8s --revision=<revision number>
```

The upgrade should begin, and upgrade all deployed `mongos` routers. You can watch and wait for the upgrade to succeed with `juju status --watch 1s`.

If all units show `active` and `idle` statuses after upgrading, then your upgrade succeeded.

If your upgrade failed, then  `juju status` will show that the unit is blocked with the message `Unhealthy after refresh`. You can do the following:

1. Recommended: Wait for 5-10 minutes to see if the router can heal itself
2. Recommended: Roll back. To roll back completely, redo [Step 3](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#step-3-upgrade-the-router) using the revision number from [Step 1](https://charmhub.io/mongos-k8s/docs/h-minor-upgrade#step-1-determine-your-current-revision).
3. **Not Recommended**: Force an upgrade by running `juju run mongos-k8s/leader force-refresh-start`. Please **note this can break your database and is not recommended.**

---
