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

Great! this plugin helps #5

Open
bluebeach opened this issue Aug 15, 2019 · 1 comment
Open

Great! this plugin helps #5

bluebeach opened this issue Aug 15, 2019 · 1 comment

Comments

@bluebeach
Copy link

No description provided.

@bluebeach
Copy link
Author

if I want to use device /dev/mem, I need modify some config files.

host-devices-mem.yaml

apiVersion: v1
kind: ConfigMap
metadata:
  name: host-devices
  namespace: kube-system
data:
  config.json: |
    {
      "resourceName": "github.com/everpeace-mem",
      "socketName": "everpeace-mem.sock",
      "numDevices": 100,
      "hostDevices": [{
        "hostPath": "/dev/mem",
        "containerPath": "/dev/mem",
        "permission": "r"
      }]
    }

host-device-plugin.yaml

apiVersion: extensions/v1beta1
kind: DaemonSet
metadata:
  name: k8s-host-device-plugin-daemonset
  namespace: kube-system
spec:
  template:
    metadata:
      # Mark this pod as a critical add-on; when enabled, the critical add-on scheduler
      # reserves resources for critical add-on pods so that they can be rescheduled after
      # a failure.  This annotation works in tandem with the toleration below.
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ""
      labels:
        name: k8s-host-device-plugin-ds
    spec:
      tolerations:
      # Allow this pod to be rescheduled while the node is in "critical add-ons only" mode.
      # This, along with the annotation above marks this pod as a critical add-on.
      - key: CriticalAddonsOnly
        operator: Exists
      containers:
      - image: everpeace/k8s-host-device-plugin:latest
        name: k8s-host-device-plugin-ctr
        securityContext:
          allowPrivilegeEscalation: false
          capabilities:
            drop: ["ALL"]
        volumeMounts:
          - name: device-plugin
            mountPath: /var/lib/kubelet/device-plugins
          - name: config
            mountPath: /k8s-host-device-plugin
          - name: dev-mem-host
            mountPath: /dev/mem
      volumes:
        - name: device-plugin
          hostPath:
            path: /var/lib/kubelet/device-plugins
        - hostPath:
            path: /dev/mem
            type: ""
          name: dev-mem-host
        - name: config
          configMap:
            name: host-devices
            items:
            - key: config.json
              path: config.json

@bluebeach bluebeach changed the title thanks, this plugin helps Great! this plugin helps Aug 15, 2019
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

No branches or pull requests

1 participant