feature/helmchart: supported private helm chart repo to install dapr cluster

Signed-off-by: 1046102779 <seachen@tencent.com>
This commit is contained in:
1046102779 2022-07-26 09:54:35 +08:00
parent 989374dfa9
commit 3addb83972
4 changed files with 24 additions and 9 deletions

View File

@ -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 >}}). 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. 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 ✅ 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 ### Install in custom namespace
The default namespace when initializing Dapr is `dapr-system`. You can override this with the `-n` flag. 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 2. Add Helm repo and update
```bash ```bash
// Add a official Dapr Helm chart.
helm repo add dapr https://dapr.github.io/helm-charts/ 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 helm repo update
# See which chart versions are available # See which chart versions are available
helm search repo dapr --devel --versions helm search repo dapr --devel --versions

View File

@ -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. 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 ```bash
# add/update the helm repo # Add/update a official Dapr Helm repo.
helm repo add dapr https://dapr.github.io/helm-charts/ 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 helm repo update
# See which chart versions are available # See which chart versions are available

View File

@ -38,10 +38,10 @@ dapr init [flags]
| `--slim`, `-s` | | `false` | Exclude placement service, Redis and Zipkin containers from self-hosted installation | | `--slim`, `-s` | | `false` | Exclude placement service, Redis and Zipkin containers from self-hosted installation |
| `--timeout` | | `300` | The wait timeout for the Kubernetes installation | | `--timeout` | | `300` | The wait timeout for the Kubernetes installation |
| `--wait` | | `false` | Wait for Kubernetes initialization to complete | | `--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 |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_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_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 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 the private Dapr Helm chart. If it can be accessed publicly, this env variable does not need to be set| |
### Examples ### Examples

View File

@ -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 >}}). | | 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. | | 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_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 a private dapr helm chart. If it can be accessed publicly, the env variable does not need to be set| | 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 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 the private Dapr helm chart. If it can be accessed publicly, this env variable does not need to be set|