From 3addb839724bb0190421214b4d9846436f925f9a Mon Sep 17 00:00:00 2001 From: 1046102779 Date: Tue, 26 Jul 2022 09:54:35 +0800 Subject: [PATCH] feature/helmchart: supported private helm chart repo to install dapr cluster Signed-off-by: 1046102779 --- .../hosting/kubernetes/kubernetes-deploy.md | 14 +++++++++++++- .../hosting/kubernetes/kubernetes-production.md | 5 ++++- daprdocs/content/en/reference/cli/dapr-init.md | 8 ++++---- .../content/en/reference/environment/_index.md | 6 +++--- 4 files changed, 24 insertions(+), 9 deletions(-) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md index b3a0d7b0f..998eba572 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md @@ -37,7 +37,7 @@ Both the Dapr CLI and the Dapr Helm chart automatically deploy with affinity for You can install Dapr to a Kubernetes cluster using the [Dapr CLI]({{< ref install-dapr-cli.md >}}). -### Install Dapr +### Install Dapr (a official Dapr Helm chart) The `-k` flag initializes Dapr on the Kubernetes cluster in your current context. @@ -58,6 +58,14 @@ dapr init -k ✅ Success! Dapr has been installed to namespace dapr-system. To verify, run "dapr status -k" in your terminal. To get started, go here: https://aka.ms/dapr-getting-started ``` +### Install Dapr (a private Dapr Helm chart) + +export HELM_CHART_REPO_URL="https://helm.custom-domain.com/dapr/dapr" +export HELM_CHART_REPO_USERNAME="username_xxx" +export HELM_CHART_REPO_PASSWORD="passwd_xxx" + +Setting the above parameters will allow `dapr init -k` to install Dapr images from the configured Helm repository. + ### Install in custom namespace The default namespace when initializing Dapr is `dapr-system`. You can override this with the `-n` flag. @@ -114,7 +122,11 @@ The latest Dapr helm chart no longer supports Helm v2. Please migrate from Helm 2. Add Helm repo and update ```bash + // Add a official Dapr Helm chart. helm repo add dapr https://dapr.github.io/helm-charts/ + // Or also add a private Dapr Helm chart. + helm repo add dapr http://helm.custom-domain.com/dapr/dapr/ \ + --username=xxx --password=xxx helm repo update # See which chart versions are available helm search repo dapr --devel --versions diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md index 65c22597e..95e653ce8 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-production.md @@ -87,8 +87,11 @@ For a full list of all available options you can set in the values file (or by u Instead of using either `helm install` or `helm upgrade` as shown below, you can also run `helm upgrade --install` - this will dynamically determine whether to install or upgrade. ```bash -# add/update the helm repo +# Add/update a official Dapr Helm repo. helm repo add dapr https://dapr.github.io/helm-charts/ +# or add/update a private Dapr Helm repo. +helm repo add dapr http://helm.custom-domain.com/dapr/dapr/ \ + --username=xxx --password=xxx helm repo update # See which chart versions are available diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index 5dd0d0b04..7ebf20d41 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -38,10 +38,10 @@ dapr init [flags] | `--slim`, `-s` | | `false` | Exclude placement service, Redis and Zipkin containers from self-hosted installation | | `--timeout` | | `300` | The wait timeout for the Kubernetes installation | | `--wait` | | `false` | Wait for Kubernetes initialization to complete | -| N/A |DAPR_DEFAULT_IMAGE_REGISTRY| | Specifies a private dapr helm chart url, defaultly Official Helm Chart: `https://dapr.github.io/helm-charts`| -| N/A |HELM_CHART_REPO_URL| | Specifies a private dapr helm chart url| -| N/A | HELM_CHART_REPO_USERNAME | A username for a private helm chart | The username required to access a private dapr helm chart. If it can be accessed publicly, the env variable does not need to be set| -| N/A | HELM_CHART_REPO_PASSWORD | A password for a private helm chart |The password required to access a private dapr helm chart. If it can be accessed publicly, the env variable does not need to be set| | +| N/A |DAPR_DEFAULT_IMAGE_REGISTRY| | It is used to specify the default container registry to pull images from. When its value is set to `GHCR` or `ghcr` it pulls the required images from Github container registry. To default to Docker hub, unset the environment variable or leave it blank| +| N/A |HELM_CHART_REPO_URL| | Specifies a private Dapr Helm chart url| +| N/A | HELM_CHART_REPO_USERNAME | A username for a private Helm chart | The username required to access the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set| +| N/A | HELM_CHART_REPO_PASSWORD | A password for a private Helm chart |The password required to access the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set| | ### Examples diff --git a/daprdocs/content/en/reference/environment/_index.md b/daprdocs/content/en/reference/environment/_index.md index 3e3470eb1..384e305b0 100644 --- a/daprdocs/content/en/reference/environment/_index.md +++ b/daprdocs/content/en/reference/environment/_index.md @@ -21,6 +21,6 @@ The following table lists the environment variables used by the Dapr runtime, CL | NAMESPACE | Dapr sidecar | Used to specify a component's [namespace in self-hosted mode]({{< ref component-scopes >}}). | | DAPR_DEFAULT_IMAGE_REGISTRY | Dapr CLI | In self-hosted mode, it is used to specify the default container registry to pull images from. When its value is set to `GHCR` or `ghcr`, it pulls the required images from Github container registry. To default to Docker hub, unset this environment variable. | | SSL_CERT_DIR | Dapr sidecar | Specifies the location where the public certificates for all the trusted certificate authorities (CA) are located. Not applicable when the sidecar is running as a process in self-hosted mode.| -| HELM_CHART_REPO_URL | Your private dapr helm chart url | Specifies a private dapr helm chart url, defaultly Official Helm Chart: `https://dapr.github.io/helm-charts`| -| HELM_CHART_REPO_USERNAME | A username for a private helm chart | The username required to access a private dapr helm chart. If it can be accessed publicly, the env variable does not need to be set| -| HELM_CHART_REPO_PASSWORD | A password for a private helm chart |The password required to access a private dapr helm chart. If it can be accessed publicly, the env variable does not need to be set| | +| HELM_CHART_REPO_URL | Your private Dapr Helm chart url | Specifies a private Dapr Helm chart url, which defaults to the official Helm chart URL: `https://dapr.github.io/helm-charts`| +| HELM_CHART_REPO_USERNAME | A username for a private Helm chart | The username required to access the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set| +| HELM_CHART_REPO_PASSWORD | A password for a private Helm chart |The password required to access the private Dapr helm chart. If it can be accessed publicly, this env variable does not need to be set|