Skip to content

Commit

Permalink
Fix build and fix dowload kubeconfig
Browse files Browse the repository at this point in the history
Fix instructions for downloading kubeconfig file for Rancher Terraform
instructions:
- Fix the syntax highlighting
- Add instructions for downloading the Kubeconfig file via web UI in
  line with previous instructions

Fix build: fix inconsistent entries in the versioned docs v1.3
sidebar.js

Signed-off-by: Moritz Röhrich <[email protected]>
  • Loading branch information
m-ildefons committed Aug 7, 2024
1 parent 9b2ce83 commit 0e46be4
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 13 deletions.
12 changes: 12 additions & 0 deletions docs/rancher/rancher-terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ The [Rancher Terraform Provider](https://registry.terraform.io/providers/rancher

1. Obtain the kubeconfig for the Harvester Cloud Provider and the Harvester CSI Driver.

<Tabs>
<TabItem value="ui" label="UI" default>

On the Rancher UI, go to **Virtualization Management**. Locate the target Harvester cluster in the list and then select **** > **Download KubeConfig**.

![Download Kubeconfig](/img/v1.4/rancher/download-kubeconfig-harvester.png)

</TabItem>
<TabItem value="shell" label="Shell">

```shell
# Generate harvester cloud provider kubeconfig
Expand All @@ -53,6 +62,9 @@ The [Rancher Terraform Provider](https://registry.terraform.io/providers/rancher
-d '{"clusterRoleName": "harvesterhci.io:cloudprovider", "namespace": "default", "serviceAccountName": "'${CLUSTER_NAME}'"}' | xargs | sed 's/\\n/\n/g' > ${CLUSTER_NAME}-kubeconfig
```

</TabItem>
</Tabs>

1. Prepare a `provider.tf` file with the following content:

```hcl
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions versioned_docs/version-v1.3/rancher/rancher-terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ description: Rancher Terraform allows administrators to create and manage RKE2 g

1. Get kubeconfig for Harvester Cloud Provider and Harvester CSI Driver.

<Tabs>
<TabItem value="ui" label="UI" default>

On the Rancher UI, go to **Virtualization Management**. Locate the target Harvester cluster in the list and then select **** > **Download KubeConfig**.

![Download Kubeconfig](/img/v1.4/rancher/download-kubeconfig-harvester.png)

</TabItem>
<TabItem value="shell" label="Shell">

```shell
# Generate harvester cloud provider kubeconfig
RANCHER_SERVER_URL="<RANCHER_SERVER_URL>" # Pure server URL like https://192.168.0.181:6443
Expand All @@ -69,6 +79,9 @@ description: Rancher Terraform allows administrators to create and manage RKE2 g
-d '{"clusterRoleName": "harvesterhci.io:cloudprovider", "namespace": "default", "serviceAccountName": "'${CLUSTER_NAME}'"}' | xargs | sed 's/\\n/\n/g' > ${CLUSTER_NAME}-kubeconfig
```

</TabItem>
</Tabs>

1. Prepare a `main.tf` file with the following content:

```hcl
Expand Down
26 changes: 13 additions & 13 deletions versioned_sidebars/version-v1.3-sidebars.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@
"api/delete-namespaced-network-attachment-definition",
"api/patch-namespaced-network-attachment-definition",
"api/list-network-attachment-definition-for-all-namespaces",
"api/list-cluster-network",
"api/create-cluster-network",
"api/read-cluster-network",
"api/replace-cluster-network",
"api/delete-cluster-network",
"api/patch-cluster-network",
"api/list-node-network",
"api/create-node-network",
"api/read-node-network",
"api/replace-node-network",
"api/delete-node-network",
"api/patch-node-network"
"api/list-namespaced-cluster-network",
"api/create-namespaced-cluster-network",
"api/read-namespaced-cluster-network",
"api/replace-namespaced-cluster-network",
"api/delete-namespaced-cluster-network",
"api/patch-namespaced-cluster-network",
"api/list-namespaced-node-network",
"api/create-namespaced-node-network",
"api/read-namespaced-node-network",
"api/replace-namespaced-node-network",
"api/delete-namespaced-node-network",
"api/patch-namespaced-node-network"
]
},
{
Expand Down Expand Up @@ -188,4 +188,4 @@
]
}
]
}
}

0 comments on commit 0e46be4

Please sign in to comment.