Skip to content
6 changes: 3 additions & 3 deletions docs/release-notes/rn-app-manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ Released on January 24, 2025
Support for Kubernetes: 1.29, 1.30, and 1.31

### New Features {#new-features-1-124-0}
* You can migrate Helm charts that were installed with HelmChart v1beta1 and `useHelmInstall: false` to HelmChart v1beta2 by passing the `--take-ownership` flag to the `helmUpgradeFlags` field in HelmChart custom resource as shown below:
* You can migrate Helm charts that were installed with HelmChart `v1beta1` and `useHelmInstall: false` to HelmChart `v1beta2` by passing the `--take-ownership` flag to the `helmUpgradeFlags` field in HelmChart custom resource as shown below:

```yaml
# HelmChart v1 beta2
Expand All @@ -79,7 +79,7 @@ Support for Kubernetes: 1.29, 1.30, and 1.31

This flag allows Helm to take ownership of existing resources that were installed without Helm, like resources deployed with HelmChart v1beta1 and `useHelmInstall: false`.

To migrate an existing installation from `kots.io/v1beta1` with `useHelmInstall: false` to `kots.io/v1beta2`, reach out to your Replicated account representative in Slack or over email.
For information about how to migrate an existing installation to KOTS HelmChart `v1beta2`, see [Migrating Existing Installations to HelmChart v2](/vendor/helm-v2-migrate).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ added link to the migration topic


## 1.123.1

Expand Down Expand Up @@ -115,7 +115,7 @@ Released on December 12, 2024
Support for Kubernetes: 1.29, 1.30, and 1.31

### New Features {#new-features-1-122-0}
* Adds support for the `kots.io/keep` annotation, which prevents KOTS from deleting resources during an upgrade if the resource is no longer present in the new release.
* Adds support for the `kots.io/keep` annotation, which prevents KOTS from deleting resources during an upgrade if the resource is no longer present in the new release. This annotation is useful when migrating existing KOTS installations to the KOTS HelmChart v2 installation method. For more information, see [Migrating Existing Installations to HelmChart v2](/vendor/helm-v2-migrate).

## 1.121.2

Expand Down
4 changes: 2 additions & 2 deletions docs/vendor/helm-native-about.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ This section describes how KOTS uses the HelmChart custom resource to deploy Hel

<KotsHelmCrDescription/>

The HelmChart custom resource with `apiVersion: kots.io/v1beta2` is supported with KOTS v1.99.0 and later. For more information, see [About the HelmChart kots.io/v1beta2 Installation Method](#v2-install) below.
The HelmChart custom resource with `apiVersion: kots.io/v1beta2` (HelmChart v2) is supported with KOTS v1.99.0 and later. For more information, see [About the HelmChart kots.io/v1beta2 Installation Method](#v2-install) below.

KOTS versions earlier than v1.99.0 can install Helm charts with `apiVersion: kots.io/v1beta1` of the HelmChart custom resource. The `kots.io/v1beta1` HelmChart custom resource is deprecated. For more information, see [Deprecated HelmChart kots.io/v1beta1 Installation Methods](#deprecated-helmchart-kotsiov1beta1-installation-methods) below.

### About the HelmChart kots.io/v1beta2 Installation Method {#v2-install}
### About the HelmChart v2 Installation Method {#v2-install}

When you include a HelmChart custom resource with `apiVersion: kots.io/v1beta2` in a release, KOTS v1.99.0 or later does a Helm install or upgrade of the associated Helm chart directly.

Expand Down
6 changes: 3 additions & 3 deletions docs/vendor/helm-native-v2-using.md
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ The `kots.io/v1beta2` HelmChart custom resource has the following differences fr
</tr>
</table>

### Migrate Existing HelmChart v1 Installations to v2
### Migrate Existing KOTS Installations to HelmChart v2

After you complete the tasks in this topic to configure the `kots.io/v1beta2` HelmChart custom resource, you can migrate any existing installations that were deployed with `kots.io/v1beta1` with `useHelmInstall: true` to use `kots.io/v1beta2` instead. For more information, see [Migrating Existing Installations to HelmChart v2](helm-v2-migrate).
Existing KOTS installations can be migrated to use the KOTS HelmChart v2 method, without having to reinstall the application.

To migrate an existing installation from `kots.io/v1beta1` with `useHelmInstall: false` to `kots.io/v1beta2`, reach out to your Replicated account representative in Slack or over email.
There are different steps for migrating to HelmChart v2 depending on the application deployment method used previously. For more information, see [Migrating Existing Installations to HelmChart v2](helm-v2-migrate).
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ Replaced "reach out to your rep" with a link to the migration steps

168 changes: 159 additions & 9 deletions docs/vendor/helm-v2-migrate.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,169 @@
# Migrating Existing Installations to HelmChart v2

This topic provides guidance for migrating existing installations that were deployed with the HelmChart custom resource `kots.io/v1beta1` with `useHelmInstall: true` to use `kots.io/v1beta2` instead.
This topic describes how to migrate existing Replicated KOTS installations to the KOTS HelmChart `kots.io/v1beta2` (HelmChart v2) installation method, without having to reinstall the application. It also includes information about how to support both HelmChart v1 and HelmChart v2 installations from a single release, and lists frequently-asked questions (FAQs) related to migrating to HelmChart v2.

## Overview
For additional support migrating existing installations to HelmChart v2, reach out to your Replicated account representative.

The HelmChart custom resource `kots.io/v1beta1` is deprecated and is not recommended for new installations. Existing installations that were installed with `kots.io/v1beta1` and `useHelmInstall: true` can be migrated to `kots.io/v1beta2` without needing to reinstall the application. For information about how to support installation with the `kots.io/v1beta2` HelmChart custom resource, including rewriting images, injecting pull secrets, and adding backup labels, see [Configuring the HelmChart Custom Resource v2](helm-native-v2-using).
## Migrate to HelmChart v2

### `useHelmInstall: false` Limitation
### Requirements

To migrate an existing installation from `kots.io/v1beta1` with `useHelmInstall: false` to `kots.io/v1beta2`, reach out to your Replicated account representative in Slack or over email.
* The HelmChart v2 custom resource is supported with KOTS v1.99.0 and later. If any of your customers are running a version of KOTS earlier than v1.99.0, see [Support Customers on KOTS Versions Earlier Than v1.99.0](#support-both-v1-v2) below for more information about how to support both HelmChart v1 and HelmChart v2 installations from the same release.

## How to Migrate Existing Installations
* The Helm `--take-ownership` flag is supported with KOTS v1.124.0 and later.

The HelmChart custom resource version `kots.io/v1beta2` is available only for installations that use KOTS v1.99.0 or later. To support existing users that have not yet upgraded to KOTS v1.99.0 or later, Replicated recommends that you include both a `kots.io/v1beta2` and a `kots.io/v1beta1` (with `useHelmInstall: true`) HelmChart custom resource for each Helm chart in your release. This allows you to support both installation methods from the same release.
* The `kots.io/keep` annotation is supported with KOTS v1.122.0 and later.

When you include both versions in a single release for the same Helm chart, installations with KOTS v1.98.0 or earlier use `kots.io/v1beta1`. Installations with KOTS v1.99.0 or later use `kots.io/v1beta2`.
### Migrate From HelmChart v1 with `useHelmInstall: true`

After all customer environments where the Helm chart was previously installed with `kots.io/v1beta1` and `useHelmInstall: true` are upgraded to KOTS v1.99.0 or later, you can remove version `kots.io/v1beta1` of the HelmChart custom resource from your releases.
To migrate existing installations from HelmChart v1 with `useHelmInstall: true` to HelmChart v2:

1. In a development environment, install an application release using the KOTS HelmChart v1 with `useHelmInstall: true` method. You will use this installation to test the migration to HelmChart v2.

1. Create a new release containing your application files.

1. Configure each HelmChart custom resource in the release to update `apiVersion` to `kots.io/v1beta2`, rewrite images, inject image pull secrets, and add backup labels. See [Configuring the HelmChart Custom Resource v2](helm-native-v2-using).

1. Promote the release to an internal-only channel that your team uses for testing.

1. In your development environment, log in to the Admin Console and confirm that you can upgrade to the new HelmChart v2 release.

1. When you are done testing, promote the release to one or more of your customer-facing channels. Customers can follow the standard upgrade process in the Admin Console to update their instance.

### Migrate From HelmChart v1 with `useHelmInstall: false`

This section describes how to migrate existing HelmChart v1 installations with `useHelmInstall: false`. These migration steps ensure that KOTS does not uninstall any resources that were previously deployed without Helm and that Helm takes ownership of these existing resources.

To migrate existing installations from HelmChart v1 and `useHelmInstall: false` to HelmChart v2:

1. Create a new release containing your application files:

1. Add the `kots.io/keep` annotation to any resources that were previously installed with `kubectl apply`, including resources defined in Kubernetes manifests or in your Helm `templates`. The `kots.io/keep` annotation prevents KOTS from uninstalling resources that were previously installed without Helm when upgrading using the HelmChart v2 method.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customers might not realize that v1 false uses kubectl apply. from their pov, they think it's a helm chart. so i wonder if we should make that clearer here. i might read this and say, well i had a helm chart, so no resources were applied with kubectl. but in reality, everything in the chart was kubectl applied.


1. In the `helmUpgradeFlags` field of the Embedded Cluster Config, add the `--take-ownership` flag, as shown below:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not EC Config, helm chart v2

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops good catch


```yaml
# HelmChart v1 beta2
apiVersion: kots.io/v1beta2
kind: HelmChart
metadata:
name: samplechart
spec:
helmUpgradeFlags:
- --take-ownership
```

When the `--take-ownership` flag is enabled, Helm automatically takes ownership of resources that were previously deployed without Helm during upgrade. The Helm `--take-ownership` flag requires KOTS 1.122.0 or later.

1. Configure each HelmChart custom resource in the release to update `apiVersion` to `kots.io/v1beta2`, rewrite images, inject image pull secrets, and add backup labels. See [Configuring the HelmChart Custom Resource v2](helm-native-v2-using).

1. Promote the release to an internal-only channel that your team uses for testing.

1. In a development environment, install the release to test that you can upgrade to the new release successfully.

1. When you are done testing, promote the release to one or more of your customer-facing channels.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would you want to remove the keep annotation in a subsequent release though? I'm not sure if it matters or if @nvanthao tested it.


Your customers can follow the standard upgrade process in the Admin Console to update their instance to the new version.

### Migrate From Standard Kubernetes Manifests

This section describes how to migrate existing KOTS installations of applications that were previously packaged as standard Kubernetes manifests and are now packaged as one or more Helm charts. This migration path involves performing two upgrades to ensure that KOTS does not uninstall any resources that were adopted into Helm charts, and that Helm can take ownership of resources that were previously deployed without Helm.

To migrate applications that were previously packaged as standard Kubernetes manifests:

1. Create a new release containing the Kubernetes manifests for your application.

1. Add the `kots.io/keep` annotation to each of the application manifests in the release. The `kots.io/keep` annotation prevents KOTS from uninstalling resources that were previously installed without Helm when upgrading using the HelmChart v2 method.

1. Save the release.

1. Create another new release:

1. In the release, add your application Helm chart or charts. Remove the application manifests for resources that were adopted into the Helm chart(s).

1. In the `helmUpgradeFlags` field of the Embedded Cluster Config, add the `--take-ownership` flag, as shown below:

```yaml
# HelmChart v1 beta2
apiVersion: kots.io/v1beta2
kind: HelmChart
metadata:
name: samplechart
spec:
helmUpgradeFlags:
- --take-ownership
```

When the `--take-ownership` flag is enabled, Helm automatically takes ownership of resources that were previously deployed without Helm during upgrade.

1. Save the release.

1. Test the upgrade process:

1. Promote the first release to an internal-only channel that your team uses for testing.

:::note
Replicated recommends that you mark the release as required by enabling **Prevent this release from being skipped during upgrades** because customers must upgrade to this release first before they can upgrade to the release that migrates their installation to HelmChart v2.
:::
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ recommend using required releases

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i don't think the second one needs to be required, unless they're going to remove the --take-ownership flag in a later release. it would need to be required if only this version has --take-ownership applied. which could be a good idea.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow I was trying to capture was testing the first (required) release, then promoting that same release to a customer-facing channel and again marking it as required.

But that said, the second release does have the --take-ownership flag...so it sounds like maybe it could be helpful to actually mark both the first and second releases are required?


1. In a development environment, install the release.

1. Promote the second release to the same channel.

1. In your development environment, upgrade to the second release to migrate the installation to HelmChart v2.

1. After you are done testing the migration process, promote the first release containing your application manifests to one or more customer-facing channels.

:::note
Replicated recommends that you mark the release as required by enabling **Prevent this release from being skipped during upgrades** because customers must upgrade to this release first before they can upgrade to the release that migrates their installation to HelmChart v2.
:::

1. Promote the second release containing your application Helm chart to the same channels.

1. Instruct customers to migrate by first upgrading to the release containing the standard manifests, then upgrading to the release packaged with Helm second.

## Support Customers on KOTS Versions Earlier Than v1.99.0 {#support-both-v1-v2}

The HelmChart v2 installation method requires KOTS v1.99.0 or later. If you have existing customers that have not yet upgraded to KOTS v1.99.0 or later, Replicated recommends that you support both the HelmChart v2 and v1 installation methods from the same release until all installations are running KOTS v1.99.0 or later.

To support both installation methods from the same release, include both versions of the HelmChart custom resource for each Helm chart in your application releases (HelmChart `kots.io/v1beta2` and HelmChart `kots.io/v1beta1` with `useHelmInstall: true`).

When you include both versions of the HelmChart custom resource for a Helm chart, installations with KOTS v1.98.0 or earlier use the v1 method, while installations with KOTS v1.99.0 or later use v2.

After all customers are using KOTS v1.99.0 or later, you can remove the HelmChart v1 custom resources so that all customers are using the HelmChart v2 method.

## HelmChart v2 Migration FAQs

This section includes FAQs related to migrating existing installations to the KOTS HelmChart v2 method.

### Which migration scenarios require the `kots.io/keep` annotation?

When applied to a resource in a release, the `kots.io/keep` annotation prevents the given resource from being uninstalled. The `kots.io/keep` annotation can be used to prevent KOTS from deleting resources that were either adopted into Helm charts, or that were previously deployed without Helm.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nvanthao does this annotation work if you put it on a resource in a Helm chart, or does it only work for manifests in a release?


To prevent existing resources from being uninstalled during upgrade, the `kots.io/keep` annotation is required for the following types of migrations:
* Applications previously packaged as Kubernetes manifests migrating to HelmChart v2
* HelmChart v1 with `useHelmInstall: false` migrating to HelmChart v2

`kots.io/keep` is _not_ needed when migrating from HelmChart v1 with `useHelmInstall: true` to HelmChart v2.

### Which migration scenarios require the `--take-ownership` flag?

When the `--take-ownership` flag is enabled, Helm automatically takes ownership of resources that were previously deployed to the cluster without Helm.

The `--take-ownership` flag is required for the following types of migrations:
* Applications previously packaged as Kubernetes manifests migrating to HelmChart v2
* HelmChart v1 with `useHelmInstall: false` migrating to HelmChart v2

`--take-ownership` is _not_ needed when migrating from HelmChart v1 with `useHelmInstall: true` to HelmChart v2.

### What is the difference between HelmChart v1 with `useHelmInstall: false` and `useHelmInstall: true`?

With HelmChart v1 and `useHelmInstall: false`, KOTS renders the Helm templates and deploys them as standard Kubernetes manifests using `kubectl apply`. This differs from both the HelmChart v1 with `useHelmInstall: true` and HelmChart v2 methods, where KOTS installs the application using Helm.

Because the HelmChart v1 with `useHelmInstall: false` method does not deploy resources with Helm, it is necessary to use the `kots.io/keep` annotation and the Helm `--take-ownership` flag when migrating to the HelmChart v2 installation method. These ensure that Helm can take ownership of existing resources and that the resources are not uninstalled during upgrade.

For more information about how KOTS deploys Helm charts, including information about the deprecated HelmChart v1 installation methods, see [About Distributing Helm Charts with KOTS](helm-native-about).

### Where can I find additional help migrating existing installations to HelmChart v2?

For additional support migrating existing installations to HelmChart v2, Replicated recommends that you post your question in the [Replicated Community](https://community.replicated.com/) site. You can also reach out to your Replicated account representative.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^ post on community or reach out to your rep if you need help