Skip to content

Commit 9a8e659

Browse files
authored
Move info about port forwarding the SDK API service (#2900)
* Move info about port forwarding the SDK API service * make integration mode procedure into partial
1 parent d94f7d5 commit 9a8e659

File tree

7 files changed

+100
-107
lines changed

7 files changed

+100
-107
lines changed
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
You can install 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.
2+
3+
To use integration mode, install the Replicated SDK as a standalone component using a valid Development license created in the Vendor Portal. After you install in integration mode, the SDK provides default mock data for requests to the SDK API `app` endpoints. Requests to the `license` endpoints use the real data from your Development license.
4+
5+
To install the SDK in integration mode:
6+
7+
1. Create a Development license that you can use to install the SDK in integration mode:
8+
9+
1. In the Vendor Portal, go to **Customers** and click **Create customer**.
10+
11+
1. Complete the following fields:
12+
13+
1. For **Customer name**, add a name for the customer.
14+
15+
1. For **Assigned channel**, assign the customer to the channel that you use for testing. For example, Unstable.
16+
17+
1. For **Customer type**, select **Development**.
18+
19+
1. For **Customer email**, add the email address that you want to use for the license.
20+
21+
1. For **Install types**, ensure that the **Existing Cluster (Helm CLI)** option is enabled.
22+
23+
1. (Optional) Add any license field values that you want to use for testing:
24+
25+
1. For **Expiration policy**, you can add an expiration date for the license.
26+
27+
1. For **Custom fields**, you can add values for any custom license fields in your application. For information about how to create custom license fields, see [Managing Customer License Fields](/vendor/licenses-adding-custom-fields).
28+
29+
1. Click **Save Changes**.
30+
31+
1. On the **Manage customer** page for the customer you created, click **Helm install instructions**.
32+
33+
<img alt="Helm install instructions button on the manage customer page" src="/images/helm-install-instructions-button.png" width="700px"/>
34+
35+
[View a larger version of this image](/images/helm-install-instructions-button.png)
36+
37+
1. In the **Helm install instructions** dialog, copy and run the command to log in to the Replicated registry.
38+
39+
<img alt="Registry login command in the Helm install instructions dialog" src="/images/helm-install-instructions-registry-login.png" width="600px"/>
40+
41+
[View a larger version of this image](/images/helm-install-instructions-registry-login.png)
42+
43+
1. From the same dialog, copy and run the command to install the SDK in integration mode:
44+
45+
<img alt="SDK integration mode install command in the Helm install instructions dialog" src="/images/helm-install-instructions-sdk-integration.png" width="600px"/>
46+
47+
[View a larger version of this image](/images/helm-install-instructions-sdk-integration.png)
48+
49+
1. Make requests to the SDK API from your application. You can access the SDK API for testing by forwarding the API service to your local machine. For more information, see [Port Forwarding the SDK API Service](/vendor/replicated-sdk-development#port-forward).
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
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`.
1+
To install the SDK with a Replicated installer, 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`. For Replicated Embedded Cluster installations, you can see the version of KOTS that is installed by your version of Embedded Cluster in the [Embedded Cluster Release Notes](/release-notes/rn-embedded-cluster).

docs/reference/replicated-sdk-apis.md

Lines changed: 2 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,9 @@ The Replicated SDK provides an API that you can use to embed Replicated function
44

55
For example, if your application includes a UI where users manage their application instance, then you can use the `/api/v1/app/updates` endpoint to include messages in the UI that encourage users to upgrade when new versions are available. You could also revoke access to the application during runtime when a license expires using the `/api/v1/license/fields` endpoint.
66

7-
For more information about how to get started with the Replicated SDK, see [About the Replicated SDK (Beta)](/vendor/replicated-sdk-overview).
7+
For more information about how to get started with the Replicated SDK, see [About the Replicated SDK](/vendor/replicated-sdk-overview).
88

9-
## Use Port Forwarding to Access the SDK API
10-
11-
After the Replicated SDK is installed and initialized in a cluster, the Replicated SDK API is exposed at `replicated:3000`. You can access the SDK API for testing by forwarding port 3000 to your local machine.
12-
13-
To use port forwarding to access the SDK API:
14-
15-
1. Install the SDK in your cluster. See [Installing the Replicated SDK](/vendor/replicated-sdk-installing).
16-
17-
1. Run the following command to port forward to the SDK API service:
18-
19-
```bash
20-
kubectl port-forward service/replicated 3000
21-
```
22-
```
23-
Forwarding from 127.0.0.1:3000 -> 3000
24-
Forwarding from [::1]:3000 -> 3000
25-
```
26-
27-
1. With the port forward running, test the SDK API endpoints as desired. For example:
28-
29-
```bash
30-
curl localhost:3000/api/v1/license/fields/expires_at
31-
curl localhost:3000/api/v1/license/fields/{field}
32-
```
9+
For information about how to develop against the Replicated SDK API with mock data, see [Developing Against the Replicated SDK](/vendor/replicated-sdk-developing).
3310

3411
## app
3512

docs/vendor/replicated-sdk-development.md

Lines changed: 0 additions & 64 deletions
This file was deleted.
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import IntegrationMode from "../partials/replicated-sdk/_integration-mode-install.mdx"
2+
3+
# Developing Against the SDK API (Beta)
4+
5+
This topic describes how to develop against the SDK API to test changes locally. It includes information about installing the SDK in integration mode and port forwarding the SDK API service to your local machine. For more information about the SDK API, see [Replicated SDK API (Beta)](/reference/replicated-sdk-apis).
6+
7+
## Install the SDK in Integration Mode
8+
9+
<IntegrationMode/>
10+
11+
## Port Forwarding the SDK API Service {#port-forward}
12+
13+
After the Replicated SDK is installed and initialized in a cluster, the Replicated SDK API is exposed at `replicated:3000`. You can access the SDK API for testing by forwarding port 3000 to your local machine.
14+
15+
To port forward the SDK API service to your local machine:
16+
17+
1. Run the following command to port forward to the SDK API service:
18+
19+
```bash
20+
kubectl port-forward service/replicated 3000
21+
```
22+
```
23+
Forwarding from 127.0.0.1:3000 -> 3000
24+
Forwarding from [::1]:3000 -> 3000
25+
```
26+
27+
1. With the port forward running, test the SDK API endpoints as desired. For example:
28+
29+
```bash
30+
curl localhost:3000/api/v1/license/fields/expires_at
31+
curl localhost:3000/api/v1/license/fields/{field}
32+
```
33+
34+
For more information, see [Replicated SDK API (Beta)](/reference/replicated-sdk-apis).
35+
36+
:::note
37+
When the SDK is installed in integration mode, requests to the `license` endpoints use your actual development license data, while requests to the `app` endpoints use the default mock data.
38+
:::

docs/vendor/replicated-sdk-installing.mdx

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
import DependencyYaml from "../partials/replicated-sdk/_dependency-yaml.mdx"
22
import KotsVerReq from "../partials/replicated-sdk/_kots-version-req.mdx"
33
import RegistryLogout from "../partials/replicated-sdk/_registry-logout.mdx"
4+
import IntegrationMode from "../partials/replicated-sdk/_integration-mode-install.mdx"
45

56
# Installing the Replicated SDK (Beta)
67

78
This topic describes the methods for distributing and installing the Replicated SDK.
89

9-
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.
10+
It includes information about how to install the SDK alongside Helm charts or Kubernetes manifest-based applications using the Helm CLI or a Replicated installer (Replicated KOTS, kURL, Embedded Cluster). It also includes information about installing the SDK as a standalone component in integration mode.
1011

1112
For information about installing the SDK in air gap mode, see [Installing the SDK in Air Gap Environments](replicated-sdk-airgap).
1213

@@ -65,13 +66,13 @@ To install the SDK as a subchart:
6566
replicated 1/1 1 1 35s
6667
```
6768

68-
## Install the SDK Alongside a Standard Manifest-Based Application
69+
## Install the SDK Alongside a Kubernetes Manifest-Based Application
6970

70-
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.
71+
For applications that use Kubernetes manifest files instead of Helm charts, the SDK Helm chart can be added to a release and then installed by KOTS alongside the application.
7172

7273
<KotsVerReq/>
7374

74-
To add the SDK Helm chart to a release for a standard manifest-based application:
75+
To add the SDK Helm chart to a release for a Kubernetes manifest-based application:
7576

7677
1. Install the Helm CLI using Homebrew:
7778

@@ -99,7 +100,7 @@ To add the SDK Helm chart to a release for a standard manifest-based application
99100

100101
[View a larger version of this image](/images/sdk-kots-release.png)
101102

102-
1. If one was not created automatically, add a Replicated HelmChart custom resource to the release. HelmChart custom resources have `apiVersion: kots.io/v1beta2` and `kind: HelmChart`.
103+
1. If one was not created automatically, add a KOTS HelmChart custom resource to the release. HelmChart custom resources have `apiVersion: kots.io/v1beta2` and `kind: HelmChart`.
103104

104105
**Example:**
105106

@@ -126,7 +127,7 @@ To add the SDK Helm chart to a release for a standard manifest-based application
126127

127128
1. Save and promote the release to an internal-only channel used for testing, such as the default Unstable channel.
128129

129-
1. Install the release using a Replicated installer (Emebdded Cluster, KOTS, kURL). For more information, see:
130+
1. Install the release using a Replicated installer. For more information, see:
130131
* [Online Installation with Embedded Cluster](/enterprise/installing-embedded)
131132
* [Online Installation in Existing Clusters with KOTS](/enterprise/installing-existing-cluster)
132133
* [Online Installation with kURL](/enterprise/installing-kurl)
@@ -149,6 +150,4 @@ To add the SDK Helm chart to a release for a standard manifest-based application
149150
150151
## Install the SDK in Integration Mode
151152
152-
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.
153-
154-
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](/vendor/replicated-sdk-development).
153+
<IntegrationMode/>

sidebars.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,7 @@ const sidebars = {
508508
'vendor/replicated-sdk-overview',
509509
'vendor/replicated-sdk-installing',
510510
'vendor/replicated-sdk-airgap',
511+
'vendor/replicated-sdk-development',
511512
'vendor/replicated-sdk-customizing',
512513
],
513514
},
@@ -605,14 +606,7 @@ const sidebars = {
605606

606607
// DEVELOPER TOOLS
607608
{type: 'html', value: '<h5>Developer tools</h5>', defaultStyle: true},
608-
{
609-
type: 'category',
610-
label: 'Replicated SDK API (Beta)',
611-
items: [
612-
'reference/replicated-sdk-apis',
613-
'vendor/replicated-sdk-development',
614-
],
615-
},
609+
'reference/replicated-sdk-apis',
616610
{
617611
type: 'category',
618612
label: 'Replicated CLI',

0 commit comments

Comments
 (0)