Performing Updates in kURL Clusters
This topic describes how to perform updates in Replicated kURL installations. It includes procedures for updating an application, as well as for updating the versions of Kubernetes, Replicated KOTS, and add-ons in a kURL cluster.
For more information about managing nodes in kURL clusters, including how to safely reset, reboot, and remove nodes when performing maintenance tasks, see Managing Nodes in the open source kURL documentation.
Update an Application
For kURL installations, you can update an application from the Admin Console. You can also set up automatic updates. See Configuring Automatic Updates.
Online Environments
To perform an update from the Admin Console:
-
In the Admin Console, go to the Version History tab.
-
Click Check for updates.
A new upstream version displays in the list of available versions.
-
(Optional) When there are multiple versions of an application, you can compare the changes between them by clicking Diff releases in the right corner.
You can review changes between any two arbitrary releases by clicking the icon in the header of the release column. Select the two versions to compare, and click Diff releases to show the relative changes between the two releases.
-
(Optional) Click the View preflight checks icon to view or re-run the preflight checks.
-
Return to the Version History tab and click Deploy next to the target version.
Air Gap Environments
To perform an air gap update from the Admin Console:
-
In the Vendor Portal, go the channel where the target release is promoted to build and download the new
.airgap
bundle:-
If the Automatically create airgap builds for newly promoted releases in this channel setting is enabled on the channel, watch for the build status to complete.
-
If automatic air gap builds are not enabled, go to the Release history page for the channel and build the air gap bundle manually.
-
-
After the build completes, download the bundle. Ensure that you can access the downloaded bundle from the environment where you will install the application.
-
(Optional) View the contents of the downloaded bundle:
tar -zxvf AIRGAP_BUNDLE
Where
AIRGAP_BUNDLE
is the filename for the.airgap
bundle that you downloaded. -
In the Admin Console, go to the Version History tab.
-
Click Upload a new version.
A new upstream version displays in the list of available versions.
-
(Optional) When there are multiple versions of an application, you can compare the changes between them by clicking Diff releases in the right corner.
You can review changes between any two arbitrary releases by clicking the icon in the header of the release column. Select the two versions to compare, and click Diff releases to show the relative changes between the two releases.
-
(Optional) Click the View preflight checks icon to view or re-run the preflight checks.
-
Return to the Version History tab and click Deploy next to the target version.
Update the kURL Cluster
After updating the kURL installer spec, you can rerun the kURL installation script to update a kURL cluster. For more information about kURL cluster udpates, see About kURL Cluster Updates.
For more information about managing nodes in kURL clusters, including how to safely reset, reboot, and remove nodes when performing maintenance tasks, see Managing Nodes in the open source kURL documentation.
The Kubernetes scheduler automatically reschedules Pods to other nodes during maintenance. Any deployments or StatefulSets with a single replica experience downtime while being rescheduled.
Online Environments
To update the kURL cluster in an online environment:
-
Edit the kURL installer spec as desired. For example, update the version of Kubernetes or add, remove, or update add-ons. For more information, see Creating a kURL Installer.
-
Run the kURL installation script on any primary node in the cluster:
curl -sSL https://k8s.kurl.sh/APP_SLUG | sudo bash -s ADVANCED_OPTIONS
Replace:
-
APP_SLUG
with the unique slug for the application. -
ADVANCED_OPTIONS
optionally with any flags listed in Advanced Options in the kURL documentation.To use no advanced installation options, remove
-s ADVANCED_OPTIONS
from the command.See the following recommendations for advanced options:
-
installer-spec-file: If you used the
installer-spec-file
flag to pass apatch.yaml
file when you installed, you must pass the samepatch.yaml
file when you upgrade. This prevents the installer from overwriting any configuration from yourpatch.yaml
file and making changes to the add-ons in your cluster. For example:installer-spec-file="./patch.yaml"
. -
app-version-label: By default, the script also upgrades your application to the latest version when you run the installation script.
You can specify a target application version with the
app-version-label
flag. To avoid upgrading your application version, set theapp-version-label
flag to the currently installed application version. For example:app-version-label=1.5.0
.
-
-
-
(Kubernetes Upgrades Only) If a Kubernetes upgrade is required, the script automatically prints a
Drain local node and apply upgrade?
prompt. Confirm the prompt to drain the local primary node and apply the Kubernetes upgrade to the control plane.The script continues to drain and upgrade nodes sequentially. For each node, the script prints a command that you must run on the node to upgrade Kubernetes. For more information, see About Kubernetes Updates in About kURL Cluster Updates.
Air Gap Environments
For air gap installations, you must load images on each node in the cluster before you can run the installation script to update Kubernetes and any add-ons. This is because upgraded components might have Pods scheduled on any node in the cluster.
To update the kURL cluster in an air gap environment:
-
Edit the kURL installer spec as desired. For example, update the version of Kubernetes or add, remove, or update add-ons. For more information, see Creating a kURL Installer.
-
Repeat the following steps on each node in the cluster to download and extract the kURL
.tar.gz
air gap bundle for the updated spec:-
Download the kURL
.tar.gz
air gap bundle from the channel where the new kURL installer spec is promoted:-
To download the kURL air gap bundle for the Stable channel:
export REPLICATED_APP=APP_SLUG
curl -LS https://k8s.kurl.sh/bundle/$REPLICATED_APP.tar.gz -o $REPLICATED_APP.tar.gzWhere
APP_SLUG
is the unqiue slug for the application. -
To download the kURL bundle for channels other than Stable:
replicated channel inspect CHANNEL
Replace
CHANNEL
with the exact name of the target channel, which can include uppercase letters or special characters, such asUnstable
ormy-custom-channel
.In the output of this command, copy the curl command with the air gap URL.
-
-
Extract the contents of the bundle:
tar -xvzf FILENAME.tar.gz
Replace
FILENAME
with the name of the downloaded kURL.tar.gz
air gap bundle.
-
-
Run the following KURL script to ensure all required images are available:
cat tasks.sh | sudo bash -s load-images
noteThe kURL installation script that you will run in the next step also performs a check for required images and prompts you to run the
load-images
command if any images are missing. -
Run the kURL installation script on any primary node in the cluster with the
airgap
option:cat install.sh | sudo bash -s airgap OTHER_ADVANCED_OPTIONS
Replace
OTHER_ADVANCED_OPTIONS
optionally with any flags listed in Advanced Options in the kURL documentation.See the following recommendations for advanced options:
-
installer-spec-file: If you used the
installer-spec-file
flag to pass apatch.yaml
file when you installed, you must pass the samepatch.yaml
file when you upgrade. This prevents the installer from overwriting any configuration from yourpatch.yaml
file and making changes to the add-ons in your cluster. For example:installer-spec-file="./patch.yaml"
. -
app-version-label: By default, the script also upgrades your application to the latest version when you run the installation script.
You can specify a target application version with the
app-version-label
flag. To avoid upgrading your application version, set theapp-version-label
flag to the currently installed application version. For example:app-version-label=1.5.0
.
-
-
(Kubernetes Upgrades Only) If a Kubernetes upgrade is required, the script automatically prints a
Drain local node and apply upgrade?
prompt. Confirm the prompt to drain the local primary node and apply the Kubernetes upgrade to the control plane.The script continues to drain and upgrade nodes sequentially. For each node, the script prints a command that you must run on the node to upgrade Kubernetes. For more information, see About Kubernetes Updates in About kURL Cluster Updates.
noteIf Kubernetes must be upgraded by more than one minor version, the script automatically searches for the required Kubernetes assets in the
/var/lib/kurl/assets/
directory. If the assets are not available, the script prints a command to download the assets as atar.gz
package. Download and provide the absolute path to the package when prompted to continue with the upgrade.