|
| 1 | +import Flow, { Step } from '@site/src/components/Flow' |
1 | 2 | import NavStep from '@site/src/components/NavStep' |
2 | | - |
3 | | - |
4 | | -If you prefer to use Helm, you need to make sure that you have a valid Access Key. |
5 | | - |
6 | | -You can either reuse the CLI Access Key or create a new one by following the |
7 | | -[Access Key guide](../../administer/users-permissions/access-keys.mdx#create-an-access-key). |
8 | | - |
9 | | - |
10 | | -- Reusing the CLI Access Key |
11 | | - |
12 | | - ```bash |
13 | | - export ACCESS_KEY=$(vcluster platform access-key | jq -r .status.token) |
14 | | - ``` |
15 | | - |
16 | | -- Create new Access Key by following the [Access |
17 | | -Key](/platform/administer/users-permissions/access-keys#create-an-access-key) guide. |
18 | | - |
19 | | - ```bash |
20 | | - export ACCESS_KEY="[Newly Created Access Key]" |
21 | | - ``` |
22 | | - |
23 | | -After that, you need to provide a name for the cluster. |
24 | | - |
25 | | -```bash |
26 | | -export CLUSTER_NAME="cluster-name" |
27 | | -``` |
28 | | - |
29 | | -Next, you must create the Cluster custom resource within the platform using the following code: |
30 | | - |
31 | | -```bash |
32 | | -cat <<EOF | kubectl apply -f - |
33 | | -apiVersion: management.loft.sh/v1 |
34 | | -kind: Cluster |
35 | | -metadata: |
36 | | - name: $CLUSTER_NAME |
37 | | -spec: |
38 | | - displayName: $CLUSTER_NAME |
39 | | - networkPeer: true |
40 | | - managementNamespace: vcluster-platform |
41 | | -EOF |
42 | | -``` |
43 | | - |
44 | | -Then, you need to set the Platform Host using the following code: |
45 | | - |
46 | | -```bash |
47 | | -export PLATFORM_HOST="YOUR_LOFT_HOST" |
48 | | -``` |
49 | | - |
50 | | -To get the Platform version, you should run the following command: |
51 | | - |
52 | | -```bash |
53 | | -export PLATFORM_VERSION=$(curl -s "https://$PLATFORM_HOST/version" | jq -r '.version | .[0:]') |
54 | | -``` |
55 | | - |
56 | | -To get the Cluster Connect token, you should run the following command: |
57 | | - |
58 | | -```bash |
59 | | -export CLUSTER_ACCESS_KEY=$(curl -s "https://$PLATFORM_HOST/kubernetes/management/apis/management.loft.sh/v1/clusters/$CLUSTER_NAME/accesskey" -H "Authorization: bearer $ACCESS_KEY") |
60 | | -``` |
61 | | - |
62 | | -Finally, you can connect the cluster using the following command: |
63 | | - |
64 | | -```bash |
65 | | -helm upgrade loft vcluster-platform --install \ |
66 | | - --repo https://charts.loft.sh/ \ |
67 | | - --version $PLATFORM_VERSION \ |
68 | | - --namespace vcluster-platform \ |
69 | | - --create-namespace \ |
70 | | - --set agentOnly=true \ |
71 | | - --set url=https://$PLATFORM_HOST \ |
72 | | - --set token=$(echo $CLUSTER_ACCESS_KEY | jq -r .accessKey) \ |
73 | | - --set additionalCA=$(echo $CLUSTER_ACCESS_KEY | jq -r .caCert) \ |
74 | | - --set insecure=$(echo $CLUSTER_ACCESS_KEY | jq -r .insecure) |
75 | | -``` |
76 | | -:::warning |
77 | | -vCluster Platform exclusively supports the default `secret` backend for storing Helm releases. Alternative `HELM_DRIVER` configurations (such as `configmap` or `sql`) are not supported. |
78 | | -::: |
79 | | - |
80 | | -This command automatically installs the Platform Agent in the cluster that is your current context. |
81 | | -However, if you want to connect a cluster that is not your current context, you can append the `--kube-context` flag to specify the context of the cluster you want to connect. |
82 | | - |
| 3 | +import Button from '@site/src/components/Button' |
| 4 | +import Label from '@site/src/components/Label' |
| 5 | +import Input from '@site/src/components/Input' |
| 6 | +import Expander from '@site/src/components/Expander' |
| 7 | + |
| 8 | +<Flow id="cluster-connect-helm"> |
| 9 | + <Step> |
| 10 | + If you prefer to use Helm, you need to make sure that you have a valid Access Key. |
| 11 | + |
| 12 | + You can either reuse the CLI Access Key or create a new one by following the |
| 13 | + [Access Key guide](../../administer/users-permissions/access-keys.mdx#create-an-access-key). |
| 14 | + |
| 15 | + |
| 16 | + - Reusing the CLI Access Key |
| 17 | + |
| 18 | + ```bash |
| 19 | + export ACCESS_KEY=$(vcluster platform access-key | jq -r .status.token) |
| 20 | + ``` |
| 21 | + |
| 22 | + - Create new Access Key by following the [Access |
| 23 | + Key](/platform/administer/users-permissions/access-keys#create-an-access-key) guide. |
| 24 | + |
| 25 | + ```bash |
| 26 | + export ACCESS_KEY="[Newly Created Access Key]" |
| 27 | + ``` |
| 28 | + </Step> |
| 29 | + <Step> |
| 30 | + After that, you need to provide a name for the cluster. |
| 31 | + |
| 32 | + ```bash |
| 33 | + export CLUSTER_NAME="cluster-name" |
| 34 | + ``` |
| 35 | + </Step> |
| 36 | + <Step> |
| 37 | + Next, you must create the `Cluster` custom resource within the platform using the following code: |
| 38 | + |
| 39 | + ```bash |
| 40 | + cat <<EOF | kubectl apply -f - |
| 41 | + apiVersion: management.loft.sh/v1 |
| 42 | + kind: Cluster |
| 43 | + metadata: |
| 44 | + name: $CLUSTER_NAME |
| 45 | + spec: |
| 46 | + displayName: $CLUSTER_NAME |
| 47 | + networkPeer: true |
| 48 | + managementNamespace: vcluster-platform |
| 49 | + EOF |
| 50 | + ``` |
| 51 | + </Step> |
| 52 | + <Step> |
| 53 | + Then, you need to set the Platform Host using the following code: |
| 54 | +
|
| 55 | + ```bash |
| 56 | + export PLATFORM_HOST="YOUR_PLATFORM_HOST" |
| 57 | + ``` |
| 58 | + </Step> |
| 59 | + <Step> |
| 60 | + To get the Platform version, you should run the following command: |
| 61 | +
|
| 62 | + ```bash |
| 63 | + export PLATFORM_VERSION=$(curl -s "https://$PLATFORM_HOST/version" | jq -r '.version | .[0:]') |
| 64 | + ``` |
| 65 | + </Step> |
| 66 | + <Step> |
| 67 | + To get the Cluster Connect token, you should run the following command: |
| 68 | +
|
| 69 | + ```bash |
| 70 | + export CLUSTER_ACCESS_KEY=$(curl -s "https://$PLATFORM_HOST/kubernetes/management/apis/management.loft.sh/v1/clusters/$CLUSTER_NAME/accesskey" -H "Authorization: bearer $ACCESS_KEY") |
| 71 | + ``` |
| 72 | + </Step> |
| 73 | + <Step> |
| 74 | + Finally, you can connect the cluster using the following command: |
| 75 | +
|
| 76 | + ```bash |
| 77 | + helm upgrade loft vcluster-platform --install \ |
| 78 | + --repo https://charts.loft.sh/ \ |
| 79 | + --version $PLATFORM_VERSION \ |
| 80 | + --namespace vcluster-platform \ |
| 81 | + --create-namespace \ |
| 82 | + --set agentOnly=true \ |
| 83 | + --set url=https://$PLATFORM_HOST \ |
| 84 | + --set token=$(echo $CLUSTER_ACCESS_KEY | jq -r .accessKey) \ |
| 85 | + --set additionalCA=$(echo $CLUSTER_ACCESS_KEY | jq -r .caCert) \ |
| 86 | + --set insecure=$(echo $CLUSTER_ACCESS_KEY | jq -r .insecure) |
| 87 | + ``` |
| 88 | +
|
| 89 | + This command automatically installs the [vCluster Platform Agent](/docs/platform/administer/clusters/advanced/agent-config) in the cluster that is your current context. |
| 90 | + However, if you want to connect a cluster that is not your current context, you can append the `--kube-context` flag to specify the context of the cluster you want to connect. |
| 91 | +
|
| 92 | + You can also retrieve pre-configured agent values from your platform by appending the `--values` flag with the platform endpoint `--values "https://$HOST/clusters/agent-values/$CLUSTER_NAME?token=$TOKEN"`. |
| 93 | + - `$HOST` — your vCluster Platform domain |
| 94 | + - `$CLUSTER_NAME` — the name you're assigning to the cluster being connected (e.g., `cluster-name`) |
| 95 | + - `$TOKEN` — the authentication token to access your vCluster Platform |
| 96 | + The endpoint returns an intelligently merged content of |
| 97 | + - Platform-level defaults configured in the `agentValues` field of your vCluster Platform Helm values |
| 98 | + - Cluster-specific overrides from the `loft.sh/agent-values` annotation (when present) |
| 99 | +
|
| 100 | + </Step> |
| 101 | +</Flow> |
0 commit comments