Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to support external Helm Chart Repositories #3

Open
ccapell opened this issue Jul 27, 2022 · 3 comments
Open

Need to support external Helm Chart Repositories #3

ccapell opened this issue Jul 27, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@ccapell
Copy link

ccapell commented Jul 27, 2022

Need to support External Helm Repositories via HTTP

This will allow users to add the repo address and paths to bitops.config.yaml and they can be installed without copying the chart to the Ops Repository.

@arm4b
Copy link
Member

arm4b commented Jul 27, 2022

I think we confused this in a previous discussion with the Helm chart dependencies defined in the chart.yaml.
But in reality, the proposal here wraps the helm repo add <URL> command. Good idea 👍

BTW https://github.com/roboll/helmfile sounds relevant to this.

But for now to get it working, could someone specify the helm repo add steps in the BitOps pre-hooks?
Would it solve it or are there any edge cases?

@arm4b arm4b added the enhancement New feature or request label Jul 27, 2022
@mickmcgrath13
Copy link
Contributor

mickmcgrath13 commented Jul 27, 2022

the helm repo add functionality is handled via helm dep up against a chart directory already:
https://github.com/bitops-plugins/helm/blob/main/scripts/helm_handle_chart.sh#L126
helm docs: https://helm.sh/docs/helm/helm_dependency_update/

To use an external chart, one only needs to provide something like the following:
my-environment/helm/my-chart/Chart.yaml



apiVersion: v2
name: nginx chart wrapper
description: A Helm chart wrapper for nginx
version: 0.1.0

dependencies:
- name: nginx-ingress
  alias: nginx
  version: 0.13.2
  repository: https://helm.nginx.com/stable

In this case, helm dep up my-environment/helm/my-chart is the same as running helm repo add nginx https://helm.nginx.com/stable

@mickmcgrath13
Copy link
Contributor

mickmcgrath13 commented Jul 27, 2022

apologies, I think that's precisely what @armab was saying (i.e. we have the Chart dependency pattern implemented already, and this ticket is to discuss the ability to specify external charts via the bitops.config.yaml and only provide a values.yaml file instead of also needing to include a Chart.yaml).

In that case, i'd expect a my-environment/helm/my-chart/bitops.config.yaml to have something like the following:

helm:
  cli:
    namespace: bitops
    atomic: true
  options:
    release-name: bitops-release
    external-chart:
      repository: https://helm.nginx.com/stable
      version: 0.13.2

One challenge with this is that I think the helm directory (i.e. my-environment/helm/my-chart) would actually be restricted to a single external chart due to there being no way to distinguish differences in the values.yaml between multiple external charts.

i.e. i'm not sure we could do this:

helm:
  cli:
    namespace: bitops
    atomic: true
  options:
    release-name: bitops-release
    external-charts:
      nginx:
        repository: https://helm.nginx.com/stable
        version: 0.13.2
      another-chart:
        repository: https://helm.another-chart.com/stable
        version: 0.1.0

I think it might be possible to make it work such that our bitops.config.yaml can reference multiple external charts, but then we'd be essentially re-implementing the Chart.yaml dependencies functionality.

Having a single external chart per my-environment/helm/* directory is probably fine; i've seen situations where it makes sense to allow 'bundling' external charts, too, though, so I think we should continue to support the my-environment/helm/wrapper-chart is a full helm chart pattern.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants