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

Modern labels not yet introduced for the pods controlled by deployments etc #3595

Closed
samyuh opened this issue Jan 10, 2025 · 4 comments · Fixed by #3596
Closed

Modern labels not yet introduced for the pods controlled by deployments etc #3595

samyuh opened this issue Jan 10, 2025 · 4 comments · Fixed by #3596
Labels

Comments

@samyuh
Copy link
Contributor

samyuh commented Jan 10, 2025

The following labels are missing from the hub pod but are present in the singleuser pod. Is this the intended behavior?

app.kubernetes.io/name
app.kubernetes.io/instance
app.kubernetes.io/managed-by

You can verify this behavior by describing the resource or checking it manually with the command:

helm template chart-release . --values values.yaml
@samyuh samyuh added the bug label Jan 10, 2025
@samyuh samyuh changed the title Labels not being applied to jupyterhub Missing labels in hub pod Jan 10, 2025
@consideRatio
Copy link
Member

I've failed to reproduce this, under metadata.labels, I see all of those labels:

    app.kubernetes.io/name: "jupyterhub"
    app.kubernetes.io/instance: "release-name"
    app.kubernetes.io/managed-by: Helm
(base) ➜  zero-to-jupyterhub-k8s git:(main) helm template jupyterhub --show-only templates/hub/deployment.yaml
---
# Source: jupyterhub/templates/hub/deployment.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: hub
  labels:
    component: hub
    app.kubernetes.io/component: hub
    app: "jupyterhub"
    release: "release-name"
    chart: jupyterhub-0.0.1-set.by.chartpress
    heritage: Helm
    app.kubernetes.io/name: "jupyterhub"
    app.kubernetes.io/instance: "release-name"
    helm.sh/chart: jupyterhub-0.0.1-set.by.chartpress
    app.kubernetes.io/managed-by: Helm

They are however not part of the spec.selector.matchLabels. To change to the new labels from the old (component, app, release) within matchSelector, would be a change that requires a bit of trouble during upgrade. Due to that, the plan was to phase them in.

From #3404:

This enables us to make a breaking change in z2jh 5 where user servers restarted once or more during z2jh 4 doesn't have to be restarted as part of the breaking change then. If we did it right away, network policy enforcement would fail for old servers for example.

@consideRatio
Copy link
Member

consideRatio commented Jan 10, 2025

I'm sorry, I looked at the deployment's labels, not the pod template's labels - they shouldn't include "jupyterhub.matchLabels" but "jupyterhub.labels".

This makes sense to fix!

I think making the change and having users upgrade will trigger a hub pod restart, which is fine - not breaking.

@samyuh do you want to open a PR and fix it?

@samyuh
Copy link
Contributor Author

samyuh commented Jan 10, 2025

Yes! I can try to work on this during the weekend or later today!

@consideRatio consideRatio changed the title Missing labels in hub pod Modern labels not yet introduced for the pods controlled by deployments etc Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@consideRatio @samyuh and others