7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-27 09:03:28 +00:00
tutor/tutor
Florian Haas 55582575f0 fix: Stop creating immutable resource label that breaks "tutor k8s" on Tutor version changes
Through the commonLabels directive in kustomization.yml, all resources
get a label named "app.kubernetes.io/version", which is being set to
the Tutor version at the time of initial deployment.

When the user then subsequently progresses to a new Tutor version,
Kubernetes attempts to update this label — but for Deployment,
ReplicaSet, and DaemonSet resources, this is no longer allowed as of
https://github.com/kubernetes/kubernetes/issues/50808. This causes
"tutor k8s start" (at the "kubectl apply --kustomize" step) to break
with errors such as:

Deployment.apps "redis" is invalid: spec.selector: Invalid value: v1.LabelSelector{MatchLabels:map[string]string{"app.kubernetes.io/instance":"openedx-JIONBLbtByCGUYgHgr4tDWu1", "app.kubernetes.io/managed-by":"tutor", "app.kubernetes.io/name":"redis", "app.kubernetes.io/part-of":"openedx", "app.kubernetes.io/version":"12.1.7"}, MatchExpressions:[]v1.LabelSelectorRequirement(nil)}: field is immutable

Simply removing the app.kubernetes.io/version label from
kustomization.yml will permanently fix this issue for newly created
Kubernetes deployments, which will "survive" any future Tutor version
changes thereafter.

However, *existing* production Open edX deployments will need to throw
the affected Deployments away, and re-create them.

Also, add the Tutor version as a resource annotation instead, using
the commonAnnotations directive.

See also:
https://github.com/kubernetes/client-go/issues/508
https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/commonlabels/
https://kubectl.docs.kubernetes.io/references/kustomize/kustomization/commonannotations/

Fixes #531.
2021-11-25 09:09:26 +01:00
..
commands feat: move all forum-related code to a dedicated plugin 2021-11-08 10:44:47 +01:00
templates fix: Stop creating immutable resource label that breaks "tutor k8s" on Tutor version changes 2021-11-25 09:09:26 +01:00
__about__.py Merge branch 'master' into nightly 2021-11-18 11:44:05 +01:00
__init__.py Tutor v3 complete rewrite 2019-02-09 20:30:01 +01:00
bindmounts.py Merge remote-tracking branch 'origin/master' into nightly 2021-11-01 16:40:25 +00:00
config.py feat: move all forum-related code to a dedicated plugin 2021-11-08 10:44:47 +01:00
env.py feat: run all services as unprivileged containers 2021-10-25 16:26:04 +02:00
exceptions.py Tutor v3 complete rewrite 2019-02-09 20:30:01 +01:00
fmt.py refactor: add type annotations 2021-03-15 21:46:55 +01:00
images.py refactor: better config type checking 2021-04-18 18:02:02 +02:00
interactive.py refactor: better config type checking 2021-04-18 18:02:02 +02:00
jobs.py feat: move all forum-related code to a dedicated plugin 2021-11-08 10:44:47 +01:00
plugins.py fix: always print plugins sorted by name 2021-11-08 10:40:37 +01:00
serialize.py fix: YamlParamType supports line terminators 2021-04-25 09:14:21 +02:00
types.py refactor: better config type checking 2021-04-18 18:02:02 +02:00
utils.py chore: get rid of outdated pycryptodome ugly patch 2021-10-25 20:19:27 +02:00