Binderhub: K8s 1.16 deprecates extensions/v1beta1 for apiVersion, breaking the Helm charts

Created on 27 Nov 2019  路  10Comments  路  Source: jupyterhub/binderhub

The current Helm charts don't work with Kubernetes 1.16, apparently because of the apiVersion deprecation:

The v1.16 release will stop serving the following deprecated API versions in favor of newer and more stable API versions:
...

  • DaemonSet, Deployment, StatefulSet, and ReplicaSet (in the extensions/v1beta1 and apps/v1beta2 API groups)

    • Migrate to use the apps/v1 API, available since v1.9. Existing persisted data can be retrieved/updated via the apps/v1 API.

The initial error I get is:

% microk8s.helm install jupyterhub/binderhub --version=0.2.0-c04966f --name=binder-test --namespace=binder-test -f secret.yaml -f config.yaml
Error: validation failed: [unable to recognize "": no matches for kind "DaemonSet" in version "extensions/v1beta1", unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"]

I'm new to K8s, Helm and Binder. I tried replacing the versions with apps/v1, after downloading the helm charts, but that gives another error:

% wget https://jupyterhub.github.io/helm-chart/binderhub-0.2.0-c04966f.tgz
% tar zxf binderhub-0.2.0-c04966f.tgz
% grep extensions/v1beta1 binderhub -RlZ | xargs -0 grep -lZ -e DaemonSet -e Deployment -e StatefulSet -e ReplicaSet | xargs -0 sed -i '/^apiVersion/s:extensions/v1beta1:apps/v1:'
% helm install --name=binder-test --namespace=binder-test -f secret.yaml -f config.yaml ./binderhub
Error: release binder-test failed: Deployment.apps "binder" is invalid: [spec.selector: Required value, spec.template.metadata.labels: Invalid value: map[string]string{"app":"binder", "component":"binder", "heritage":"Tiller", "name":"binder", "release":"binder-test"}: `selector` does not match template `labels`]

I'm new to K8s, Helm and Binder. Not sure what else to do except downgrade K8s. I'm using microk8s, so that should be relatively straightforward.

All 10 comments

NOTE: The underlying z2jh helm chart doesnt yet support k8s 1.16 so this is only one of the fixes needed at the moment.

This needs fixing though! Make these be apps/v1 instead of extensions/v1beta1 etc, and potentially we need to add some selector as well

@muru, try adding to the binder deployment this:

selector:
    matchLabels:
      app: binder
      name: binder
      component: binder
      release: {{ .Release.Name }}
      heritage: {{ .Release.Service }}

It might be that the new api requires a selector. Though, I'm not sure if matchLabels should also cover .Values.deployment.labels. @consideRatio, does this make sense :eyes: ?

@GeorgianaElena yepp I think a change like that is required as part of going to apps/v1 from extensions/v1beta1, but I don't remember the exact details. I'll work it out and submit a PR.

Does someone know how we handle a change like this and maintain a chart that works on 1.16 as well as some of the older versions like 1.14?

@betatim yepp this is backward compatible to 1.11 or so I think. (UPDATE: 1.9 is OK still.)

@GeorgianaElena yep, that got it up and running. Thanks!

@muru or @consideRatio will one of you make a PR to add this to the chart?

It is already done tim, see PRs in mention above

ah, I didn't realise that PR was related (too many things in too many repos with "1.16 compatibility" in the name ;))

Was this page helpful?
0 / 5 - 0 ratings