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

Add runtime classes hook and runtimes chart #7382

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

vitorsavian
Copy link
Member

@vitorsavian vitorsavian commented Dec 3, 2024

Proposed Changes

  • Fix for runtimes class chart not being used
  • Add a hook for ownership of runtime classes that rke2 supports

Types of Changes

  • Bugfix

Verification

  • first run a rke2 server and see if the runtime classes are there
root@test:/home/test# kubectl get runtimeclasses --all-namespaces
NAME                  HANDLER               AGE
crun                  crun                  6m7s
nvidia                nvidia                15m
nvidia-experimental   nvidia-experimental   6m7s
  • see the info in the runtime class
root@test:/home/test# kubectl describe runtimeclass crun
Name:         crun
Namespace:
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  meta.helm.sh/release-name: rke2-runtimeclasses
              meta.helm.sh/release-namespace: kube-system
API Version:  node.k8s.io/v1
Handler:      crun
Kind:         RuntimeClass
Metadata:
  Creation Timestamp:  2024-12-05T15:58:35Z
  Resource Version:    1638
  UID:                 f51f3d75-228a-45e7-841f-01f22e5cf9f4
Events:                <none>
  • delete the labels and annotations from a runtime class
kubectl patch runtimeclass crun --type='json' -p='[{"op": "remove", "path": "/metadata/labels"},{"op": "remove", "path": "/metadata/annotations"}]'
  • then see the runtime class again
root@test:/home/test# kubectl describe runtimeclass crun
Name:         crun
Namespace:
Labels:       <none>
Annotations:  <none>
API Version:  node.k8s.io/v1
Handler:      crun
Kind:         RuntimeClass
Metadata:
  Creation Timestamp:  2024-12-05T15:58:35Z
  Resource Version:    2624
  UID:                 f51f3d75-228a-45e7-841f-01f22e5cf9f4
Events:                <none>
  • restart rke2 and describe the runtime class, see that the labels and annotations where updated
root@test:/home/test# kubectl describe runtimeclass crun
Name:         crun
Namespace:
Labels:       app.kubernetes.io/managed-by=Helm
Annotations:  meta.helm.sh/release-name: rke2-runtimeclasses
              meta.helm.sh/release-namespace: kube-system
API Version:  node.k8s.io/v1
Handler:      crun
Kind:         RuntimeClass
Metadata:
  Creation Timestamp:  2024-12-05T15:58:35Z
  Resource Version:    2654
  UID:                 f51f3d75-228a-45e7-841f-01f22e5cf9f4
Events:                <none>
  • see if the runtime class helm install was a success
root@test: /home/test# kubectl get pods --all-namespaces
kube-system   helm-install-rke2-runtimeclasses-trdqp                  0/1     Completed           0               14m

Testing

Linked Issues

User-Facing Change


Further Comments

@codecov-commenter
Copy link

codecov-commenter commented Dec 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 43 lines in your changes missing coverage. Please review.

Project coverage is 22.94%. Comparing base (dd1c9fc) to head (116ecff).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
pkg/rke2/rc.go 0.00% 42 Missing ⚠️
pkg/rke2/rke2.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7382      +/-   ##
==========================================
- Coverage   23.23%   22.94%   -0.29%     
==========================================
  Files          33       34       +1     
  Lines        3461     3504      +43     
==========================================
  Hits          804      804              
- Misses       2609     2652      +43     
  Partials       48       48              
Flag Coverage Δ
inttests 8.70% <0.00%> (-0.11%) ⬇️
unittests 16.30% <0.00%> (-0.21%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

pkg/rke2/rc.go Outdated Show resolved Hide resolved
pkg/rke2/rc.go Outdated Show resolved Hide resolved
pkg/rke2/rc.go Outdated Show resolved Hide resolved
pkg/rke2/rc.go Outdated Show resolved Hide resolved
Signed-off-by: Vitor Savian <[email protected]>
pkg/rke2/rc.go Outdated Show resolved Hide resolved
pkg/rke2/rc.go Outdated Show resolved Hide resolved
@vitorsavian vitorsavian changed the title [WIP] Add runtime classes hook and runtimes chart Add runtime classes hook and runtimes chart Dec 5, 2024
@vitorsavian vitorsavian marked this pull request as ready for review December 5, 2024 15:59
@vitorsavian vitorsavian requested a review from a team as a code owner December 5, 2024 15:59
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

Successfully merging this pull request may close these issues.

3 participants