2i2c-org / binderhub-service

https://2i2c.org/binderhub-service/
BSD 3-Clause "New" or "Revised" License
8 stars 3 forks source link

Change default naming to not include release name #119

Closed consideRatio closed 3 months ago

consideRatio commented 3 months ago

This makes for briefer resource names, while preserving the ability to deploy multiple instances in the same namespace. It also systematically introduces helper functions rendering various resource names, which is useful if a parent chart wants to reference them. Overall, this PR is making this chart align with how the jupyterhub chart behaves.

Naming changes

# jupyterhub chart's naming
helm template jupyterhub | grep "  name:" | head -3
  name: hub
  name: proxy
  name: singleuser

helm template jupyterhub --set fullnameOverride=test | grep "  name:" | head -3
  name: test-hub
  name: test-proxy
  name: test-singleuser

helm template jupyterhub --set nameOverride=test --set fullnameOverride=null | grep "  name:" | head -3
  name: release-name-test-hub
  name: release-name-test-proxy
  name: release-name-test-singleuser

# binderhub-service chart's naming -- before PR
helm template binderhub-service | grep "  name:" | head -3
  name: release-name-binderhub-service
  name: release-name-binderhub-service-build-pods-docker-config
  name: release-name-binderhub-service

helm template binderhub-service --set fullnameOverride=test | grep "  name:" | head -3
  name: test
  name: test-build-pods-docker-config
  name: test

helm template binderhub-service --set nameOverride=test --set fullnameOverride=null | grep "  name:" | head -3
Error: values don't meet the specifications of the schema(s) in the following chart(s):
binderhub-service:
- (root): fullnameOverride is required

# binderhub-service chart's naming -- after PR
helm template binderhub-service | grep "  name:" | head -3
  name: binderhub
  name: build-pods-docker-config
  name: binderhub

helm template binderhub-service --set fullnameOverride=test | grep "  name:" | head -3
  name: test-binderhub
  name: test-build-pods-docker-config
  name: test-binderhub

helm template binderhub-service --set nameOverride=test --set fullnameOverride=null | grep "  name:" | head -3
  name: release-name-test-binderhub
  name: release-name-test-build-pods-docker-config
  name: release-name-test-binderhub

Breaking changes

Anything referencing these names will experiencing a breaking change, but if that isn't done, it may be fine to upgrade because there isn't a PV resource or similar being renamed that leads to data loss.

There is no way to exactly retain the existing naming as part of this change.

During upgrade when using an Ingress resource with ingress-nginx, you may run into an error like:

Error: UPGRADE FAILED: failed to create resource: admission webhook "validate.nginx.ingress.kubernetes.io" denied the request: host "binderhub-ui-demo.2i2c.cloud" and path "/" is already defined in ingress binderhub-ui-demo/binderhub-ui-demo-binderhub-service

To handle that, just delete the old ingress resource first manually by kubectl delete ingress ....

Related docs

The jupyterhub chart has related docs on fullnameOverride.

consideRatio commented 3 months ago

I did a delayed self-review, and is now moving ahead merging this based on https://github.com/2i2c-org/binderhub-service/issues/57#issuecomment-2211180075 where I'll followup with testing it practically by doing https://github.com/2i2c-org/infrastructure/issues/4370