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

feat: Add kubernetes device ownership #69

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vigh-m
Copy link
Contributor

@vigh-m vigh-m commented Dec 20, 2024

Description of changes:

  • Create a new setting to hold the device-ownership-from-security-context boolean. This is to support the same setting in the containerd CRI plugin as described here

Testing done:

  • The setting shows up as expected in an AMI built using this settings-sdk

    # apiclient get settings.kubernetes.device-ownership-from-security-context
    {
      "settings": {
        "kubernetes": {
          "device-ownership-from-security-context": false
        }
      }
    }
    
  • Changing the setting works as defined:

    [root@admin]# apiclient set settings.kubernetes.device-ownership-from-security-context="true"
    [root@admin]# apiclient get settings.kubernetes.device-ownership-from-security-context
    {
      "settings": {
        "kubernetes": {
          "device-ownership-from-security-context": true
        }
      }
    }
    [root@admin]# sheltie cat /etc/containerd/config.toml | grep device
    device_ownership_from_security_context = true
    
  • The setting has the desired effect on device ownership

    • When true:
      # kubectl exec -it single-node-test -- bash
      ubuntu@single-node-test:/$ ls -lah /dev/ | grep neuron
      crw-------. 1 ubuntu 2000 244, 0 Dec 20 00:25 neuron0
      
    • When false:
      # kubectl exec -it single-node-test -- bash
      ubuntu@single-node-test:/$ ls -lah /dev/ | grep neuron
      crw-------. 1 root root 244, 0 Dec 19 20:03 neuron0
      

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

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.

1 participant