From 989374dfa9124fbf632de9e953dc682e791f1bbf Mon Sep 17 00:00:00 2001 From: 1046102779 Date: Fri, 22 Jul 2022 20:00:32 +0800 Subject: [PATCH 1/5] feature/helmchart: supported private helm chart repo to install dapr cluster Signed-off-by: 1046102779 --- daprdocs/content/en/reference/cli/dapr-init.md | 7 +++++-- daprdocs/content/en/reference/environment/_index.md | 5 ++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index 019da8627..5dd0d0b04 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -38,7 +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| | 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 |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| | ### Examples @@ -130,4 +133,4 @@ dapr init -k --image-registry docker.io/username Scenario 2 : dapr image hosted under a new/different directory in private registry - ```bash dapr init -k --image-registry docker.io/username/ -``` \ No newline at end of file +``` diff --git a/daprdocs/content/en/reference/environment/_index.md b/daprdocs/content/en/reference/environment/_index.md index 2ddbc480f..3e3470eb1 100644 --- a/daprdocs/content/en/reference/environment/_index.md +++ b/daprdocs/content/en/reference/environment/_index.md @@ -20,4 +20,7 @@ The following table lists the environment variables used by the Dapr runtime, CL | DAPR_API_TOKEN | Dapr sidecar | The token used for Dapr API authentication for requests from the application. [Enable API token authentication in Dapr]({{< ref api-token >}}). | | 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. +| 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| | From 3addb839724bb0190421214b4d9846436f925f9a Mon Sep 17 00:00:00 2001 From: 1046102779 Date: Tue, 26 Jul 2022 09:54:35 +0800 Subject: [PATCH 2/5] 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| From e23e918d19a2ab0ef54129de175d9b59a1e0685e Mon Sep 17 00:00:00 2001 From: 1046102779 Date: Thu, 28 Jul 2022 08:59:23 +0800 Subject: [PATCH 3/5] feature/helmchart: supported private helm chart repo to install dapr cluster Signed-off-by: 1046102779 --- .../en/operations/hosting/kubernetes/kubernetes-deploy.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md index 998eba572..4af50c1b6 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 (a official Dapr Helm chart) +### Install Dapr (from an official Dapr Helm chart) The `-k` flag initializes Dapr on the Kubernetes cluster in your current context. @@ -122,7 +122,7 @@ 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. + // Add the 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/ \ From 56aa22b1ad47f54f43fc154354bf4d27d74e814e Mon Sep 17 00:00:00 2001 From: 1046102779 Date: Tue, 2 Aug 2022 14:10:22 +0800 Subject: [PATCH 4/5] feature: add a private helm repo for dapr Signed-off-by: 1046102779 --- .../en/operations/hosting/kubernetes/kubernetes-deploy.md | 6 +++--- daprdocs/content/en/reference/cli/dapr-init.md | 6 +++--- daprdocs/content/en/reference/environment/_index.md | 6 +++--- 3 files changed, 9 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 4af50c1b6..83196aaba 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md @@ -60,9 +60,9 @@ dapr init -k ### 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" +export DAPR_HELM_REPO_URL="https://helm.custom-domain.com/dapr/dapr" +export DAPR_HELM_REPO_USERNAME="username_xxx" +export DAPR_HELM_REPO_PASSWORD="passwd_xxx" Setting the above parameters will allow `dapr init -k` to install Dapr images from the configured Helm repository. diff --git a/daprdocs/content/en/reference/cli/dapr-init.md b/daprdocs/content/en/reference/cli/dapr-init.md index 7ebf20d41..6252f3c81 100644 --- a/daprdocs/content/en/reference/cli/dapr-init.md +++ b/daprdocs/content/en/reference/cli/dapr-init.md @@ -39,9 +39,9 @@ dapr init [flags] | `--timeout` | | `300` | The wait timeout for the Kubernetes installation | | `--wait` | | `false` | Wait for Kubernetes initialization to complete | | 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| | +| N/A |DAPR_HELM_REPO_URL| | Specifies a private Dapr Helm chart url| +| N/A | DAPR_HELM_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 | DAPR_HELM_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 384e305b0..3aba469ee 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, 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| +| DAPR_HELM_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`| +| DAPR_HELM_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| +| DAPR_HELM_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| From 7b93cb901f961cbd36ac9c3f05535bd4e8b7d36f Mon Sep 17 00:00:00 2001 From: yellow chicks Date: Thu, 4 Aug 2022 09:36:51 +0800 Subject: [PATCH 5/5] Update daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md Co-authored-by: greenie-msft <56556602+greenie-msft@users.noreply.github.com> Signed-off-by: yellow chicks --- .../en/operations/hosting/kubernetes/kubernetes-deploy.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md index 83196aaba..fb860a9de 100644 --- a/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md +++ b/daprdocs/content/en/operations/hosting/kubernetes/kubernetes-deploy.md @@ -59,6 +59,10 @@ dapr init -k ``` ### Install Dapr (a private Dapr Helm chart) +There are some scenarios where it's necessary to install Dapr from a private Helm chart, such as: +- needing more granular control of the Dapr Helm chart +- having a custom Dapr deployment +- pulling Helm charts from trusted registries that are managed and maintained by your organization export DAPR_HELM_REPO_URL="https://helm.custom-domain.com/dapr/dapr" export DAPR_HELM_REPO_USERNAME="username_xxx"