Installing the Replicated SDK (Beta)
This topic describes the methods for distributing and installing the Replicated SDK.
It includes information about how to install the SDK alongside Helm chart- or standard manifest-based applications using the Helm CLI or Replicated KOTS. It also includes information about installing the SDK separately from an application as a standalone component in integration mode.
For information about installing the SDK in air gap mode, see Installing the SDK in Air Gap Environments.
Requirement
To install the SDK with KOTS, KOTS v1.104.0 or later and the SDK version 1.0.0-beta.12 or later are required. You can verify the version of KOTS installed with kubectl kots version
.
Install the SDK as a Subchart
When included as a dependency of your application Helm chart, the SDK is installed as a subchart alongside the application.
To install the SDK as a subchart:
-
In your application Helm chart
Chart.yaml
file, add the YAML below to declare the SDK as a dependency. If your application is installed as multiple charts, declare the SDK as a dependency of the chart that customers install first. Do not declare the SDK in more than one chart.# Chart.yaml
dependencies:
- name: replicated
repository: oci://registry.replicated.com/library
version: 1.0.0-beta.31For the latest version information for the Replicated SDK, see the replicated-sdk repository in GitHub.
-
(Recommended) Log out of the Replicated registry:
helm registry logout registry.replicated.com
Replicated recommends that you log out of the Replicated registry to avoid errors that can occur when Helm attempts to pull the SDK chart from the registry if you are logged in with a license that has expired.
-
Update the
charts/
directory:helm dependency update
-
Package the Helm chart into a
.tgz
archive:helm package .
-
Add the chart archive to a new release. For more information, see Managing Releases with the CLI or Managing Releases with the Vendor Portal.
-
(Optional) Add a HelmChart custom resource to the release to support installation with KOTS. For more information, see About Distributing Helm Charts with KOTS and HelmChart v2.
-
Save and promote the release to an internal-only channel used for testing, such as the default Unstable channel.
-
Install the release using the Helm CLI or KOTS. For information about installing releases with the Helm CLI, see Installing with Helm. For information about installing with KOTS, see About Installing an Application.
-
Confirm that the SDK was installed by seeing that the
replicated
Deployment was created:kubectl get deploy --namespace NAMESPACE
Where
NAMESPACE
is the namespace in the cluster where the application and the SDK are installed.Example output:
NAME READY UP-TO-DATE AVAILABLE AGE
my-app 1/1 1 1 35s
replicated 1/1 1 1 35s
Install the SDK Alongside a Standard Manifest-Based Application
For applications that use standard Kubernetes manifest files, the SDK Helm chart can be added to a release and then installed by KOTS alongside the application.
To install the SDK with KOTS, KOTS v1.104.0 or later and the SDK version 1.0.0-beta.12 or later are required. You can verify the version of KOTS installed with kubectl kots version
.
To add the SDK Helm chart to a release for a standard manifest-based application:
-
Install the Helm CLI using Homebrew:
brew install helm
For more information, including alternative installation options, see Install Helm in the Helm documentation.
-
Download the
.tgz
chart archive for the SDK Helm chart:helm pull oci://registry.replicated.com/library/replicated --version SDK_VERSION
Where
SDK_VERSION
is the version of the SDK to install. For a list of available SDK versions, see the replicated-sdk repository in GitHub.The output of this command is a
.tgz
file with the naming conventionCHART_NAME-CHART_VERSION.tgz
. For example,replicated-1.0.0-beta.31.tgz
.For more information and additional options, see Helm Pull in the Helm documentation.
-
Add the SDK
.tgz
chart archive to a new release. For more information, see Managing Releases with the CLI or Managing Releases with the Vendor Portal.The following shows an example of the SDK Helm chart added to a draft release for a standard manifest-based application:
-
If one was not created automatically, add a Replicated HelmChart custom resource to the release. HelmChart custom resources have
apiVersion: kots.io/v1beta2
andkind: HelmChart
.Example:
apiVersion: kots.io/v1beta2
kind: HelmChart
metadata:
name: replicated
spec:
# chart identifies a matching chart from a .tgz
chart:
# for name, enter replicated
name: replicated
# for chartversion, enter the version of the
# SDK Helm chart in the release
chartVersion: 1.0.0-beta.31As shown in the example above, the HelmChart custom resource requires the name and version of the SDK Helm chart that you added to the release:
chart.name
: The name of the SDK Helm chart isreplicated
. You can find the chart name in thename
field of the SDK Helm chartChart.yaml
file.chart.chartVersion
: The chart version varies depending on the version of the SDK that you pulled and added to the release. You can find the chart version in theversion
field of SDK Helm chartChart.yaml
file.
For more information about configuring the HelmChart custom resource to support KOTS installations, see About Distributing Helm Charts with KOTS and HelmChart v2.
-
Save and promote the release to an internal-only channel used for testing, such as the default Unstable channel.
-
Install the release using KOTS. For more information, see About Installing an Application.
-
Confirm that the SDK was installed by seeing that the
replicated
Deployment was created:kubectl get deploy --namespace NAMESPACE
Where
NAMESPACE
is the namespace in the cluster where the application, the Admin Console, and the SDK are installed.Example output:
NAME READY UP-TO-DATE AVAILABLE AGE
kotsadm 1/1 1 1 112s
my-app 1/1 1 1 28s
replicated 1/1 1 1 27s
Install the SDK in Integration Mode
You can use the Replicated SDK in integration mode to develop locally against the SDK API without needing to add the SDK to your application, create a release in the Replicated Vendor Portal, or make changes in your environment. You can also use integration mode to test sending instance data to the Vendor Portal, including any custom metrics that you configure.
To use integration mode, install the Replicated SDK as a standalone component using a valid development license. For more information, see Developing Against the SDK API.