Step 3: Add the Chart Archive to a Release
Next, add the Helm chart archive to a new release for the application in the Replicated Vendor Portal. The purpose of this step is to configure a release that supports installation with Replicated Embedded Cluster.
A release represents a single version of your application and contains your application files. Each release is promoted to one or more channels. Channels provide a way to progress releases through the software development lifecycle: from internal testing, to sharing with early-adopters, and finally to making the release generally available.
To create a release:
-
In the
gitea
directory, create a subdirectory namedmanifests
:mkdir manifests
You will add the files required to support installation with Replicated KOTS to this subdirectory.
-
Move the Helm chart archive that you created to
manifests
:mv gitea-1.0.6.tgz manifests
-
In
manifests
, create the YAML manifests required by KOTS:cd manifests
touch gitea.yaml kots-app.yaml k8s-app.yaml embedded-cluster.yaml
-
In each of the files that you created, paste the corresponding YAML provided in the tabs below:
- gitea.yaml
- kots-app.yaml
- k8s-app.yaml
- embedded-cluster.yaml
Description
The KOTS HelmChart custom resource provides instructions to KOTS about how to deploy the Helm chart. The
name
andchartVersion
listed in the HelmChart custom resource must match the name and version of a Helm chart archive in the release. TheoptionalValues
field sets the specified Helm values when a given conditional statement evaluates to true. In this case, if the application is installed with Embedded Cluster, then the Gitea service type is set toNodePort
and the node port is set to"32000"
. This will allow Gitea to be accessed from the local machine after deployment.YAML
apiVersion: kots.io/v1beta2
kind: HelmChart
metadata:
name: gitea
spec:
# chart identifies a matching chart from a .tgz
chart:
name: gitea
chartVersion: 1.0.6
optionalValues:
- when: 'repl{{ eq Distribution "embedded-cluster" }}'
recursiveMerge: false
values:
service:
type: NodePort
nodePorts:
http: "32000"Description
The KOTS Application custom resource enables features in the Replicated Admin Console such as branding, release notes, application status indicators, and custom graphs.
The YAML below provides a name for the application to display in the Admin Console, adds a custom status informer that displays the status of the
gitea
Deployment resource in the Admin Console dashboard, adds a custom application icon, and adds the port where the Gitea service can be accessed so that the user can open the application after installation.YAML
apiVersion: kots.io/v1beta1
kind: Application
metadata:
name: gitea
spec:
title: Gitea
statusInformers:
- deployment/gitea
ports:
- serviceName: "gitea"
servicePort: 3000
localPort: 32000
applicationUrl: "http://gitea"
icon: https://raw.githubusercontent.com/cncf/artwork/master/projects/kubernetes/icon/color/kubernetes-icon-color.pngDescription
The Kubernetes Application custom resource supports functionality such as including buttons and links on the Replicated Admin Console dashboard. The YAML below adds an Open App button to the Admin Console dashboard that opens the application using the service port defined in the KOTS Application custom resource.
YAML
apiVersion: app.k8s.io/v1beta1
kind: Application
metadata:
name: "gitea"
spec:
descriptor:
links:
- description: Open App
# needs to match applicationUrl in kots-app.yaml
url: "http://gitea"Description
To install your application with Embedded Cluster, an Embedded Cluster Config must be present in the release. At minimum, the Embedded Cluster Config sets the version of Embedded Cluster that will be installed. You can also define several characteristics about the cluster.
YAML
apiVersion: embeddedcluster.replicated.com/v1beta1
kind: Config
spec:
version: 1.17.0+k8s-1.30 -
Lint:
replicated release lint --yaml-dir .
RULE TYPE FILENAME LINE MESSAGE
config-spec warn Missing config spec
preflight-spec warn Missing preflight spec
troubleshoot-spec warn Missing troubleshoot spec
nonexistent-status-informer-object warn kots-app.yaml 8 Status informer points to a nonexistent kubernetes object. If this is a Helm resource, this warning can be ignored.noteYou can ignore any warning messages for the purpose of this tutorial.
-
Create a release:
replicated release create --yaml-dir .
Example output:
• Reading manifests from . ✓
• Creating Release ✓
• SEQUENCE: 1 -
Log in to the Vendor Portal and go to Releases.
The release that you created is listed under All releases.
-
Click the dot menu then Edit release to view the files in the release.
View a larger version of this image
In the release editor, you can see the manifest files that you created, the Helm chart
.tgz
archive, and theChart.yaml
andvalues.yaml
files for the Gitea Helm chart. You can also see the same warning messages that were displayed in the CLI output. -
At the top of the page, click Promote.
-
In the dialog, for Which channels you would like to promote this release to?, select Unstable. Unstable is a default channel that is intended for use with internal testing. Click Promote.
Next Step
Create a customer with the Embedded Cluster entitlement so that you can install the release using Embedded Cluster. See Step 4: Create an Embedded Cluster-Enabled Customer.