Open kvaps opened 5 years ago
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
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
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,
},
},
},
},
}
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
@harsimranmaan how about using --name-template
? It is supported by both helm2 and helm3
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.