Skip to content

Commit 664d30f

Browse files
authored
Merge pull request #3009 from replicatedhq/dx/sc-118600/add-replicated-values-schema
feat(sdk): add Replicated Helm Install values schema
2 parents 0b07c67 + 252377a commit 664d30f

File tree

9 files changed

+147
-46
lines changed

9 files changed

+147
-46
lines changed

docs/partials/helm/_helm-diagram-overview.mdx

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
When a user installs a Helm chart that includes the Replicated SDK as a dependency, a set of default SDK values are included in the `replicated` key of the parent chart's values file.
2+
3+
For example:
4+
5+
```yaml
6+
# values.yaml
7+
8+
replicated:
9+
enabled: true
10+
appName: gitea
11+
channelID: 2jKkegBMseH5w...
12+
channelName: Beta
13+
channelSequence: 33
14+
integration:
15+
enabled: true
16+
license: {}
17+
parentChartURL: oci://registry.replicated.com/gitea/beta/gitea
18+
releaseCreatedAt: "2024-11-25T20:38:22Z"
19+
releaseNotes: 'CLI release'
20+
releaseSequence: 88
21+
replicatedAppEndpoint: https://replicated.app
22+
versionLabel: Beta-1234
23+
```
24+
25+
These `replicated` values can be referenced by the application or set during installation as needed. For example, if users need to add labels or annotations to everything that runs in their cluster, then they can pass the labels or annotations to the relevant value in the SDK subchart.
26+
27+
For the default Replicated SDK Helm chart values file, see [values.yaml.tmpl](https://github.com/replicatedhq/replicated-sdk/blob/main/chart/values.yaml.tmpl) in the [replicated-sdk](https://github.com/replicatedhq/replicated-sdk) repository in GitHub.
28+
29+
The SDK Helm values also include a `replicated.license` field, which is a string that contains the YAML representation of the customer license. For more information about the built-in fields in customer licenses, see [Built-In License Fields](licenses-using-builtin-fields).

docs/vendor/helm-image-registry.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ To enable the proxy registry:
5050
```yaml
5151
# values.yaml
5252
...
53+
dockerconfigjson: '{{ .Values.global.replicated.dockerconfigjson }}'
5354
images:
5455
myapp:
5556
# Add image URL in the values file

docs/vendor/helm-install-overview.mdx

Lines changed: 9 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import HelmDiagramOverview from "../partials/helm/_helm-diagram-overview.mdx"
21
import Helm from "../partials/helm/_helm-definition.mdx"
32

43
# About Helm Installations with Replicated
@@ -13,48 +12,23 @@ Replicated strongly recommends that all applications are packaged using Helm bec
1312

1413
Existing releases in the Replicated Platform that already support installation with Replicated KOTS and Replicated Embedded Cluster (and that include one or more Helm charts) can also be installed with the Helm CLI; it is not necessary to create and manage separate releases or channels for each installation method.
1514

15+
For information about how to install with Helm, see:
16+
* [Installing with Helm](/vendor/install-with-helm)
17+
* [Installing and Updating with Helm in Air Gap Environments (Alpha)](helm-install-airgap)
18+
1619
The following diagram shows how Helm charts distributed with Replicated are installed with Helm in online (internet-connected) customer environments:
1720

1821
<img src="/images/helm-install-diagram.png" alt="diagram of a helm chart in a custom environment" width="700px"/>
1922

2023
[View a larger version of this image](/images/helm-install-diagram.png)
2124

22-
<HelmDiagramOverview/>
25+
As shown in the diagram above, when a release containing one or more Helm charts is promoted to a channel, the Replicated Vendor Portal automatically extracts any Helm charts included in the release. These charts are pushed as OCI objects to the Replicated registry. The Replicated registry is a private OCI registry hosted by Replicated at `registry.replicated.com`. For information about security for the Replicated registry, see [Replicated Registry Security](packaging-private-registry-security).
2326

24-
For information about how to install with Helm, see:
25-
* [Installing with Helm](/vendor/install-with-helm)
26-
* [Installing and Updating with Helm in Air Gap Environments (Alpha)](helm-install-airgap)
27+
For example, if your application in the Vendor Portal is named My App and you promote a release containing a Helm chart with `name: my-chart` to a channel with the slug `beta`, then the Vendor Portal pushes the chart to the following location: `oci://registry.replicated.com/my-app/beta/my-chart`.
28+
29+
Customers can install your Helm chart by first logging in to the Replicated registry with their unique license ID. This step ensures that any customer who installs your chart from the registry has a valid, unexpired license. After the customer logs in to the Replicated registry, they can run `helm install` to install the chart from the registry.
2730

28-
## About the `global.replicated` Helm Values
29-
30-
When a customer installs your Helm chart from the Replicated registry, the Replicated registry injects values into the `global.replicated` field of the Helm chart values file.
31-
32-
The following is an example of a Helm values file containing the `global.replicated` field injected by the Replicated registry:
33-
34-
```yaml
35-
# Helm values.yaml
36-
global:
37-
replicated:
38-
channelName: Stable
39-
customerEmail: [email protected]
40-
customerName: Example Customer
41-
dockerconfigjson: eyJhdXRocyI6eyJd1dIRk5NbEZFVGsxd2JGUmFhWGxYWm5scloyNVRSV1pPT2pKT2NGaHhUVEpSUkU1...
42-
licenseFields:
43-
expires_at:
44-
description: License Expiration
45-
name: expires_at
46-
signature:
47-
v1: iZBpESXx7fpdtnbMKingYHiJH42rP8fPs0x8izy1mODckGBwVoA...
48-
title: Expiration
49-
value: "2023-05-30T00:00:00Z"
50-
valueType: String
51-
licenseID: YiIXRTjiB7R...
52-
licenseType: dev
53-
```
54-
55-
The values in the `global.replicated` field provide information about the following:
56-
* Details about the fields in the customer's license, such as the field name, description, signature, value, and any custom license fields that you define. You can use this license information to check license entitlments before the application is installed. For more information, see [Checking Entitlements in Helm Charts Before Deployment](/vendor/licenses-reference-helm).
57-
* A base64 encoded Docker configuration file. To proxy images from an external private registry with the Replicated proxy registry, you can use the `global.replicated.dockerconfigjson` field to create an image pull secret for the proxy registry. For more information, see [Proxying Images for Helm Installations](/vendor/helm-image-registry).
31+
During installation, the Replicated registry injects values into the `global.replicated` key of the parent Helm chart's values file. For more information about the values schema, see [Helm global.replicated Values Schema](helm-install-values-schema).
5832

5933
## Limitations
6034

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
import SdkValues from "../partials/replicated-sdk/_sdk-values.mdx"
2+
3+
# Helm global.replicated Values Schema
4+
5+
This topic describes the `global.replicated` values that are injected in the values file of an application's parent Helm chart during Helm installations with Replicated.
6+
7+
## Overview
8+
9+
When a user installs a Helm application with the Helm CLI, the Replicated registry injects a set of customer-specific values into the `global.replicated` key of the parent Helm chart's values file.
10+
11+
The values in the `global.replicated` field include the following:
12+
13+
* The fields in the customer's license, such as the field names, descriptions, signatures, values, and any custom license fields that you define. Vendors can use this license information to check entitlements before the application is installed. For more information, see [Checking Entitlements in Helm Charts Before Deployment](/vendor/licenses-reference-helm).
14+
15+
* A base64 encoded Docker configuration file. To proxy images from an external private registry with the Replicated proxy registry, you can use the `global.replicated.dockerconfigjson` field to create an image pull secret for the proxy registry. For more information, see [Proxying Images for Helm Installations](/vendor/helm-image-registry).
16+
17+
The following is an example of a Helm values file containing the `global.replicated` values:
18+
19+
```yaml
20+
# Helm values.yaml
21+
global:
22+
replicated:
23+
channelName: Stable
24+
customerEmail: [email protected]
25+
customerName: Example Customer
26+
dockerconfigjson: eyJhdXRocyI6eyJd1dIRk5NbEZFVGsxd2JGUmFhWGxYWm5scloyNVRSV1pPT2pKT2NGaHhUVEpSUkU1...
27+
licenseFields:
28+
expires_at:
29+
description: License Expiration
30+
name: expires_at
31+
signature:
32+
v1: iZBpESXx7fpdtnbMKingYHiJH42rP8fPs0x8izy1mODckGBwVoA...
33+
title: Expiration
34+
value: "2023-05-30T00:00:00Z"
35+
valueType: String
36+
licenseID: YiIXRTjiB7R...
37+
licenseType: dev
38+
```
39+
40+
## `global.replicated` Values Schema
41+
42+
The `global.replicated` values schema contains the following fields:
43+
44+
| Field | Type | Description |
45+
| --- | --- | --- |
46+
| `channelName` | String | The name of the release channel |
47+
| `customerEmail` | String | The email address of the customer |
48+
| `customerName` | String | The name of the customer |
49+
| `dockerconfigjson` | String | Base64 encoded docker config json for pulling images |
50+
| `licenseFields`| | A list containing each license field in the customer's license. Each element under `licenseFields` has the following properties: `description`, `signature`, `title`, `value`, `valueType`. `expires_at` is the default `licenseField` that all licenses include. Other elements under `licenseField` include the custom license fields added by vendors in the Vendor Portal. For more information, see [Managing Customer License Fields](/vendor/licenses-adding-custom-fields). |
51+
| `licenseFields.[FIELD_NAME].description` | String | Description of the license field |
52+
| `licenseFields.[FIELD_NAME].signature.v1` | Object | Signature of the license field |
53+
| `licenseFields.[FIELD_NAME].title` | String | Title of the license field |
54+
| `licenseFields.[FIELD_NAME].value` | String | Value of the license field |
55+
| `licenseFields.[FIELD_NAME].valueType` | String | Type of the license field value |
56+
| `licenseID` | String | The unique identifier for the license |
57+
| `licenseType` | String | The type of license, such as "dev" or "prod". For more information, see [Customer Types](/vendor/licenses-about#customer-types) in _About Customers and Licensing_. |
58+
59+
## Replicated SDK Helm Values
60+
61+
<SdkValues/>

docs/vendor/licenses-using-builtin-fields.mdx

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,47 @@ The license associated with each customer record in the Replicated Vendor Portal
1010

1111
When a customer installs an application distributed with Replicated, the values for each built-in and custom field in their license can be accessed using the [Replicated SDK](/vendor/replicated-sdk-overview) in-cluster API [license](/reference/replicated-sdk-apis#license) endpoints. Applications installed with a Replicated installer (KOTS, kURL, Embedded Cluster) can also access license fields using the Replicated KOTS [LicenseFieldValue](/reference/template-functions-license-context#licensefieldvalue) template function.
1212

13+
The following shows an example of a customer license:
14+
15+
```yaml
16+
apiVersion: kots.io/v1beta1
17+
kind: License
18+
metadata:
19+
name: customertest
20+
spec:
21+
appSlug: gitea
22+
channelID: 2iy68JBTkvUqamgD...
23+
channelName: Beta
24+
channels:
25+
- channelID: 2iy68JBTkvUqamgD...
26+
channelName: Beta
27+
channelSlug: beta
28+
endpoint: https://replicated.app
29+
isDefault: true
30+
isSemverRequired: true
31+
replicatedProxyDomain: proxy.replicated.com
32+
customerEmail: [email protected]
33+
customerName: Customer Test
34+
endpoint: https://replicated.app
35+
entitlements:
36+
expires_at:
37+
description: License Expiration
38+
signature: {}
39+
title: Expiration
40+
value: ""
41+
valueType: String
42+
isAirgapSupported: true
43+
isEmbeddedClusterDownloadEnabled: true
44+
isKotsInstallEnabled: true
45+
isSemverRequired: true
46+
isSupportBundleUploadSupported: true
47+
licenseID: 2sY6ZC2J9sO2...
48+
licenseSequence: 4
49+
licenseType: prod
50+
replicatedProxyDomain: proxy.replicated.com
51+
signature: eyJsaWNlbnNlRGF...
52+
```
53+
1354
## License Field Names
1455
1556
This section lists the built-in fields that are included in customer licenses for applications distributed with Replicated.

docs/vendor/replicated-sdk-overview.md renamed to docs/vendor/replicated-sdk-overview.mdx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import SDKOverview from "../partials/replicated-sdk/_overview.mdx"
2-
import HelmDiagramOverview from "../partials/helm/_helm-diagram-overview.mdx"
3-
import DependencyYaml from "../partials/replicated-sdk/_dependency-yaml.mdx"
2+
import SdkValues from "../partials/replicated-sdk/_sdk-values.mdx"
43

54
# About the Replicated SDK
65

@@ -29,3 +28,7 @@ At startup and when serving requests, the SDK retrieves and caches the latest in
2928
If the upstream APIs are not available at startup, the SDK does not accept connections or serve requests until it is able to communicate with the upstream APIs. If communication fails, the SDK retries every 10 seconds and the SDK pod is at `0/1` ready.
3029

3130
When serving requests, if the upstream APIs become unavailable, the SDK serves from the memory cache and sets the `X-Replicated-Served-From-Cache` header to `true`. Additionally, rapid successive requests to same SDK endpoint with the same request properties will be rate-limited returning the last cached payload and status code without reaching out to the upstream APIs. A `X-Replicated-Rate-Limited` header will set to `true`.
31+
32+
## Replicated SDK Helm Values
33+
34+
<SdkValues/>

docs/vendor/replicated-sdk-slsa-validating.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
import SDKOverview from "../partials/replicated-sdk/_overview.mdx"
2-
import HelmDiagramOverview from "../partials/helm/_helm-diagram-overview.mdx"
3-
import DependencyYaml from "../partials/replicated-sdk/_dependency-yaml.mdx"
4-
51
# SLSA Provenance Validation Process for the Replicated SDK
62

73
This topic describes the process to perform provenance validation on the Replicated SDK.

sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,7 @@ const sidebars = {
506506
label: 'Helm Installations with Replicated',
507507
items: [
508508
'vendor/helm-install-overview',
509+
'vendor/helm-install-values-schema',
509510
'vendor/install-with-helm',
510511
'vendor/helm-install-airgap',
511512
'vendor/using-third-party-registry-proxy',

0 commit comments

Comments
 (0)