{"id":575,"date":"2020-03-24T17:21:15","date_gmt":"2020-03-24T09:21:15","guid":{"rendered":"https:\/\/www.myway5.com\/?p=575"},"modified":"2023-07-05T21:30:13","modified_gmt":"2023-07-05T13:30:13","slug":"kubernetes-device-plugin","status":"publish","type":"post","link":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/","title":{"rendered":"Kubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0"},"content":{"rendered":"<h2>\u4ec0\u4e48\u662f device plugin<\/h2>\n<p>Kubernetes \u4f5c\u4e3a\u4e00\u4e2a\u81ea\u52a8\u5316\u5bb9\u5668\u7f16\u6392\u7cfb\u7edf\uff0c\u5728\u8c03\u5ea6 pod \u7684\u65f6\u5019\u4f1a\u6839\u636e\u5bb9\u5668\u9700\u8981\u7684\u8d44\u6e90\u8fdb\u884c\u8282\u70b9\u7684\u9009\u62e9\uff0c\u8282\u70b9\u7684\u9009\u62e9\u4f1a\u5206\u4e3a\u9884\u9009\u548c\u4f18\u9009\u9636\u6bb5\u3002\u9884\u9009\u9636\u6bb5\u4f1a\u6839\u636e\u6240\u6709\u8282\u70b9\u4e0a\u5269\u4f59\u7684\u8d44\u6e90\u91cf\u4e0e pod \u9700\u8981\u7684\u8d44\u6e90\u91cf\u8fdb\u884c\u5bf9\u6bd4\uff0c\u9009\u51fa\u80fd\u591f\u6ee1\u8db3\u9700\u6c42\u7684\u8282\u70b9\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u8fd9\u91cc\u7684\u8d44\u6e90\u90fd\u4f1a\u5305\u62ec CPU \u548c Memory\uff0c\u5c31\u50cf\u4e0b\u9762\u8fd9\u6837\uff1a<\/p>\n<pre><code class=\"language-yaml line-numbers\">resources:\n  requests:\n    memory: \"64Mi\"\n    cpu: \"250m\"\n  limits:\n    memory: \"128Mi\"\n    cpu: \"500m\"\n<\/code><\/pre>\n<p>\u4f46\u662f\u73b0\u5728\u6211\u4eec\u6709\u4e86\u65b0\u7684\u9700\u6c42\uff0c\u6211\u4eec\u6709\u4e00\u4e2a tensorflow \u7684\u6a21\u578b\u9700\u8981\u501f\u52a9 tensorflow serving \u6765\u90e8\u7f72\uff0c\u540c\u65f6\u6211\u4eec\u5e0c\u671b\u91c7\u7528 GPU \u90e8\u7f72\u7684\u65b9\u6848\u4ee5\u52a0\u5feb\u6a21\u578b\u7684\u5728\u7ebf\u63a8\u7b97\u901f\u5ea6\u3002\u8fd9\u6837\u6211\u4eec\u5c31\u9700\u8981\u4e00\u4e2a GPU \u7684\u8d44\u6e90\u5e76\u501f\u52a9 Kubernetes \u7684\u8c03\u5ea6\u5668\u5c06\u5bb9\u5668\u8c03\u5ea6\u5230\u6709\u7a7a\u4f59 GPU \u8d44\u6e90\u7684\u65b9\u6848\u3002<\/p>\n<p>\u5728 1.11 \u7248\u672c\u4e4b\u524d\u7684 Kubernetes \u4e2d\uff0c\u63d0\u4f9b\u4e86 <code>alpha.kubernetes.io\/nvidia-gpu<\/code> \u7684\u8d44\u6e90\u540d\u79f0\u6765\u5e2e\u52a9\u6211\u4eec\u6839\u636e GPU \u8d44\u6e90\u8c03\u5ea6\u3002\u4f46\u662f\u8fd9\u4e5f\u5e26\u6765\u4e86\u4e00\u4e9b\u95ee\u9898\uff1a<\/p>\n<ul>\n<li>Kubernetes \u9700\u8981\u7ef4\u62a4 NVIDIA GPU \u76f8\u5173\u7684\u4ee3\u7801\uff0c\u589e\u52a0\u4e86\u7ef4\u62a4\u6210\u672c\u3002<\/li>\n<li>NVIDIA GPU \u65b9\u9762\u7684\u4e13\u5bb6\u4e0d\u4e00\u5b9a\u719f\u6089 Kubernetes\uff0c\u8fd9\u4e0d\u7b26\u5408\u8ba9\u6700\u64c5\u957f\u7684\u4eba\u505a\u6700\u64c5\u957f\u7684\u4e8b\u7684\u539f\u5219\u3002<\/li>\n<li>\u9664\u4e86 NVIDIA GPU\uff0c\u8fd8\u4f1a\u6709\u5176\u4ed6\u7684\u8ba1\u7b97\u8d44\u6e90\u9700\u8981\u652f\u6301\u3002<\/li>\n<\/ul>\n<p>\u56e0\u6b64\uff0cKubernetes \u5728 1.8 \u7248\u672c\u5f15\u5165\u4e86 device plugin \u673a\u5236\uff0c\u5c06\u7b2c\u4e09\u65b9\u7684\u8ba1\u7b97\u8d44\u6e90\u901a\u8fc7\u63d2\u4ef6\u7684\u65b9\u5f0f\u5f15\u5165 Kubernetes\uff0c\u5e76\u4e14\u7531\u7b2c\u4e09\u65b9\u5382\u5546\u81ea\u884c\u7ef4\u62a4\u3002Kubernetes \u793e\u533a\u7684\u6d3b\u77ac\u95f4\u5c31\u8f7b\u677e\u4e86\uff0c\u7b2c\u4e09\u65b9\u5382\u5546\u4e5f\u5f00\u5fc3\u4e86\u3002<\/p>\n<p>\u901a\u8fc7\u4ee5\u4e0a\u7684\u8bf4\u660e\uff0c\u53ef\u4ee5\u603b\u7ed3\u51fa device plugin \u4e3b\u8981\u7528\u6765\u89e3\u8026\u7b2c\u4e09\u65b9\u8ba1\u7b97\u8d44\u6e90\u548c kubernetes \u7cfb\u7edf\uff0c\u5c06\u7b2c\u4e09\u65b9\u7684\u8ba1\u7b97\u8d44\u6e90\u901a\u8fc7\u63d2\u4ef6\u7684\u65b9\u5f0f\u5f15\u5165 Kubernetes\u3002\u5f53\u7136 cpu \u548c memory \u9664\u5916\uff0c\u6bd5\u7adf\u8c01\u8fd8\u80fd\u5c11\u4e86 CPU \u548c Memory \u5462\u3002<\/p>\n<h2>device plugin \u80fd\u505a\u4ec0\u4e48<\/h2>\n<p>\u76ee\u524d\u4e00\u4e9b\u5e38\u7528\u7684 device plugin \u6709\uff1a<\/p>\n<ul>\n<li>Nvidia \u63d0\u4f9b\u7684 GPU \u63d2\u4ef6\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/NVIDIA\/k8s-device-plugin\">NVIDIA device plugin for Kubernetes<\/a><\/li>\n<li>AMD \u63d0\u4f9b\u7684 GPU \u63d2\u4ef6\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/RadeonOpenCompute\/k8s-device-plugin\">RadeonOpenCompute\/k8s-device-plugin<\/a><\/li>\n<li>\u9ad8\u6027\u80fd\u4f4e\u5ef6\u8fdf RDMA \u5361\u63d2\u4ef6\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/hustcat\/k8s-rdma-device-plugin.git\">RDMA device plugin for Kubernetes<\/a><\/li>\n<li>\u4f4e\u5ef6\u8fdf Solarflare \u4e07\u5146\u7f51\u5361\u9a71\u52a8\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/vikaschoudhary16\/sfc-device-plugin\">Solarflare Device Plugin<\/a><\/li>\n<\/ul>\n<p>\u6211\u4e86\u89e3\u7684\u8fd8\u6709\u817e\u8baf\u7684 Gaia Scheduler\uff0c\u901a\u8fc7 device plugin \u5b9e\u73b0\u7684 GPU \u865a\u62df\u5316\u65b9\u6848\u3002\u5982\u679c NVIDIA \u7684 GPU \u65b9\u6848\u8fd8\u4e0d\u591f\u9002\u5408\u4f60\uff0c\u53ef\u4ee5\u770b\u770b\u817e\u8baf\u7684\u8fd9\u4e2a\u65b9\u6848\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/tkestack\/gpu-manager\">tkestack\/gpu-manager<\/a><\/p>\n<p>\u6211\u89c9\u5f97\u817e\u8baf\u7684 GPU \u865a\u62df\u5316\u65b9\u6848\u662f\u6700\u80fd\u8bf4\u660e device plugin \u4f7f\u7528\u573a\u666f\u7684\u4f8b\u5b50\uff0c\u901a\u8fc7\u5b9a\u4e49 <code>tencent.com\/vcuda-core<\/code> \u548c <code>tencent.com\/vcuda-memory<\/code> \u8fd9\u4e24\u4e2a\u8ba1\u7b97\u8d44\u6e90\uff0c\u6765\u5c06\u4e00\u4e2a\u7269\u7406 GPU \u5212\u5206\u6210\u591a\u4e2a\u865a\u62df GPU \u8fdb\u884c\u8c03\u5ea6\uff0c\u8fd9\u6837\u53ef\u4ee5\u5b9e\u73b0\u4e00\u4e2a GPU \u4e0a\u90e8\u7f72\u591a\u4e2a tensorflow serving\u3002\u4f60\u4e0d\u9700\u8981\u8d2d\u4e70\u7279\u6b8a\u7684\u786c\u4ef6\u6216\u8005\u4fee\u6539\u4efb\u4f55 Kubernetes \u7684\u4ee3\u7801\uff0c\u5c31\u6709\u4e86 GPU \u865a\u62df\u5316\u7684\u80fd\u529b\u3002<\/p>\n<p>\u4e0b\u9762\u6211\u4eec\u5f00\u4e2a\u8111\u6d1e\uff0c\u73b0\u5728\u6211\u4eec\u6709\u4e86\u4e00\u79cd\u53eb\u505a <code>cola<\/code> \u7684\u8ba1\u7b97\u8d44\u6e90\uff0c\u53ef\u4ee5\u63d0\u9ad8\u7a0b\u5e8f\u7684 IO \u80fd\u529b\u3002\u4f46\u662f cola \u7684\u8d44\u6e90\u6709\u9650\uff0c\u53ea\u5206\u914d\u7ed9\u7279\u5b9a\u7684\u5bb9\u5668\u4f7f\u7528\u3002\u8fd9\u65f6\u5019\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7\u5b9e\u73b0\u81ea\u5df1\u7684 device plugin \u6765\u6ee1\u8db3\u8fd9\u4e2a\u9700\u6c42\u3002\u6211\u4eec\u7684\u8ba1\u7b97\u8d44\u6e90\u540d\u5c31\u53eb\u505a\uff1a <code>myway5.com\/cola<\/code>\uff0c\u5728\u4e0b\u9762\u4e00\u5c0f\u8282\u505a\u5177\u4f53\u7684\u5b9e\u73b0\u3002<\/p>\n<h2>device plugin \u7684\u5b9e\u73b0\u65b9\u6848<\/h2>\n<p>device plugin \u7684\u5de5\u4f5c\u539f\u7406\u5176\u5b9e\u4e0d\u590d\u6742\u3002\u4e3b\u8981\u6709\u4ee5\u4e0b\u6b65\u9aa4\uff1a<\/p>\n<ul>\n<li>\u9996\u5148 device plugin \u53ef\u4ee5\u901a\u8fc7\u624b\u52a8\u6216 daemonset \u90e8\u7f72\u5230\u9700\u8981\u7684\u8282\u70b9\u4e0a\u3002<\/li>\n<li>\u4e3a\u4e86\u8ba9 Kubernetes \u53d1\u73b0 device plugin\uff0c\u9700\u8981\u5411 kubelet \u7684 unix socket\u3002 \u8fdb\u884c\u6ce8\u518c\uff0c\u6ce8\u518c\u7684\u4fe1\u606f\u5305\u62ec device plugin \u7684 unix socket\uff0cAPI Version\uff0cResourceName\u3002<\/li>\n<li>kubelet \u901a\u8fc7 grpc \u5411 device plugin \u8c03\u7528 ListAndWatch\uff0c \u83b7\u53d6\u5f53\u524d\u8282\u70b9\u4e0a\u7684\u8d44\u6e90\u3002<\/li>\n<li>kubelet \u5411 api server \u66f4\u65b0\u8282\u70b9\u72b6\u6001\u6765\u901a\u77e5\u8d44\u6e90\u53d8\u66f4\u3002<\/li>\n<li>\u7528\u6237\u521b\u5efa pod\uff0c\u8bf7\u6c42\u8d44\u6e90\u5e76\u8c03\u5ea6\u5230\u8282\u70b9\u4e0a\u540e\uff0ckubelet \u8c03\u7528 device plugin \u7684 Allocate \u8fdb\u884c\u8d44\u6e90\u5206\u914d\u3002<\/li>\n<\/ul>\n<p>\u65f6\u5e8f\u56fe\u5982\u4e0b:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg\" alt=\"device plugins\" \/><\/p>\n<p>\u5728 device plugin \u7684\u5b9e\u73b0\u4e2d\uff0c\u6700\u5173\u952e\u7684\u4e24\u4e2a\u8981\u5b9e\u73b0\u7684\u65b9\u6cd5\u662f <code>ListAndWatch<\/code> \u548c <code>Allocate<\/code>\u3002\u9664\u6b64\u4e4b\u5916\uff0c\u8fd8\u8981\u6ce8\u610f\u76d1\u63a7 kubelet \u7684\u91cd\u542f\uff0c\u4e00\u822c\u662f\u4f7f\u7528 <code>fsnotify<\/code> \u7c7b\u4f3c\u7684\u5e93\u76d1\u63a7 kubelet.sock \u7684\u91cd\u65b0\u521b\u5efa\u4e8b\u4ef6\u3002\u5982\u679c\u91cd\u65b0\u521b\u5efa\u4e86\uff0c\u5219\u8ba4\u4e3a kubelet \u662f\u91cd\u542f\u4e86\uff0c\u6211\u4eec\u9700\u8981\u91cd\u65b0\u5411 kubelet \u6ce8\u518c device plugin\u3002<\/p>\n<h3>ListAndWatch<\/h3>\n<p>\u6211\u4eec\u4e0a\u9762\u5b9a\u4e49\u7684 <code>myway5.com\/cola<\/code> \u8d44\u6e90\u7528 <code>\/etc\/colas<\/code> \u4e0b\u7684\u6587\u4ef6\u4ee3\u8868\u3002\u6bcf\u4e00\u4e2a\u6587\u4ef6\u4ee3\u8868\u4e00\u4e2a\u53ef\u7528\u7684\u8d44\u6e90\u3002\u56e0\u6b64\u5b9e\u73b0 <code>ListAndWatch<\/code> \u5c31\u662f\u67e5\u627e\u8be5\u6587\u4ef6\u5939\u4e0b\u7684\u6587\u4ef6\uff0c\u7136\u540e\u6dfb\u52a0\u5230\u8bbe\u5907\u5217\u8868\u53d1\u9001\u7ed9 kubelet\uff0c\u4e4b\u540e\u8c03\u7528 <code>fsnotify<\/code> \u53bb\u76d1\u63a7\u6587\u4ef6\u7684 <code>CREATE<\/code> \u548c <code>REMOVE<\/code> \u4e8b\u4ef6\u3002\u6bcf\u6b21\u8bbe\u5907\u5217\u8868\u53d1\u751f\u53d8\u66f4\u90fd\u91cd\u65b0\u5411 kubelet \u53d1\u9001\u66f4\u65b0\u8fc7\u7684\u8bbe\u5907\u5217\u8868\u3002<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ ListAndWatch returns a stream of List of Devices\n\/\/ Whenever a Device state change or a Device disappears, ListAndWatch\n\/\/ returns the new list\nfunc (s *ColaServer) ListAndWatch(e *pluginapi.Empty, srv pluginapi.DevicePlugin_ListAndWatchServer) error {\n    log.Infoln(\"ListAndWatch called\")\n    devs := make([]*pluginapi.Device, len(s.devices))\n\n    i := 0\n    for _, dev := range s.devices {\n        devs[i] = dev\n        i++\n    }\n\n    err := srv.Send(&amp;pluginapi.ListAndWatchResponse{Devices: devs})\n    if err != nil {\n        log.Errorf(\"ListAndWatch send device error: %v\", err)\n        return err\n    }\n\n    \/\/ \u66f4\u65b0 device list\n    for {\n        log.Infoln(\"waiting for device change\")\n        select {\n        case &lt;-s.notify:\n            log.Infoln(\"\u5f00\u59cb\u66f4\u65b0device list, \u8bbe\u5907\u6570:\", len(s.devices))\n            devs := make([]*pluginapi.Device, len(s.devices))\n\n            i := 0\n            for _, dev := range s.devices {\n                devs[i] = dev\n                i++\n            }\n\n            srv.Send(&amp;pluginapi.ListAndWatchResponse{Devices: devs})\n        }\n    }\n}\n<\/code><\/pre>\n<h3>Allocate<\/h3>\n<p>\u5728\u7528\u6237\u521b\u5efa\u7684 Pod \u8bf7\u6c42\u8d44\u6e90\u65f6\uff0cKubernetes \u7684\u8c03\u5ea6\u5668\u4f1a\u8fdb\u884c\u8c03\u5ea6\uff0c\u5e76\u901a\u8fc7 kubelet \u5411 device plugin \u53d1\u51fa Allocate \u8c03\u7528\uff0c\u8fd9\u4e00\u6b65\u7684\u8c03\u7528\u4e3b\u8981\u662f\u4e3a\u4e86\u8ba9 device plugin \u4e3a\u5bb9\u5668\u8c03\u5ea6\u8d44\u6e90\u3002 \u5728\u8c03\u5ea6\u6210\u529f\u540e\u5411 kubelet \u8fd4\u56de\u8c03\u5ea6\u7ed3\u679c\u5373\u53ef\u3002<\/p>\n<pre><code class=\"language-go line-numbers\">\/\/ Allocate is called during container creation so that the Device\n\/\/ Plugin can run device specific operations and instruct Kubelet\n\/\/ of the steps to make the Device available in the container\nfunc (s *ColaServer) Allocate(ctx context.Context, reqs *pluginapi.AllocateRequest) (*pluginapi.AllocateResponse, error) {\n    log.Infoln(\"Allocate called\")\n    resps := &amp;pluginapi.AllocateResponse{}\n    for _, req := range reqs.ContainerRequests {\n        log.Infof(\"received request: %v\", strings.Join(req.DevicesIDs, \",\"))\n        resp := pluginapi.ContainerAllocateResponse{\n            Envs: map[string]string{\n                \"COLA_DEVICES\": strings.Join(req.DevicesIDs, \",\"),\n            },\n        }\n        resps.ContainerResponses = append(resps.ContainerResponses, &amp;resp)\n    }\n    return resps, nil\n}\n<\/code><\/pre>\n<h2>\u90e8\u7f72<\/h2>\n<p>device plugin \u53ef\u4ee5\u624b\u52a8\u90e8\u7f72\u5230\u673a\u5668\u4e0a\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7 Daemonset \u8fdb\u884c\u90e8\u7f72\u3002\u8fd9\u91cc\u5f53\u7136\u662f Daemonset \u8fdb\u884c\u90e8\u7f72\u4e86\u3002\u90e8\u7f72\u7684\u65f6\u5019\u6709\u51e0\u4e2a\u6ce8\u610f\u4e8b\u9879\uff1a<\/p>\n<ul>\n<li>\u9700\u8981\u6302\u8f7d hostPath\uff0c\u5176\u4e2d <code>\/var\/lib\/kubelet\/device-plugins<\/code> \u662f\u5fc5\u987b\u7684\u3002\u8fd9\u4e2a\u6587\u4ef6\u5939\u4e0b\u6709 <code>kubelet.sock<\/code>\uff0c\u4ee5\u53ca\u6211\u4eec\u4e5f\u9700\u8981\u5c06 device plugin \u7684 unix socket \u6587\u4ef6\u5b58\u5728\u8fd9\u91cc\u3002\u4f7f\u5f97 kubelet \u53ef\u4ee5\u548c\u6211\u4eec\u7684\u5e94\u7528\u901a\u4fe1\u3002<\/li>\n<li>\u4e3a device plugin \u7684 Pod \u8bbe\u7f6e\u8c03\u5ea6\u4f18\u5148\u7ea7\u522b\uff0c\u901a\u5e38\u8bbe\u7f6e\u6210 <code>priorityClassName: \"system-node-critical\"<\/code>\u3002\u8fd9\u6837\u53ef\u4ee5\u4fdd\u8bc1\u4e0d\u4f1a\u56e0\u4e3a\u8282\u70b9\u5229\u7528\u7387\u8fc7\u9ad8\u88ab\u9010\u51fa\u3002<\/li>\n<li>\u5982\u679c\u8d44\u6e90\u8bbe\u5907\u4e0d\u662f\u6bcf\u53f0\u673a\u5668\u90fd\u6709\uff0c\u5efa\u8bae\u4f7f\u7528 <code>nodeSelector<\/code> \u5c06 device plugin \u8c03\u5ea6\u5230\u6307\u5b9a\u7684\u673a\u5668\u4e0a\u3002<\/li>\n<\/ul>\n<p>device plugin \u7684\u5f00\u53d1\u6e90\u4ee3\u7801\u53ef\u4ee5\u53c2\u8003\u4e0a\u9762\u7684 <code>cola<\/code> \u4f8b\u5b50\uff1a<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/joyme123\/cola-device-plugin\">cola device plugin<\/a><\/p>\n<p>\u90e8\u7f72\u7ed3\u675f\u4e4b\u540e\uff0c\u53ef\u4ee5\u67e5\u770b\u4e00\u4e0b\u8282\u70b9\u7684\u8d44\u6e90\u60c5\u51b5\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">$ kubectl describe nodes test\nCapacity:\n cpu:                2\n ephemeral-storage:  17784752Ki\n hugepages-2Mi:      0\n memory:             1986740Ki\n myway5.com\/cola:    2\n pods:               110\nAllocatable:\n cpu:                2\n ephemeral-storage:  17784752Ki\n hugepages-2Mi:      0\n memory:             1986740Ki\n myway5.com\/cola:    2\n pods:               110\n<\/code><\/pre>\n<p>\u521b\u5efa\u4e00\u4e2a pod\uff0c\u8bf7\u6c42 <code>myway5.com\/cola<\/code> \u8d44\u6e90\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">$ kubectl apply -f e2e\/pod-with-cola.yaml\n<\/code><\/pre>\n<p>\u7136\u540e\u67e5\u770b\u4e00\u4e0b cola pod \u7684\u65e5\u5fd7\u6765\u4e86\u89e3\u8bbe\u5907\u53d1\u73b0\u548c\u8c03\u5ea6\u60c5\u51b5\uff1a<\/p>\n<pre><code class=\"language-shell line-numbers\">$ kubectl -n kube-system logs cola-thtm9 \ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"cola device plugin starting\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"find device 'cocacola'\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"find device 'peisicola'\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"watching devices\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"start GPPC server for 'myway5.com\/cola'\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"Register to kubelet with endpoint cola.sock\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"register to kubelet successfully\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"ListAndWatch called\"\ntime=\"2020-03-24T08:16:53Z\" level=info msg=\"waiting for device change\"\ntime=\"2020-03-24T08:17:10Z\" level=info msg=\"Allocate called\"\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u4ec0\u4e48\u662f device plugin Kubernetes \u4f5c\u4e3a\u4e00\u4e2a\u81ea\u52a8\u5316\u5bb9\u5668\u7f16\u6392\u7cfb\u7edf\uff0c\u5728\u8c03\u5ea6 pod \u7684\u65f6\u5019\u4f1a &hellip; <a href=\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Kubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[89],"tags":[],"class_list":["post-575","post","type-post","status-publish","format-standard","hentry","category-k8s"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Kubernetes\u5f00\u53d1\u77e5\u8bc6-device-plugin\u7684\u5b9e\u73b0 - \u4e00\u53ea\u5b89\u9759\u7684\u732b<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kubernetes\u5f00\u53d1\u77e5\u8bc6-device-plugin\u7684\u5b9e\u73b0 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"og:description\" content=\"\u4ec0\u4e48\u662f device plugin Kubernetes \u4f5c\u4e3a\u4e00\u4e2a\u81ea\u52a8\u5316\u5bb9\u5668\u7f16\u6392\u7cfb\u7edf\uff0c\u5728\u8c03\u5ea6 pod \u7684\u65f6\u5019\u4f1a &hellip; \u7ee7\u7eed\u9605\u8bfbKubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\" \/>\n<meta property=\"og:site_name\" content=\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"article:published_time\" content=\"2020-03-24T09:21:15+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-05T13:30:13+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg\" \/>\n<meta name=\"author\" content=\"jiangpengfei\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"jiangpengfei\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\"},\"author\":{\"name\":\"jiangpengfei\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"headline\":\"Kubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0\",\"datePublished\":\"2020-03-24T09:21:15+00:00\",\"dateModified\":\"2023-07-05T13:30:13+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\"},\"wordCount\":166,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg\",\"articleSection\":[\"k8s\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\",\"url\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\",\"name\":\"Kubernetes\u5f00\u53d1\u77e5\u8bc6-device-plugin\u7684\u5b9e\u73b0 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg\",\"datePublished\":\"2020-03-24T09:21:15+00:00\",\"dateModified\":\"2023-07-05T13:30:13+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage\",\"url\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg\",\"contentUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.myway5.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.myway5.com\/#website\",\"url\":\"https:\/\/www.myway5.com\/\",\"name\":\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"description\":\"\u60f3\u5565\u5462\",\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.myway5.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\",\"name\":\"jiangpengfei\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g\",\"caption\":\"jiangpengfei\"},\"logo\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/www.myway5.com\/index.php\/author\/joyme\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Kubernetes\u5f00\u53d1\u77e5\u8bc6-device-plugin\u7684\u5b9e\u73b0 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/","og_locale":"zh_CN","og_type":"article","og_title":"Kubernetes\u5f00\u53d1\u77e5\u8bc6-device-plugin\u7684\u5b9e\u73b0 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","og_description":"\u4ec0\u4e48\u662f device plugin Kubernetes \u4f5c\u4e3a\u4e00\u4e2a\u81ea\u52a8\u5316\u5bb9\u5668\u7f16\u6392\u7cfb\u7edf\uff0c\u5728\u8c03\u5ea6 pod \u7684\u65f6\u5019\u4f1a &hellip; \u7ee7\u7eed\u9605\u8bfbKubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0","og_url":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/","og_site_name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","article_published_time":"2020-03-24T09:21:15+00:00","article_modified_time":"2023-07-05T13:30:13+00:00","og_image":[{"url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg","type":"","width":"","height":""}],"author":"jiangpengfei","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"jiangpengfei","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#article","isPartOf":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/"},"author":{"name":"jiangpengfei","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"headline":"Kubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0","datePublished":"2020-03-24T09:21:15+00:00","dateModified":"2023-07-05T13:30:13+00:00","mainEntityOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/"},"wordCount":166,"commentCount":6,"publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg","articleSection":["k8s"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/","url":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/","name":"Kubernetes\u5f00\u53d1\u77e5\u8bc6-device-plugin\u7684\u5b9e\u73b0 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","isPartOf":{"@id":"https:\/\/www.myway5.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg","datePublished":"2020-03-24T09:21:15+00:00","dateModified":"2023-07-05T13:30:13+00:00","breadcrumb":{"@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#primaryimage","url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg","contentUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2020\/03\/device-plugins.svg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.myway5.com\/index.php\/2020\/03\/24\/kubernetes-device-plugin\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.myway5.com\/"},{"@type":"ListItem","position":2,"name":"Kubernetes\u5f00\u53d1\u77e5\u8bc6&#8211;device-plugin\u7684\u5b9e\u73b0"}]},{"@type":"WebSite","@id":"https:\/\/www.myway5.com\/#website","url":"https:\/\/www.myway5.com\/","name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","description":"\u60f3\u5565\u5462","publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.myway5.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685","name":"jiangpengfei","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f8c7de757f6e0247412bcfd31b7c2271?s=96&d=monsterid&r=g","caption":"jiangpengfei"},"logo":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/image\/"},"url":"https:\/\/www.myway5.com\/index.php\/author\/joyme\/"}]}},"views":13604,"_links":{"self":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/comments?post=575"}],"version-history":[{"count":2,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/575\/revisions"}],"predecessor-version":[{"id":1552,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/575\/revisions\/1552"}],"wp:attachment":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/media?parent=575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/categories?post=575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/tags?post=575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}