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

Helm release name based on folder name: preventing bad practices #86

Open
consideRatio opened this issue Jun 29, 2020 · 1 comment
Open

Comments

@consideRatio
Copy link
Collaborator

consideRatio commented Jun 29, 2020

Helm release names often play a part in the names the Helm chart assign to k8s resources.

I had named my deployment folder hub.neurohackademy.org, and got hubploy automatically use the helm release name of that which includes a ., which is fine for Helm.

But, a Helm chart like grafana will crash with a Helm release name including a dot, at least unless one manipulates it to not use the release name with chart configuration.

I'm not sure what I suggest, but it could be worth a note in docs at least that the folder name leads to the helm release name, and certain helm charts will have issues if that name contain any weird characters.

Error: UPGRADE FAILED: failed to create resource: Service "hub.neurohackademy.org-prod-kube-state-metrics" is invalid: metadata.name: Invalid value: "hub.neurohackademy.org-prod-kube-state-metrics": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name',  or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
Traceback (most recent call last):
  File "/home/erik/anaconda3/bin/hubploy", line 11, in <module>
    load_entry_point('hubploy', 'console_scripts', 'hubploy')()
  File "/home/erik/dev/contrib/yuvipanda/hubploy/hubploy/__main__.py", line 136, in main
    args.cleanup_on_fail,
  File "/home/erik/dev/contrib/yuvipanda/hubploy/hubploy/helm.py", line 170, in deploy
    cleanup_on_fail,
  File "/home/erik/dev/contrib/yuvipanda/hubploy/hubploy/helm.py", line 86, in helm_upgrade
    subprocess.check_call(cmd)
  File "/home/erik/anaconda3/lib/python3.7/subprocess.py", line 347, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['helm', 'upgrade', '--wait', '--install', '--namespace', 'default', 'hub.neurohackademy.org-prod', 'chart', '--cleanup-on-fail', '-f', 'deployments/hub.neurohackademy.org/config/prod.yaml', '-f', '/tmp/tmpvixdjmtf', '--set-string', 'jupyterhub.singleuser.image.tag=c8e957c', '--set-string', 'jupyterhub.singleuser.image.name=us.gcr.io/neurohackademy/nh-2020-env']' returned non-zero exit status 1
@yuvipanda
Copy link
Collaborator

oooh, interesting! Haven't considered this, thanks for bringing it up!

I agree re: note in docs. How do you feel about using escapism.escape here, as we do in many other places? It's unweildy though, so I guess the preference is for using DNS safe names.

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