# Upgrade ISD-Argo Platform from v4.1.2 to v4.1.3

This document describes how to upgrade the ISD-Argo Platform from v4.1.2 to v4.1.3 on a Kubernetes cluster.

{% hint style="warning" %}
Before starting the upgrade, take a backup of all the databases, particularly the Postgres DB. The backup procedures may vary depending on your usage of external DBs for Autopilot Services.
{% endhint %}

{% hint style="info" %}
Please note that v4.1.2 to v4.1.3 upgrade does not depend on or use an external script for db upgrade or data migration. So upgrading the helm chart would be enough.
{% endhint %}

Following are the sequence of activities to perform the upgrade.

1. [**Pre-requisites**](https://docs.google.com/document/d/1WSkBWorSeC8c970q8bMPucvLxA1AwDmQj9Oj8G31XOE/edit#heading=h.tsv8ta1eveeq)
2. [**Cloning the Repo and update values file**](https://docs.google.com/document/d/1WSkBWorSeC8c970q8bMPucvLxA1AwDmQj9Oj8G31XOE/edit#heading=h.m0mlywty3pru)
3. [**Helm upgrade**](https://docs.google.com/document/d/1WSkBWorSeC8c970q8bMPucvLxA1AwDmQj9Oj8G31XOE/edit#heading=h.llal5m48atk7)
4. [**Post Installation Steps**](https://docs.google.com/document/d/1WSkBWorSeC8c970q8bMPucvLxA1AwDmQj9Oj8G31XOE/edit#heading=h.a8ddrur5y2yt)
5. [**If an upgrade fails**](https://docs.google.com/document/d/1WSkBWorSeC8c970q8bMPucvLxA1AwDmQj9Oj8G31XOE/edit#heading=h.t13r0nxhz5ml)

### Pre-requisites:

* Users need to have access to the Kubernetes Cluster and namespace where “ISD-Argo with Argo CD and Argo Rollouts” is running i.e v4.1.2 is running.
* Users need to have access to GitHub and be able to clone [**enterprise-argo**](https://github.com/OpsMx/enterprise-argo) repo.

### Cloning the Repo and update values file:

1. Clone the enterprise-argo repo by using the below command<br>

   ```
   git clone https://github.com/OpsMx/enterprise-argo.git
   cd enterprise-argo/charts/isdargo/
   ```

2. You need to use [**isd-argo-minimal-values.yaml**](https://github.com/OpsMx/enterprise-argo/blob/main/charts/isdargo/isd-argo-minimal-values.yaml) file for upgrading to v4.1.3.&#x20;

3. Configure URLs for ISD-Argo Platform, Keycloak and Vela as per your DNS record.

4. Update the URLs of  ISD-Argo Platform, Keycloak and Vela as per your DNS records in all occurrences of the isd-minimal-values.yaml

5. Update forwarder.externalName URL in isd-minimal-values.yaml. The actual DNS needs to be created/updated after installation.

{% hint style="info" %}
The isd-minimal-values.yaml provided in the repo is adequate and recommended for ISD-Argo Platform standard Installation. If you would like to have some advanced-level configurations for secret management, cluster configuration, etc, you can use values.yaml. If you need any additional clarifications with respect to values.yaml for installation, please[ contact](https://www.opsmx.com/contact/) OpsMx support. Click [here](https://github.com/OpsMx/enterprise-argo/blob/main/charts/isdargo/values.yaml) for the complete values.yaml&#x20;
{% endhint %}

### Helm upgrade

1. Add OpsMx helm repo to your local machine.

```
helm repo add isdargo https://opsmx.github.io/enterprise-argo/
```

{% hint style="info" %}
If OpsMx helm repo is already added, do a repo update before installing the chart by executing the below command.
{% endhint %}

```
helm repo update
```

2. Execute the below command to upgrade.

```
helm upgrade isd isdargo/isdargo -f isd-minimal-values.yaml -n opsmx-argo
--timeout=15m --debug 
```

Wait for 15 minutes till the helm upgrade completes.

```
helm upgrade isd isdargo/isdargo -f isd-minimal-values.yaml -n opsmx-argo 
--timeout=15m --debug

Release "isd" has been upgraded. Happy Helming!
NAME: isd
LAST DEPLOYED: Mon Feb  6 19:40:34 2023
NAMESPACE: opsmx-argo
STATUS: deployed
REVISION: 2
TEST SUITE: None
```

3. Please use the below command to check the pods in your namespace.

```
kubectl -n opsmx-argo get pods
```

4. Once installation is completed, please create/update the DNS, based on the loadbalancer created using instructions [here](https://docs.google.com/document/d/1cahEx4NihwRyqZtFijTJ79Zxe8_PixuKrosAocxSIrk/edit).

### Post Installation Steps

1. Vela Service requires the “Wild-card ingress” and “Wild-card TLS certificates to be provided to the ingress”. If you are using the cert-manager, please use this [blog](https://www.linkedin.com/pulse/wildcard-certificates-using-lets-encrypt-certbot-pallavi-udhane/) to create a Wild-card TLS certificate. Else please contact your certificate provider for the certificates for your URL equivalent for "\*.VELA.REPLACE.THIS.WITH.YOURCOMPANY.COM".

   Create vela-ingress tls secret using the wild-card certificate and key. Replace **cert1.pem** and **privkey1.pem** file in the below command with the certificates you have created from cert manager or your certificate provider.                                                 For example,                                                                                                                   `kubectl create secret tls vela-ingress -n opsmx-argo --cert cert1.pem --key privkey1.pem`&#x20;
2. Login to ISD UI and check whether the ISD version is updated right after the help button in the top right corner.&#x20;
3. Go to the Agent Screen in ISD UI and click on the three dots at the end of the row of the Agent entry and then click the **Edit** button as shown in the image below.

   <figure><img src="https://lh4.googleusercontent.com/SuQqFD6rtijv1nYBHExcQWxJnQ5epYEHetS48wtAqlDp4qlB3WggvQu-h_av-1YY8qV8wOQ_UW4dX53KPS_RLSbywvJgj1FbJhd9SIdjJK5Uf4HCxxp0XdSGjg9CUGtYcCWptrsw0Dm8-0_h-AjpA-o" alt=""><figcaption></figcaption></figure>
4. Click the **Download Agent Manifest** button to download the Agent Manifest file as shown in the image below.<br>

   <figure><img src="https://lh3.googleusercontent.com/atEXsXVYDFoapW-LklEfdxcY4fD-J529c8iH3oHJK4wJHoqzzPJ4cz3H-htawwf9_9KszY21Eh5_VpemY7Q2ttk5pwFP4tvh7194RIAC8xTcvoNlDIhYLE7L6Ry-nxGAoqNOhTedHIb_CgYyPmcA7LI" alt=""><figcaption></figcaption></figure>
5. Apply the Agent Manifest file where ISD-Argo Platform is running by using the below command.

   <pre data-overflow="wrap"><code>kubectl apply -f isd-argo-agent.yml -n opsmx-argo
   </code></pre>
6. Delete the Agent pod by using the below command.                                              `kubectl delete po -l agent.opsmx.com/role=agent -n opsmx-argo`
7. Go to the “CD Integration” page and check whether the agent status is healthy(green) as shown in the image below.

   <figure><img src="https://lh5.googleusercontent.com/xtq7w7JNhY6cTvem8W0IVEj0b4dw-mRQaa_sIk51fuM9OrzAx6RCCK-QhMdFHbUFBnHmYW7kY1-1-JTtNmvv7ae4yZZmk5hzGdkHN_Ay4BuHZKsyxtGe5lmzRS-TgCqw3tHsGgP034pa8yhb1wB9Rd8" alt=""><figcaption></figcaption></figure>
8. Please verify all the screens in ISD UI.

### If an upgrade fails

If anything goes wrong during upgrade, please use the below command to get the helm history.

{% code overflow="wrap" %}

```
helm history isd -n opsmx-argo

REVISION	UPDATED                 	STATUS    	CHART        	APP VERSION	DESCRIPTION     
1       	Mon Oct 31 18:55:01 2022	superseded	isdargo-4.1.0	4.1.0      	Install complete
2       	Wed Nov 16 16:10:13 2022	superseded	isdargo-4.1.0	4.1.0      	Upgrade complete
3       	Fri Dec  2 14:11:53 2022	superseded	isdargo-4.1.2	4.1.2      	Upgrade complete
4       	Wed Feb 15 11:21:32 2023	superseded	isdargo-4.1.3	4.1.3      	Upgrade complete
5       	Wed Feb 15 11:38:59 2023	deployed  	isdargo-4.1.3	4.1.3      	Upgrade complete

```

{% endcode %}

Use below command to rollback to the previous version

```
helm rollback isd -n opsmx-argo <version number>
```
