|
| 1 | +--- |
| 2 | +title: "How to use a private Helm repository in Azure Dev Spaces" |
| 3 | +titleSuffix: Azure Dev Spaces |
| 4 | +services: azure-dev-spaces |
| 5 | +ms.service: azure-dev-spaces |
| 6 | +author: "zr-msft" |
| 7 | +ms.author: "zarhoads" |
| 8 | +ms.date: "08/22/2019" |
| 9 | +ms.topic: "conceptual" |
| 10 | +description: "Use a private Helm repository in an Azure Dev Space." |
| 11 | +keywords: "Docker, Kubernetes, Azure, AKS, Azure Container Service, containers, Helm" |
| 12 | +manager: gwallace |
| 13 | +--- |
| 14 | +# Use a private Helm repository in Azure Dev Spaces |
| 15 | + |
| 16 | +[Helm][helm] is a package manager for Kuberentes. Helm uses a [chart][helm-chart] format to package dependencies. Helm charts are stored in a repository, which can be public or private. Azure Dev Spaces only retrieves Helm charts from public repositories when running your application. In cases where the Helm repository is private or Azure Dev Spaces can't access it, you can add a chart from that repository directly to your application. Adding the chart directly lets Azure Dev Spaces run your application without having to access the private Helm repository. |
| 17 | + |
| 18 | +## Add the private Helm repository to your local machine |
| 19 | + |
| 20 | +Use [helm repo add][helm-repo-add] and [helm repo update][helm-repo-update] to access the private Helm repository from your local machine. |
| 21 | + |
| 22 | +```cmd |
| 23 | +helm repo add privateRepoName http://example.com/helm/v1/repo --username user --password 5tr0ng_P@ssw0rd! |
| 24 | +helm repo update |
| 25 | +``` |
| 26 | + |
| 27 | +## Add the chart to your application |
| 28 | + |
| 29 | +Navigate to your project's directory and run `azds prep`. |
| 30 | + |
| 31 | +```cmd |
| 32 | +azds prep --public |
| 33 | +``` |
| 34 | + |
| 35 | +Create a [requirements.yaml][helm-requirements] file with your chart in your application's chart directory. For example, if your application is named *app1*, you would create *charts/app1/requirements.yaml*. |
| 36 | + |
| 37 | +```yaml |
| 38 | +dependencies: |
| 39 | + - name: mychart |
| 40 | + version: 0.1.0 |
| 41 | + repository: http://example.com/helm/v1/repo |
| 42 | +``` |
| 43 | +
|
| 44 | +Navigate to your application's chart directory and use [helm dependency update][helm-dependency-update] to update the Helm dependencies for your application and download the chart from the private repository. |
| 45 | +
|
| 46 | +```cmd |
| 47 | +helm dependency update |
| 48 | +``` |
| 49 | + |
| 50 | +Verify a *charts* subdirectory with a *tgz* file has been added to your application's chart directory. For example, *charts/app1/charts/mychart-0.1.0.tgz*. |
| 51 | + |
| 52 | +The chart from your private Helm repository has been downloaded and added to your project. Remove the *requirements.yaml* file so that Dev Spaces won't try to update this dependency. |
| 53 | + |
| 54 | +## Run your application |
| 55 | + |
| 56 | +Navigate to the root directory of your project and run `azds up` to verify your application successfully runs in your dev space. |
| 57 | + |
| 58 | +```cmd |
| 59 | +$ azds up |
| 60 | +Using dev space 'default' with target 'MyAKS' |
| 61 | +Synchronizing files...2s |
| 62 | +Installing Helm chart...2s |
| 63 | +Waiting for container image build...2m 25s |
| 64 | +Building container image... |
| 65 | +... |
| 66 | +Service 'app1' port 'http' is available at http://app1.1234567890abcdef1234.eus.azds.io/ |
| 67 | +Service 'app1' port 80 (http) is available at http://localhost:54256 |
| 68 | +... |
| 69 | +``` |
| 70 | + |
| 71 | +## Next steps |
| 72 | + |
| 73 | +Learn more about [Helm and how it works][helm]. |
| 74 | + |
| 75 | +[helm]: https://docs.helm.sh |
| 76 | +[helm-chart]: https://helm.sh/docs/developing_charts/ |
| 77 | +[helm-dependency-update]: https://helm.sh/docs/helm/#helm-dependency-update |
| 78 | +[helm-repo-add]: https://helm.sh/docs/helm/#helm-repo-add |
| 79 | +[helm-repo-update]: https://helm.sh/docs/helm/#helm-repo-update |
| 80 | +[helm-requirements]: https://helm.sh/docs/developing_charts/#chart-dependencies |
0 commit comments