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

Can not specify name for HELM v3 releases #88

Open
kvaps opened this issue Nov 15, 2019 · 6 comments
Open

Can not specify name for HELM v3 releases #88

kvaps opened this issue Nov 15, 2019 · 6 comments

Comments

@kvaps
Copy link
Contributor

kvaps commented Nov 15, 2019

[helm template] cd /home/kvaps/git/infrastructure/deployments/prometheus-operator/components && helm template ../vendor/helm-charts/stable/prometheus-operator --name monitoring --namespace monitoring --values -
[helm template] cd /home/kvaps/git/infrastructure/deployments/prometheus-operator/components && helm template ../vendor/helm-charts/stable/prometheus-operator --name monitoring --namespace monitoring --values -
Error: unknown flag: --name
Error: unknown flag: --name
✘ evaluate 'cluster-resources': RUNTIME ERROR: run helm template command: exit status 1
        components/cluster-resources.jsonnet:(5:23)-(14:2)      thunk <renderedChart> from <$>
        components/cluster-resources.jsonnet:20:12-25   $

        During evaluation

evaluate 'prometheus-operator': RUNTIME ERROR: run helm template command: exit status 1
        components/prometheus-operator.jsonnet:(5:23)-(14:2)    thunk <renderedChart> from <$>
        components/prometheus-operator.jsonnet:21:12-25 $

        During evaluation
@kvaps
Copy link
Contributor Author

kvaps commented Nov 15, 2019

My bad Release Names were removed from Helm3
https://helm.sh/docs/faq/#release-names-are-now-scoped-to-the-namespace

Not a bug, removing name parameter from std.native('expandHelmTemplate') makes helm templating working again

@kvaps kvaps closed this as completed Nov 15, 2019
@kvaps
Copy link
Contributor Author

kvaps commented Dec 21, 2019

Reopen, there is still need an opportunity to specify name for the releases, eg:

# For Helm 2
helm install --namespace <NAMESPACE> --name gitlab-runner -f <CONFIG_VALUES_FILE> gitlab/gitlab-runner

# For Helm 3
helm install --namespace <NAMESPACE> gitlab-runner -f <CONFIG_VALUES_FILE> gitlab/gitlab-runner

from here

@kvaps kvaps reopened this Dec 21, 2019
@kvaps kvaps changed the title QBEC incompatible with HELM v3.0.0 Can not specify name for HELM v3 releases Dec 21, 2019
@kvaps
Copy link
Contributor Author

kvaps commented Dec 21, 2019

Good workaround is to use --name-template flag, it's working fine with both: Helm2 and Helm3

example component:

local env = { name: std.extVar('qbec.io/env'), namespace: std.extVar('qbec.io/defaultNs') };
local p = import '../params.libsonnet';
local params = p.components.gitlabRunner;

std.native('expandHelmTemplate')(
  '../vendor/gitlab-runner',
  params.values,
  {
    nameTemplate: params.name,
    namespace: env.namespace,
    thisFile: std.thisFile,
    verbose: true,
  }
)

and values:

{
  components: {
    gitlabRunner: {
      name: 'gitlab-runner',
      values: {
        gitlabUrl: 'https://gitlab.exmple.org/',
        runnerRegistrationToken: 'Aim3veFeuQueey6aicee',
        rbac: {
          create: true,
        },
      },
    },
  },
}

@harsimranmaan
Copy link
Contributor

helm 3 moved the name option to the main command as in helm template [NAME] [chart] which makes it harder to support both at the same time. As per https://helm.sh/docs/topics/version_skew/, helm2 would sunset with k8s 1.16. We should move to just supporting helm3 going forward. See https://github.com/splunk/qbec/pull/156/files#diff-89fd933f962458094e145ae8f0975458R76-R80

@kvaps
Copy link
Contributor Author

kvaps commented Sep 9, 2020

@harsimranmaan how about using --name-template? It is supported by both helm2 and helm3

@harsimranmaan
Copy link
Contributor

That might solve problem from both worlds. Maybe we can drop the --name or NAME parameter when we end support for helm2. A note in documentation about this behaviour should be enough in that case.

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

No branches or pull requests

2 participants