{"id":1894,"date":"2020-07-06T18:42:00","date_gmt":"2020-07-06T10:42:00","guid":{"rendered":"http:\/\/39.97.231.10\/?p=1894"},"modified":"2020-07-06T18:42:00","modified_gmt":"2020-07-06T10:42:00","slug":"%e5%ae%b9%e5%99%a8%e5%bc%80%e6%94%be%e6%8e%a5%e5%8f%a3%e8%a7%84%e8%8c%83%ef%bc%88cri-oci-cni%ef%bc%89","status":"publish","type":"post","link":"http:\/\/www.weijing.co\/?p=1894","title":{"rendered":"\u5bb9\u5668\u5f00\u653e\u63a5\u53e3\u89c4\u8303\uff08CRI OCI CNI\uff09"},"content":{"rendered":"<div>\n<div>CRI &#8211; Container Runtime Interface\uff08\u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3\uff09<\/div>\n<\/div>\n<article>CRI\u4e2d\u5b9a\u4e49\u4e86\u5bb9\u5668\u548c\u955c\u50cf\u7684\u670d\u52a1\u7684\u63a5\u53e3\uff0c\u56e0\u4e3a\u5bb9\u5668\u8fd0\u884c\u65f6\u4e0e\u955c\u50cf\u7684\u751f\u547d\u5468\u671f\u662f\u5f7c\u6b64\u9694\u79bb\u7684\uff0c\u56e0\u6b64\u9700\u8981\u5b9a\u4e49\u4e24\u4e2a\u670d\u52a1\uff0c\u8be5\u63a5\u53e3\u4f7f\u7528Protocol Buffer\uff0c\u57fa\u4e8egRPC\u3002<br \/>\nContainer Runtime\u5b9e\u73b0\u4e86CRI gRPC Server\uff0c\u5305\u62ecRuntimeService\u548cImageService\u3002\u8be5gRPC Server\u9700\u8981\u76d1\u542c\u672c\u5730\u7684Unix socket\uff0c\u800ckubelet\u5219\u4f5c\u4e3agRPC Client\u8fd0\u884c<\/p>\n<div>\n<div>\n<div><\/div>\n<div data-width=\\\"572\\\" data-height=\\\"136\\\"><img class=\\\"aligncenter\\\" src=\\\"https:\/\/upload-images.jianshu.io\/upload_images\/5006907-f9559e85034210cf.png?imageMogr2\/auto-orient\/strip|imageView2\/2\/w\/572\/format\/webp\\\" data-original-src=\\\"\/\/upload-images.jianshu.io\/upload_images\/5006907-f9559e85034210cf.png\\\" data-original-width=\\\"572\\\" data-original-height=\\\"136\\\" data-original-format=\\\"image\/png\\\" data-original-filesize=\\\"33220\\\" data-image-index=\\\"0\\\" \/><\/div>\n<\/div>\n<\/div>\n<h4>\u542f\u7528CRI<\/h4>\n<p>\u9664\u975e\u96c6\u6210\u4e86rktnetes\uff0c\u5426\u5219CRI\u90fd\u662f\u88ab\u9ed8\u8ba4\u542f\u7528\u4e86\uff0ckubernetes1.7\u7248\u672c\u5f00\u59cb\u65e7\u7684\u9884\u96c6\u6210\u7684docker CRI\u5df2\u7ecf\u88ab\u79fb\u9664\u3002<br \/>\n\u8981\u60f3\u542f\u7528CRI\u53ea\u9700\u8981\u5728kubelet\u7684\u542f\u52a8\u53c2\u6570\u91cd\u4f20\u5165\u6b64\u53c2\u6570\uff1a&#8211;container-runtime-endpoint\u8fdc\u7a0b\u8fd0\u884c\u65f6\u670d\u52a1\u7684\u7aef\u70b9\u3002\u5f53\u524dLinux\u4e0a\u652f\u6301unix socket\uff0cwindows\u4e0a\u652f\u6301tcp\u3002\u4f8b\u5982\uff1aunix:\/\/\/var\/run\/dockershim.sock(socket)\u3001\u00a0tcp:\/\/localhost:373(tcp)\uff0c\u9ed8\u8ba4\u662funix:\/\/\/var\/run\/dockershim.sock\uff0c\u5373\u9ed8\u8ba4\u4f7f\u7528\u672c\u5730\u7684docker\u4f5c\u4e3a\u5bb9\u5668\u8fd0\u884c\u65f6.<br \/>\n\u914d\u7f6e\u5b9e\u4f8b\uff1a\u5982\u4f7f\u7528cri-containerd\u4f5c\u4e3aCRI\u63a5\u53e3\uff0c\u4f7f\u7528kubeadm\u5b89\u88c5\u96c6\u7fa4\uff0c10-kubelet.onf\u6539\u52a8\u914d\u7f6e\u5982\u4e0b\uff1a<\/p>\n<div>\n<pre>Environment=\\\"KUBELET_EXTRA_ARGS=--container-runtime=remote --runtime-request-timeout=15m --container-runtime-endpoint=unix:\/\/\/run\/containerd\/containerd.sock\\\"\n<\/pre>\n<\/div>\n<h4>\u63a5\u53e3\u5b9a\u4e49<\/h4>\n<div>\n<pre>\/\/ Runtime service defines the public APIs for remote container runtimes\nservice RuntimeService {\n    \/\/ Version returns the runtime name, runtime version, and runtime API version.\n    rpc Version(VersionRequest) returns (VersionResponse) {}\n    \/\/ RunPodSandbox creates and starts a pod-level sandbox. Runtimes must ensure\n    \/\/ the sandbox is in the ready state on success.\n    rpc RunPodSandbox(RunPodSandboxRequest) returns (RunPodSandboxResponse) {}\n    \/\/ StopPodSandbox stops any running process that is part of the sandbox and\n    \/\/ reclaims network resources (e.g., IP addresses) allocated to the sandbox.\n    \/\/ If there are any running containers in the sandbox, they must be forcibly\n    \/\/ terminated.\n    \/\/ This call is idempotent, and must not return an error if all relevant\n    \/\/ resources have already been reclaimed. kubelet will call StopPodSandbox\n    \/\/ at least once before calling RemovePodSandbox. It will also attempt to\n    \/\/ reclaim resources eagerly, as soon as a sandbox is not needed. Hence,\n    \/\/ multiple StopPodSandbox calls are expected.\n    rpc StopPodSandbox(StopPodSandboxRequest) returns (StopPodSandboxResponse) {}\n    \/\/ RemovePodSandbox removes the sandbox. If there are any running containers\n    \/\/ in the sandbox, they must be forcibly terminated and removed.\n    \/\/ This call is idempotent, and must not return an error if the sandbox has\n    \/\/ already been removed.\n    rpc RemovePodSandbox(RemovePodSandboxRequest) returns (RemovePodSandboxResponse) {}\n    \/\/ PodSandboxStatus returns the status of the PodSandbox. If the PodSandbox is not\n    \/\/ present, returns an error.\n    rpc PodSandboxStatus(PodSandboxStatusRequest) returns (PodSandboxStatusResponse) {}\n    \/\/ ListPodSandbox returns a list of PodSandboxes.\n    rpc ListPodSandbox(ListPodSandboxRequest) returns (ListPodSandboxResponse) {}\n    \/\/ CreateContainer creates a new container in specified PodSandbox\n    rpc CreateContainer(CreateContainerRequest) returns (CreateContainerResponse) {}\n    \/\/ StartContainer starts the container.\n    rpc StartContainer(StartContainerRequest) returns (StartContainerResponse) {}\n    \/\/ StopContainer stops a running container with a grace period (i.e., timeout).\n    \/\/ This call is idempotent, and must not return an error if the container has\n    \/\/ already been stopped.\n    \/\/ TODO: what must the runtime do after the grace period is reached?\n    rpc StopContainer(StopContainerRequest) returns (StopContainerResponse) {}\n    \/\/ RemoveContainer removes the container. If the container is running, the\n    \/\/ container must be forcibly removed.\n    \/\/ This call is idempotent, and must not return an error if the container has\n    \/\/ already been removed.\n    rpc RemoveContainer(RemoveContainerRequest) returns (RemoveContainerResponse) {}\n    \/\/ ListContainers lists all containers by filters.\n    rpc ListContainers(ListContainersRequest) returns (ListContainersResponse) {}\n    \/\/ ContainerStatus returns status of the container. If the container is not\n    \/\/ present, returns an error.\n    rpc ContainerStatus(ContainerStatusRequest) returns (ContainerStatusResponse) {}\n    \/\/ UpdateContainerResources updates ContainerConfig of the container.\n    rpc UpdateContainerResources(UpdateContainerResourcesRequest) returns (UpdateContainerResourcesResponse) {}\n    \/\/ ExecSync runs a command in a container synchronously.\n    rpc ExecSync(ExecSyncRequest) returns (ExecSyncResponse) {}\n    \/\/ Exec prepares a streaming endpoint to execute a command in the container.\n    rpc Exec(ExecRequest) returns (ExecResponse) {}\n    \/\/ Attach prepares a streaming endpoint to attach to a running container.\n    rpc Attach(AttachRequest) returns (AttachResponse) {}\n    \/\/ PortForward prepares a streaming endpoint to forward ports from a PodSandbox.\n    rpc PortForward(PortForwardRequest) returns (PortForwardResponse) {}\n    \/\/ ContainerStats returns stats of the container. If the container does not\n    \/\/ exist, the call returns an error.\n    rpc ContainerStats(ContainerStatsRequest) returns (ContainerStatsResponse) {}\n    \/\/ ListContainerStats returns stats of all running containers.\n    rpc ListContainerStats(ListContainerStatsRequest) returns (ListContainerStatsResponse) {}\n    \/\/ UpdateRuntimeConfig updates the runtime configuration based on the given request.\n    rpc UpdateRuntimeConfig(UpdateRuntimeConfigRequest) returns (UpdateRuntimeConfigResponse) {}\n    \/\/ Status returns the status of the runtime.\n    rpc Status(StatusRequest) returns (StatusResponse) {}\n}\n\/\/ ImageService defines the public APIs for managing images.\nservice ImageService {\n    \/\/ ListImages lists existing images.\n    rpc ListImages(ListImagesRequest) returns (ListImagesResponse) {}\n    \/\/ ImageStatus returns the status of the image. If the image is not\n    \/\/ present, returns a response with ImageStatusResponse.Image set to\n    \/\/ nil.\n    rpc ImageStatus(ImageStatusRequest) returns (ImageStatusResponse) {}\n    \/\/ PullImage pulls an image with authentication config.\n    rpc PullImage(PullImageRequest) returns (PullImageResponse) {}\n    \/\/ RemoveImage removes the image.\n    \/\/ This call is idempotent, and must not return an error if the image has\n    \/\/ already been removed.\n    rpc RemoveImage(RemoveImageRequest) returns (RemoveImageResponse) {}\n    \/\/ ImageFSInfo returns information of the filesystem that is used to store images.\n    rpc ImageFsInfo(ImageFsInfoRequest) returns (ImageFsInfoResponse) {}\n}\n<\/pre>\n<\/div>\n<p>\u8fd9\u5176\u4e2d\u5305\u542b\u4e86\u4e24\u4e2agRPC\u670d\u52a1\uff1a<\/p>\n<ul>\n<li>RuntimeService\uff1a\u5bb9\u5668\u548cSandbox\u8fd0\u884c\u65f6\u7ba1\u7406<\/li>\n<li>ImageService\uff1a\u63d0\u4f9b\u4e86\u4ece\u955c\u50cf\u4ed3\u5e93\u62c9\u53d6\u3001\u67e5\u770b\u3001\u548c\u79fb\u9664\u955c\u50cf\u7684RPC\u3002<\/li>\n<\/ul>\n<h1>CNI &#8211; Container Network Interface(\u5bb9\u5668\u7f51\u7edc\u63a5\u53e3)<\/h1>\n<p>CNI(Container Network Interface) \u662f google \u548c CoreOS \u4e3b\u5bfc\u5236\u5b9a\u7684\u5bb9\u5668\u7f51\u7edc\u6807\u51c6\uff0c\u5b83\u672c\u8eab\u5e76\u4e0d\u662f\u5b9e\u73b0\u6216\u8005\u4ee3\u7801\uff0c\u53ef\u4ee5\u7406\u89e3\u6210\u4e00\u4e2a\u534f\u8bae\u3002\u8fd9\u4e2a\u6807\u51c6\u662f\u5728 rkt \u7f51\u7edc\u63d0\u8bae\u7684\u57fa\u7840\u4e0a\u53d1\u5c55\u8d77\u6765\u7684\uff0c\u7efc\u5408\u8003\u8651\u4e86\u7075\u6d3b\u6027\u3001\u6269\u5c55\u6027\u3001ip \u5206\u914d\u3001\u591a\u7f51\u5361\u7b49\u56e0\u7d20.<br \/>\n\u8fd9\u4e2a\u534f\u8bae\u8fde\u63a5\u4e86\u4e24\u4e2a\u7ec4\u4ef6\uff1a\u5bb9\u5668\u7ba1\u7406\u7cfb\u7edf\u548c\u7f51\u7edc\u63d2\u4ef6\u3002\u5b83\u4eec\u4e4b\u95f4\u901a\u8fc7 JSON \u683c\u5f0f\u7684\u6587\u4ef6\u8fdb\u884c\u901a\u4fe1\uff0c\u5b9e\u73b0\u5bb9\u5668\u7684\u7f51\u7edc\u529f\u80fd\u3002\u5177\u4f53\u7684\u4e8b\u60c5\u90fd\u662f\u63d2\u4ef6\u6765\u5b9e\u73b0\u7684\uff0c\u5305\u62ec\uff1a\u521b\u5efa\u5bb9\u5668\u7f51\u7edc\u7a7a\u95f4\uff08network namespace\uff09\u3001\u628a\u7f51\u7edc\u63a5\u53e3\uff08interface\uff09\u653e\u5230\u5bf9\u5e94\u7684\u7f51\u7edc\u7a7a\u95f4\u3001\u7ed9\u7f51\u7edc\u63a5\u53e3\u5206\u914d IP \u7b49\u7b49<\/p>\n<div>\n<div>\n<div><\/div>\n<div data-width=\\\"1600\\\" data-height=\\\"1067\\\"><img src=\\\"https:\/\/upload-images.jianshu.io\/upload_images\/5006907-be852310382f8119.png?imageMogr2\/auto-orient\/strip|imageView2\/2\/w\/1200\/format\/webp\\\" data-original-src=\\\"\/\/upload-images.jianshu.io\/upload_images\/5006907-be852310382f8119.png\\\" data-original-width=\\\"1600\\\" data-original-height=\\\"1067\\\" data-original-format=\\\"image\/png\\\" data-original-filesize=\\\"21577\\\" data-image-index=\\\"1\\\" \/><\/div>\n<\/div>\n<\/div>\n<h4>\u63a5\u53e3\u5b9a\u4e49<\/h4>\n<div>\n<pre>type CNI interface {\n    AddNetworkList(net *NetworkConfigList, rt *RuntimeConf) (types.Result, error)\n    DelNetworkList(net *NetworkConfigList, rt *RuntimeConf) error\n    AddNetwork(net *NetworkConfig, rt *RuntimeConf) (types.Result, error)\n    DelNetwork(net *NetworkConfig, rt *RuntimeConf) error\n}\n<\/pre>\n<\/div>\n<p>\u8be5\u63a5\u53e3\u53ea\u6709\u56db\u4e2a\u65b9\u6cd5\uff0c\u6dfb\u52a0\u7f51\u7edc\u3001\u5220\u9664\u7f51\u7edc\u3001\u6dfb\u52a0\u7f51\u7edc\u5217\u8868\u3001\u5220\u9664\u7f51\u7edc\u5217\u8868\u3002<\/p>\n<h4>\u8bbe\u8ba1\u8003\u91cf<\/h4>\n<p>CNI\u8bbe\u8ba1\u7684\u65f6\u5019\u8003\u8651\u4e86\u4ee5\u4e0b\u95ee\u9898\uff1a<\/p>\n<ul>\n<li>\u5bb9\u5668\u8fd0\u884c\u65f6\u5fc5\u987b\u5728\u8c03\u7528\u4efb\u4f55\u63d2\u4ef6\u4e4b\u524d\u4e3a\u5bb9\u5668\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u7f51\u7edc\u547d\u540d\u7a7a\u95f4\u3002<\/li>\n<li>\u8fd0\u884c\u65f6\u5fc5\u987b\u786e\u5b9a\u8fd9\u4e2a\u5bb9\u5668\u5e94\u5c5e\u4e8e\u54ea\u4e2a\u7f51\u7edc\uff0c\u5e76\u4e3a\u6bcf\u4e2a\u7f51\u7edc\u786e\u5b9a\u54ea\u4e9b\u63d2\u4ef6\u5fc5\u987b\u88ab\u6267\u884c\u3002<\/li>\n<li>\u7f51\u7edc\u914d\u7f6e\u91c7\u7528JSON\u683c\u5f0f\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u5b58\u50a8\u5728\u6587\u4ef6\u4e2d\u3002\u7f51\u7edc\u914d\u7f6e\u5305\u62ec\u5fc5\u586b\u5b57\u6bb5\uff0c\u5982name\u548ctype\u4ee5\u53ca\u63d2\u4ef6\uff08\u7c7b\u578b\uff09\u3002\u7f51\u7edc\u914d\u7f6e\u5141\u8bb8\u5b57\u6bb5\u5728\u8c03\u7528\u4e4b\u95f4\u6539\u53d8\u503c\u3002\u4e3a\u6b64\uff0c\u6709\u4e00\u4e2a\u53ef\u9009\u7684\u5b57\u6bb5args\uff0c\u5fc5\u987b\u5305\u542b\u4e0d\u540c\u7684\u4fe1\u606f\u3002<\/li>\n<li>\u5bb9\u5668\u8fd0\u884c\u65f6\u5fc5\u987b\u6309\u987a\u5e8f\u4e3a\u6bcf\u4e2a\u7f51\u7edc\u6267\u884c\u76f8\u5e94\u7684\u63d2\u4ef6\uff0c\u5c06\u5bb9\u5668\u6dfb\u52a0\u5230\u6bcf\u4e2a\u7f51\u7edc\u4e2d\u3002<\/li>\n<li>\u5728\u5b8c\u6210\u5bb9\u5668\u751f\u547d\u5468\u671f\u540e\uff0c\u8fd0\u884c\u65f6\u5fc5\u987b\u4ee5\u76f8\u53cd\u7684\u987a\u5e8f\u6267\u884c\u63d2\u4ef6\uff08\u76f8\u5bf9\u4e8e\u6267\u884c\u6dfb\u52a0\u5bb9\u5668\u7684\u987a\u5e8f\uff09\u4ee5\u5c06\u5bb9\u5668\u4e0e\u7f51\u7edc\u65ad\u5f00\u8fde\u63a5\u3002<\/li>\n<li>\u5bb9\u5668\u8fd0\u884c\u65f6\u4e0d\u80fd\u4e3a\u540c\u4e00\u5bb9\u5668\u8c03\u7528\u5e76\u884c\u64cd\u4f5c\uff0c\u4f46\u53ef\u4ee5\u4e3a\u4e0d\u540c\u7684\u5bb9\u5668\u8c03\u7528\u5e76\u884c\u64cd\u4f5c\u3002<\/li>\n<li>\u5bb9\u5668\u8fd0\u884c\u65f6\u5fc5\u987b\u4e3a\u5bb9\u5668\u8ba2\u9605ADD\u548cDEL\u64cd\u4f5c\uff0c\u8fd9\u6837ADD\u540e\u9762\u603b\u662f\u8ddf\u7740\u76f8\u5e94\u7684DEL\u3002 DEL\u53ef\u80fd\u8ddf\u7740\u989d\u5916\u7684DEL\uff0c\u4f46\u662f\uff0c\u63d2\u4ef6\u5e94\u8be5\u5141\u8bb8\u5904\u7406\u591a\u4e2aDEL\uff08\u5373\u63d2\u4ef6DEL\u5e94\u8be5\u662f\u5e42\u7b49\u7684\uff09\u3002<\/li>\n<li>\u5bb9\u5668\u5fc5\u987b\u7531ContainerID\u552f\u4e00\u6807\u8bc6\u3002\u5b58\u50a8\u72b6\u6001\u7684\u63d2\u4ef6\u5e94\u8be5\u4f7f\u7528\uff08\u7f51\u7edc\u540d\u79f0\uff0c\u5bb9\u5668ID\uff09\u7684\u4e3b\u952e\u6765\u5b8c\u6210\u3002<\/li>\n<li>\u8fd0\u884c\u65f6\u4e0d\u80fd\u8c03\u7528\u540c\u4e00\u4e2a\u7f51\u7edc\u540d\u79f0\u6216\u5bb9\u5668ID\u6267\u884c\u4e24\u6b21ADD\uff08\u6ca1\u6709\u76f8\u5e94\u7684DEL\uff09\u3002\u6362\u53e5\u8bdd\u8bf4\uff0c\u7ed9\u5b9a\u7684\u5bb9\u5668ID\u5fc5\u987b\u53ea\u80fd\u6dfb\u52a0\u5230\u7279\u5b9a\u7684\u7f51\u7edc\u4e00\u6b21\u3002<\/li>\n<\/ul>\n<h4>CNI\u63d2\u4ef6<\/h4>\n<p>CNI\u63d2\u4ef6\u5fc5\u987b\u5b9e\u73b0\u4e00\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u53ef\u4ee5\u88ab\u5bb9\u5668\u7ba1\u7406\u7cfb\u7edf\uff08\u4f8b\u5982rkt\u6216Kubernetes\uff09\u8c03\u7528\u3002<br \/>\nCNI\u63d2\u4ef6\u8d1f\u8d23\u5c06\u7f51\u7edc\u63a5\u53e3\u63d2\u5165\u5bb9\u5668\u7f51\u7edc\u547d\u540d\u7a7a\u95f4\uff08\u4f8b\u5982\uff0cveth\u5bf9\u7684\u4e00\u7aef\uff09\uff0c\u5e76\u5728\u4e3b\u673a\u4e0a\u8fdb\u884c\u4efb\u4f55\u5fc5\u8981\u7684\u6539\u53d8\uff08\u4f8b\u5982\u5c06veth\u7684\u53e6\u4e00\u7aef\u8fde\u63a5\u5230\u7f51\u6865\uff09\u3002\u7136\u540e\u5c06IP\u5206\u914d\u7ed9\u63a5\u53e3\uff0c\u5e76\u901a\u8fc7\u8c03\u7528\u9002\u5f53\u7684IPAM\u63d2\u4ef6\u6765\u8bbe\u7f6e\u4e0e\u201cIP\u5730\u5740\u7ba1\u7406\u201d\u90e8\u5206\u4e00\u81f4\u7684\u8def\u7531\u3002<br \/>\nCNI\u63d2\u4ef6\u5fc5\u987b\u5b9e\u73b0\u5bb9\u5668\u7f51\u7edc\u6dfb\u52a0\uff0c\u5bb9\u5668\u7f51\u7edc\u5220\u9664\uff0cIP\u5206\u914d\u7b49\u529f\u80fd<\/p>\n<h5>\u53ef\u7528\u63d2\u4ef6<\/h5>\n<p>Main\uff1a\u63a5\u53e3\u521b\u5efa<\/p>\n<ul>\n<li>bridge\uff1a\u521b\u5efa\u7f51\u6865\uff0c\u5e76\u6dfb\u52a0\u4e3b\u673a\u548c\u5bb9\u5668\u5230\u8be5\u7f51\u6865<\/li>\n<li>ipvlan\uff1a\u5728\u5bb9\u5668\u4e2d\u6dfb\u52a0\u4e00\u4e2aipvlan\u63a5\u53e3<\/li>\n<li>loopback\uff1a\u521b\u5efa\u4e00\u4e2a\u56de\u73af\u63a5\u53e3<\/li>\n<li>macvlan\uff1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684MAC\u5730\u5740\uff0c\u5c06\u6240\u6709\u7684\u6d41\u91cf\u8f6c\u53d1\u5230\u5bb9\u5668<\/li>\n<li>ptp\uff1a\u521b\u5efaveth\u5bf9<\/li>\n<li>vlan\uff1a\u5206\u914d\u4e00\u4e2avlan\u8bbe\u5907<\/li>\n<\/ul>\n<p>IPAM\uff1aIP\u5730\u5740\u5206\u914d<\/p>\n<ul>\n<li>dhcp\uff1a\u5728\u4e3b\u673a\u4e0a\u8fd0\u884c\u5b88\u62a4\u7a0b\u5e8f\uff0c\u4ee3\u8868\u5bb9\u5668\u53d1\u51faDHCP\u8bf7\u6c42<\/li>\n<li>host-local\uff1a\u7ef4\u62a4\u5206\u914dIP\u7684\u672c\u5730\u6570\u636e\u5e93<\/li>\n<\/ul>\n<p>Meta\uff1a\u5176\u5b83\u63d2\u4ef6<\/p>\n<ul>\n<li>flannel\uff1a\u6839\u636eflannel\u7684\u914d\u7f6e\u6587\u4ef6\u521b\u5efa\u63a5\u53e3<\/li>\n<li>tuning\uff1a\u8c03\u6574\u73b0\u6709\u63a5\u53e3\u7684sysctl\u53c2\u6570<\/li>\n<li>portmap\uff1a\u4e00\u4e2a\u57fa\u4e8eiptables\u7684portmapping\u63d2\u4ef6\u3002\u5c06\u7aef\u53e3\u4ece\u4e3b\u673a\u7684\u5730\u5740\u7a7a\u95f4\u6620\u5c04\u5230\u5bb9\u5668\u3002<\/li>\n<\/ul>\n<h1>OCI &#8211; Open Container Initiative<\/h1>\n<p>Linux\u57fa\u91d1\u4f1a\u4e8e2015\u5e746\u6708\u6210\u7acbOCI\uff08Open Container Initiative\uff09\u7ec4\u7ec7\uff0c\u65e8\u5728\u56f4\u7ed5\u5bb9\u5668\u683c\u5f0f\u548c\u8fd0\u884c\u65f6\u5236\u5b9a\u4e00\u4e2a\u5f00\u653e\u7684\u5de5\u4e1a\u5316\u6807\u51c6\uff0c\u76ee\u524d\u4e3b\u8981\u6709\u4e24\u4e2a\u6807\u51c6\u6587\u6863\uff1a\u5bb9\u5668\u8fd0\u884c\u65f6\u6807\u51c6 \uff08runtime spec\uff09\u548c \u5bb9\u5668\u955c\u50cf\u6807\u51c6\uff08image spec\uff09<br \/>\n\u5236\u5b9a\u5bb9\u5668\u683c\u5f0f\u6807\u51c6\u7684\u5b97\u65e8\u6982\u62ec\u6765\u8bf4\u5c31\u662f\u4e0d\u53d7\u4e0a\u5c42\u7ed3\u6784\u7684\u7ed1\u5b9a\uff0c\u5982\u7279\u5b9a\u7684\u5ba2\u6237\u7aef\u3001\u7f16\u6392\u6808\u7b49\uff0c\u540c\u65f6\u4e5f\u4e0d\u53d7\u7279\u5b9a\u7684\u4f9b\u5e94\u5546\u6216\u9879\u76ee\u7684\u7ed1\u5b9a\uff0c\u5373\u4e0d\u9650\u4e8e\u67d0\u79cd\u7279\u5b9a\u64cd\u4f5c\u7cfb\u7edf\u3001\u786c\u4ef6\u3001CPU\u67b6\u6784\u3001\u516c\u6709\u4e91\u7b49\u3002<\/p>\n<div>\n<div>\n<div><\/div>\n<div data-width=\\\"1134\\\" data-height=\\\"775\\\"><img src=\\\"https:\/\/upload-images.jianshu.io\/upload_images\/5006907-1df0dee712a5c47e.jpg?imageMogr2\/auto-orient\/strip|imageView2\/2\/w\/1134\/format\/webp\\\" data-original-src=\\\"\/\/upload-images.jianshu.io\/upload_images\/5006907-1df0dee712a5c47e.jpg\\\" data-original-width=\\\"1134\\\" data-original-height=\\\"775\\\" data-original-format=\\\"image\/jpeg\\\" data-original-filesize=\\\"57702\\\" data-image-index=\\\"2\\\" \/><\/div>\n<\/div>\n<\/div>\n<p>\u8fd9\u4e24\u4e2a\u534f\u8bae\u901a\u8fc7 OCI runtime filesytem bundle \u7684\u6807\u51c6\u683c\u5f0f\u8fde\u63a5\u5728\u4e00\u8d77\uff0cOCI \u955c\u50cf\u53ef\u4ee5\u901a\u8fc7\u5de5\u5177\u8f6c\u6362\u6210 bundle\uff0c\u7136\u540e OCI \u5bb9\u5668\u5f15\u64ce\u80fd\u591f\u8bc6\u522b\u8fd9\u4e2a bundle \u6765\u8fd0\u884c\u5bb9\u5668<\/p>\n<h4>\u8bbe\u8ba1\u8003\u91cf<\/h4>\n<ul>\n<li>\u64cd\u4f5c\u6807\u51c6\u5316\uff1a\u5bb9\u5668\u7684\u6807\u51c6\u5316\u64cd\u4f5c\u5305\u62ec\u4f7f\u7528\u6807\u51c6\u5bb9\u5668\u521b\u5efa\u3001\u542f\u52a8\u3001\u505c\u6b62\u5bb9\u5668\uff0c\u4f7f\u7528\u6807\u51c6\u6587\u4ef6\u7cfb\u7edf\u5de5\u5177\u590d\u5236\u548c\u521b\u5efa\u5bb9\u5668\u5feb\u7167\uff0c\u4f7f\u7528\u6807\u51c6\u5316\u7f51\u7edc\u5de5\u5177\u8fdb\u884c\u4e0b\u8f7d\u548c\u4e0a\u4f20\u3002<\/li>\n<li>\u5185\u5bb9\u65e0\u5173\uff1a\u5185\u5bb9\u65e0\u5173\u6307\u4e0d\u7ba1\u9488\u5bf9\u7684\u5177\u4f53\u5bb9\u5668\u5185\u5bb9\u662f\u4ec0\u4e48\uff0c\u5bb9\u5668\u6807\u51c6\u64cd\u4f5c\u6267\u884c\u540e\u90fd\u80fd\u4ea7\u751f\u540c\u6837\u7684\u6548\u679c\u3002\u5982\u5bb9\u5668\u53ef\u4ee5\u7528\u540c\u6837\u7684\u65b9\u5f0f\u4e0a\u4f20\u3001\u542f\u52a8\uff0c\u4e0d\u7ba1\u662fPHP\u5e94\u7528\u8fd8\u662fMySQL\u6570\u636e\u5e93\u670d\u52a1\u3002<\/li>\n<li>\u57fa\u7840\u8bbe\u65bd\u65e0\u5173\uff1a\u65e0\u8bba\u662f\u4e2a\u4eba\u7684\u7b14\u8bb0\u672c\u7535\u8111\u8fd8\u662fAWS S3\uff0c\u4ea6\u6216\u662fOpenStack\uff0c\u6216\u8005\u5176\u5b83\u57fa\u7840\u8bbe\u65bd\uff0c\u90fd\u5e94\u8be5\u5bf9\u652f\u6301\u5bb9\u5668\u7684\u5404\u9879\u64cd\u4f5c\u3002<\/li>\n<li>\u4e3a\u81ea\u52a8\u5316\u91cf\u8eab\u5b9a\u5236\uff1a\u5236\u5b9a\u5bb9\u5668\u7edf\u4e00\u6807\u51c6\uff0c\u662f\u7684\u64cd\u4f5c\u5185\u5bb9\u65e0\u5173\u5316\u3001\u5e73\u53f0\u65e0\u5173\u5316\u7684\u6839\u672c\u76ee\u7684\u4e4b\u4e00\uff0c\u5c31\u662f\u4e3a\u4e86\u53ef\u4ee5\u4f7f\u5bb9\u5668\u64cd\u4f5c\u5168\u5e73\u53f0\u81ea\u52a8\u5316\u3002<\/li>\n<li>\u5de5\u4e1a\u7ea7\u4ea4\u4ed8\uff1a\u5236\u5b9a\u5bb9\u5668\u6807\u51c6\u4e00\u5927\u76ee\u6807\uff0c\u5c31\u662f\u4f7f\u8f6f\u4ef6\u5206\u53d1\u53ef\u4ee5\u8fbe\u5230\u5de5\u4e1a\u7ea7\u4ea4\u4ed8\u6210\u4e3a\u73b0\u5b9e<\/li>\n<\/ul>\n<h4>image spec\uff08\u5bb9\u5668\u6807\u51c6\u5305\uff09<\/h4>\n<p>OCI \u5bb9\u5668\u955c\u50cf\u4e3b\u8981\u5305\u62ec\u51e0\u5757\u5185\u5bb9\uff1a<\/p>\n<ul>\n<li>\u6587\u4ef6\u7cfb\u7edf\uff1a\u4ee5 layer \u4fdd\u5b58\u7684\u6587\u4ef6\u7cfb\u7edf\uff0c\u6bcf\u4e2a layer \u4fdd\u5b58\u4e86\u548c\u4e0a\u5c42\u4e4b\u95f4\u53d8\u5316\u7684\u90e8\u5206\uff0clayer \u5e94\u8be5\u4fdd\u5b58\u54ea\u4e9b\u6587\u4ef6\uff0c\u600e\u4e48\u8868\u793a\u589e\u52a0\u3001\u4fee\u6539\u548c\u5220\u9664\u7684\u6587\u4ef6\u7b49<\/li>\n<li>config \u6587\u4ef6\uff1a\u4fdd\u5b58\u4e86\u6587\u4ef6\u7cfb\u7edf\u7684\u5c42\u7ea7\u4fe1\u606f\uff08\u6bcf\u4e2a\u5c42\u7ea7\u7684 hash \u503c\uff0c\u4ee5\u53ca\u5386\u53f2\u4fe1\u606f\uff09\uff0c\u4ee5\u53ca\u5bb9\u5668\u8fd0\u884c\u65f6\u9700\u8981\u7684\u4e00\u4e9b\u4fe1\u606f\uff08\u6bd4\u5982\u73af\u5883\u53d8\u91cf\u3001\u5de5\u4f5c\u76ee\u5f55\u3001\u547d\u4ee4\u53c2\u6570\u3001mount \u5217\u8868\uff09\uff0c\u6307\u5b9a\u4e86\u955c\u50cf\u5728\u67d0\u4e2a\u7279\u5b9a\u5e73\u53f0\u548c\u7cfb\u7edf\u7684\u914d\u7f6e\u3002\u6bd4\u8f83\u63a5\u8fd1\u6211\u4eec\u4f7f\u7528 docker inspect &lt;image_id&gt; \u770b\u5230\u7684\u5185\u5bb9<\/li>\n<li>manifest \u6587\u4ef6\uff1a\u955c\u50cf\u7684 config \u6587\u4ef6\u7d22\u5f15\uff0c\u6709\u54ea\u4e9b layer\uff0c\u989d\u5916\u7684 annotation \u4fe1\u606f\uff0cmanifest \u6587\u4ef6\u4e2d\u4fdd\u5b58\u4e86\u5f88\u591a\u548c\u5f53\u524d\u5e73\u53f0\u6709\u5173\u7684\u4fe1\u606f<\/li>\n<li>index \u6587\u4ef6\uff1a\u53ef\u9009\u7684\u6587\u4ef6\uff0c\u6307\u5411\u4e0d\u540c\u5e73\u53f0\u7684 manifest \u6587\u4ef6\uff0c\u8fd9\u4e2a\u6587\u4ef6\u80fd\u4fdd\u8bc1\u4e00\u4e2a\u955c\u50cf\u53ef\u4ee5\u8de8\u5e73\u53f0\u4f7f\u7528\uff0c\u6bcf\u4e2a\u5e73\u53f0\u62e5\u6709\u4e0d\u540c\u7684 manifest \u6587\u4ef6\uff0c\u4f7f\u7528 index \u4f5c\u4e3a\u7d22\u5f15<\/li>\n<\/ul>\n<h4>runtime spec\uff08\u5bb9\u5668\u8fd0\u884c\u65f6\u548c\u751f\u547d\u5468\u671f\uff09<\/h4>\n<h5>\u5bb9\u5668\u8fd0\u884c\u65f6<\/h5>\n<p>\u5bb9\u5668\u6807\u51c6\u683c\u5f0f\u4e5f\u8981\u6c42\u5bb9\u5668\u628a\u81ea\u8eab\u8fd0\u884c\u65f6\u7684\u72b6\u6001\u6301\u4e45\u5316\u5230\u78c1\u76d8\u4e2d\uff0c\u8fd9\u6837\u4fbf\u4e8e\u5916\u90e8\u7684\u5176\u5b83\u5de5\u5177\u5bf9\u6b64\u4fe1\u606f\u4f7f\u7528\u548c\u6f14\u7ece\u3002\u8be5\u8fd0\u884c\u65f6\u72b6\u6001\u4ee5JSON\u683c\u5f0f\u7f16\u7801\u5b58\u50a8\u3002\u63a8\u8350\u628a\u8fd0\u884c\u65f6\u72b6\u6001\u7684JSON\u6587\u4ef6\u5b58\u50a8\u5728\u4e34\u65f6\u6587\u4ef6\u7cfb\u7edf\u4e2d\u4ee5\u4fbf\u7cfb\u7edf\u91cd\u542f\u540e\u4f1a\u81ea\u52a8\u79fb\u9664\u3002<br \/>\n\u57fa\u4e8eLinux\u5185\u6838\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u8be5\u4fe1\u606f\u5e94\u8be5\u7edf\u4e00\u5730\u5b58\u50a8\u5728\/run\/opencontainer\/containers\u76ee\u5f55\uff0c\u8be5\u76ee\u5f55\u7ed3\u6784\u4e0b\u4ee5\u5bb9\u5668ID\u547d\u540d\u7684\u6587\u4ef6\u5939\uff08\/run\/opencontainer\/containers\/&lt;containerID&gt;\/state.json\uff09\u4e2d\u5b58\u653e\u5bb9\u5668\u7684\u72b6\u6001\u4fe1\u606f\u5e76\u5b9e\u65f6\u66f4\u65b0\u3002\u6709\u4e86\u8fd9\u6837\u9ed8\u8ba4\u7684\u5bb9\u5668\u72b6\u6001\u4fe1\u606f\u5b58\u50a8\u4f4d\u7f6e\u4ee5\u540e\uff0c\u5916\u90e8\u7684\u5e94\u7528\u7a0b\u5e8f\u5c31\u53ef\u4ee5\u5728\u7cfb\u7edf\u4e0a\u7b80\u4fbf\u5730\u627e\u5230\u6240\u6709\u8fd0\u884c\u7740\u7684\u5bb9\u5668\u4e86\u3002<br \/>\nstate.json\u6587\u4ef6\u4e2d\u5305\u542b\u7684\u5177\u4f53\u4fe1\u606f\u9700\u8981\u6709\uff1a<\/p>\n<ul>\n<li>\u7248\u672c\u4fe1\u606f\uff1a\u5b58\u653eOCI\u6807\u51c6\u7684\u5177\u4f53\u7248\u672c\u53f7\u3002<\/li>\n<li>\u5bb9\u5668ID\uff1a\u901a\u5e38\u662f\u4e00\u4e2a\u54c8\u5e0c\u503c\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u6613\u8bfb\u7684\u5b57\u7b26\u4e32\u3002\u5728state.json\u6587\u4ef6\u4e2d\u52a0\u5165\u5bb9\u5668ID\u662f\u4e3a\u4e86\u4fbf\u4e8e\u4e4b\u524d\u63d0\u5230\u7684\u8fd0\u884c\u65f6hooks\u53ea\u9700\u8f7d\u5165state.json\u5c31- &#8211; \u53ef\u4ee5\u5b9a\u4f4d\u5230\u5bb9\u5668\uff0c\u7136\u540e\u68c0\u6d4bstate.json\uff0c\u53d1\u73b0\u6587\u4ef6\u4e0d\u89c1\u4e86\u5c31\u8ba4\u4e3a\u5bb9\u5668\u5173\u505c\uff0c\u518d\u6267\u884c\u76f8\u5e94\u9884\u5b9a\u4e49\u7684\u811a\u672c\u64cd\u4f5c\u3002<\/li>\n<li>PID\uff1a\u5bb9\u5668\u4e2d\u8fd0\u884c\u7684\u9996\u4e2a\u8fdb\u7a0b\u5728\u5bbf\u4e3b\u673a\u4e0a\u7684\u8fdb\u7a0b\u53f7\u3002<\/li>\n<li>\u5bb9\u5668\u6587\u4ef6\u76ee\u5f55\uff1a\u5b58\u653e\u5bb9\u5668rootfs\u53ca\u76f8\u5e94\u914d\u7f6e\u7684\u76ee\u5f55\u3002\u5916\u90e8\u7a0b\u5e8f\u53ea\u9700\u8bfb\u53d6state.json\u5c31\u53ef\u4ee5\u5b9a\u4f4d\u5230\u5bbf\u4e3b\u673a\u4e0a\u7684\u5bb9\u5668\u6587\u4ef6\u76ee\u5f55\u3002<\/li>\n<\/ul>\n<ul>\n<li>\u5bb9\u5668\u521b\u5efa\uff1a\u521b\u5efa\u5305\u62ec\u6587\u4ef6\u7cfb\u7edf\u3001namespaces\u3001cgroups\u3001\u7528\u6237\u6743\u9650\u5728\u5185\u7684\u5404\u9879\u5185\u5bb9\u3002<\/li>\n<li>\u5bb9\u5668\u8fdb\u7a0b\u7684\u542f\u52a8\uff1a\u8fd0\u884c\u5bb9\u5668\u8fdb\u7a0b\uff0c\u8fdb\u7a0b\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5b9a\u4e49\u5728\u7684config.json\u4e2d\uff0cargs\u9879\u3002<\/li>\n<li>\u5bb9\u5668\u6682\u505c\uff1a\u5bb9\u5668\u5b9e\u9645\u4e0a\u4f5c\u4e3a\u8fdb\u7a0b\u53ef\u4ee5\u88ab\u5916\u90e8\u7a0b\u5e8f\u5173\u505c\uff08kill\uff09\uff0c\u7136\u540e\u5bb9\u5668\u6807\u51c6\u89c4\u8303\u5e94\u8be5\u5305\u542b\u5bf9\u5bb9\u5668\u6682\u505c\u4fe1\u53f7\u7684\u6355\u83b7\uff0c\u5e76\u505a\u76f8\u5e94\u8d44\u6e90\u56de\u6536\u7684\u5904\u7406\uff0c\u907f\u514d\u5b64\u513f\u8fdb\u7a0b\u7684\u51fa\u73b0\u3002<\/li>\n<\/ul>\n<h5>\u5bb9\u5668\u751f\u547d\u5468\u671f<\/h5>\n<div>\n<div>\n<div><\/div>\n<div data-width=\\\"1095\\\" data-height=\\\"658\\\"><img src=\\\"https:\/\/upload-images.jianshu.io\/upload_images\/5006907-13faa958890d02c1.jpg?imageMogr2\/auto-orient\/strip|imageView2\/2\/w\/1095\/format\/webp\\\" data-original-src=\\\"\/\/upload-images.jianshu.io\/upload_images\/5006907-13faa958890d02c1.jpg\\\" data-original-width=\\\"1095\\\" data-original-height=\\\"658\\\" data-original-format=\\\"image\/jpeg\\\" data-original-filesize=\\\"72314\\\" data-image-index=\\\"3\\\" \/><\/div>\n<\/div>\n<\/div>\n<ul>\n<li>init \u72b6\u6001\uff1a\u8fd9\u4e2a\u662f\u6211\u81ea\u5df1\u6dfb\u52a0\u7684\u72b6\u6001\uff0c\u5e76\u4e0d\u5728\u6807\u51c6\u4e2d\uff0c\u8868\u793a\u6ca1\u6709\u5bb9\u5668\u5b58\u5728\u7684\u521d\u59cb\u72b6\u6001<\/li>\n<li>creating\uff1a\u4f7f\u7528 create \u547d\u4ee4\u521b\u5efa\u5bb9\u5668\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u79f0\u4e3a\u521b\u5efa\u4e2d\u3002\u521b\u5efa\u5305\u62ec\u6587\u4ef6\u7cfb\u7edf\u3001namespaces\u3001cgroups\u3001\u7528\u6237\u6743\u9650\u5728\u5185\u7684\u5404\u9879\u5185\u5bb9\uff0c<\/li>\n<li>created\uff1a\u5bb9\u5668\u521b\u5efa\u51fa\u6765\uff0c\u4f46\u662f\u8fd8\u6ca1\u6709\u8fd0\u884c\uff0c\u8868\u793a\u955c\u50cf\u548c\u914d\u7f6e\u6ca1\u6709\u9519\u8bef\uff0c\u5bb9\u5668\u80fd\u591f\u8fd0\u884c\u5728\u5f53\u524d\u5e73\u53f0\u3002\u8fdb\u7a0b\u7684\u53ef\u6267\u884c\u6587\u4ef6\u5b9a\u4e49\u5728\u7684config.json\u4e2d\uff0cargs\u9879<\/li>\n<li>running\uff1a\u5bb9\u5668\u7684\u8fd0\u884c\u72b6\u6001\uff0c\u91cc\u9762\u7684\u8fdb\u7a0b\u5904\u4e8e up \u72b6\u6001\uff0c\u6b63\u5728\u6267\u884c\u7528\u6237\u8bbe\u5b9a\u7684\u4efb\u52a1<\/li>\n<li>stopped\uff1a\u5bb9\u5668\u8fd0\u884c\u5b8c\u6210\uff0c\u6216\u8005\u8fd0\u884c\u51fa\u9519\uff0c\u6216\u8005 stop \u547d\u4ee4\u4e4b\u540e\uff0c\u5bb9\u5668\u5904\u4e8e\u6682\u505c\u72b6\u6001\u3002\u8fd9\u4e2a\u72b6\u6001\uff0c\u5bb9\u5668\u8fd8\u6709\u5f88\u591a\u4fe1\u606f\u4fdd\u5b58\u5728\u5e73\u53f0\u4e2d\uff0c\u5e76\u6ca1\u6709\u5b8c\u5168\u88ab\u5220\u9664<\/li>\n<\/ul>\n<h1>CRI OCI\u533a\u522b<\/h1>\n<p>Open Container Initiative\uff0c\u4e5f\u5c31\u662f\u5e38\u8bf4\u7684OCI\uff0c\u662f\u7531\u591a\u5bb6\u516c\u53f8\u5171\u540c\u6210\u7acb\u7684\u9879\u76ee\uff0c\u5e76\u7531linux\u57fa\u91d1\u4f1a\u8fdb\u884c\u7ba1\u7406\uff0c\u81f4\u529b\u4e8econtainer runtime\u7684\u6807\u51c6\u7684\u5236\u5b9a\u548crunc\u7684\u5f00\u53d1\u7b49\u5de5\u4f5c\u3002\u6240\u8c13container runtime\uff0c\u4e3b\u8981\u8d1f\u8d23\u7684\u662f\u5bb9\u5668\u7684\u751f\u547d\u5468\u671f\u7684\u7ba1\u7406\u3002oci\u7684runtime spec\u6807\u51c6\u4e2d\u5bf9\u4e8e\u5bb9\u5668\u7684\u72b6\u6001\u63cf\u8ff0\uff0c\u4ee5\u53ca\u5bf9\u4e8e\u5bb9\u5668\u7684\u521b\u5efa\u3001\u5220\u9664\u3001\u67e5\u770b\u7b49\u64cd\u4f5c\u8fdb\u884c\u4e86\u5b9a\u4e49\u3002<br \/>\n\u5728k8s 1.5\u7248\u672c\u4e4b\u540e\uff0ckubernetes\u63a8\u51fa\u4e86\u81ea\u5df1\u7684\u8fd0\u884c\u65f6\u63a5\u53e3api\u2013CRI(container runtime interface)\u3002cri\u63a5\u53e3\u7684\u63a8\u51fa\uff0c\u9694\u79bb\u4e86\u5404\u4e2a\u5bb9\u5668\u5f15\u64ce\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u800c\u901a\u8fc7\u7edf\u4e00\u7684\u63a5\u53e3\u4e0e\u5404\u4e2a\u5bb9\u5668\u5f15\u64ce\u4e4b\u95f4\u8fdb\u884c\u4e92\u52a8\u3002<br \/>\n\u4e0eoci\u4e0d\u540c\uff0ccri\u4e0ekubernetes\u7684\u6982\u5ff5\u66f4\u52a0\u8d34\u5408\uff0c\u5e76\u7d27\u5bc6\u7ed1\u5b9a\u3002cri\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u5bb9\u5668\u7684\u751f\u547d\u5468\u671f\u7684\u7ba1\u7406\uff0c\u8fd8\u5f15\u5165\u4e86k8s\u4e2dpod\u7684\u6982\u5ff5\uff0c\u5e76\u5b9a\u4e49\u4e86\u7ba1\u7406pod\u7684\u751f\u547d\u5468\u671f\u3002\u5728kubernetes\u4e2d\uff0cpod\u662f\u7531\u4e00\u7ec4\u8fdb\u884c\u4e86\u8d44\u6e90\u9650\u5236\u7684\uff0c\u5728\u9694\u79bb\u73af\u5883\u4e2d\u7684\u5bb9\u5668\u7ec4\u6210\u3002\u800c\u8fd9\u4e2a\u9694\u79bb\u73af\u5883\uff0c\u79f0\u4e4b\u4e3aPodSandbox\u3002\u5728cri\u5f00\u59cb\u4e4b\u521d\uff0c\u4e3b\u8981\u662f\u652f\u6301docker\u548crkt\u4e24\u79cd\u3002\u5176\u4e2dkubelet\u662f\u901a\u8fc7cri\u63a5\u53e3\uff0c\u8c03\u7528docker-shim\uff0c\u5e76\u8fdb\u4e00\u6b65\u8c03\u7528docker api\u5b9e\u73b0\u7684\u3002<br \/>\n\u540e\u6765\uff0cdocker\u72ec\u7acb\u51fa\u6765\u4e86containerd,kubernetes\u4e5f\u987a\u5e94\u6f6e\u6d41\uff0c\u5b75\u5316\u4e86cri-containerd\u9879\u76ee\uff0c\u7528\u4ee5\u5c06containerd\u63a5\u5165\u5230cri\u7684\u6807\u51c6\u4e2d\u3002<br \/>\n\u4e3a\u4e86\u8fdb\u4e00\u6b65\u4e0eoci\u8fdb\u884c\u517c\u5bb9\uff0ckubernetes\u8fd8\u5b75\u5316\u4e86cri-o\uff0c\u6210\u4e3a\u4e86\u67b6\u8bbe\u5728cri\u548coci\u4e4b\u95f4\u7684\u4e00\u5ea7\u6865\u6881\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u65b9\u4fbf\u66f4\u591a\u7b26\u5408oci\u6807\u51c6\u7684\u5bb9\u5668\u8fd0\u884c\u65f6\uff0c\u63a5\u5165kubernetes\u8fdb\u884c\u96c6\u6210\u4f7f\u7528\u3002\u53ef\u4ee5\u9884\u89c1\u5230\uff0c\u901a\u8fc7cri-o\uff0ckubernetes\u5728\u4f7f\u7528\u7684\u517c\u5bb9\u6027\u548c\u5e7f\u6cdb\u6027\u4e0a\u5c06\u4f1a\u5f97\u5230\u8fdb\u4e00\u6b65\u52a0\u5f3a<\/p>\n<div>\n<div>\n<div><\/div>\n<div data-width=\\\"1704\\\" data-height=\\\"1071\\\"><img src=\\\"https:\/\/upload-images.jianshu.io\/upload_images\/5006907-6472e8c87e27c5c6.png?imageMogr2\/auto-orient\/strip|imageView2\/2\/w\/1200\/format\/webp\\\" data-original-src=\\\"\/\/upload-images.jianshu.io\/upload_images\/5006907-6472e8c87e27c5c6.png\\\" data-original-width=\\\"1704\\\" data-original-height=\\\"1071\\\" data-original-format=\\\"image\/png\\\" data-original-filesize=\\\"27901\\\" data-image-index=\\\"4\\\" \/><\/div>\n<\/div>\n<\/div>\n<\/article>\n","protected":false},"excerpt":{"rendered":"<p>CRI &#8211; Container Runtime Interface\uff08\u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3\uff09 CRI\u4e2d\u5b9a\u4e49 &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"http:\/\/www.weijing.co\/?p=1894\"> <span class=\"screen-reader-text\">\u5bb9\u5668\u5f00\u653e\u63a5\u53e3\u89c4\u8303\uff08CRI OCI CNI\uff09<\/span> \u67e5\u770b\u5168\u6587 &raquo;<\/a><\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":""},"categories":[108,104,123],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"mailpoet_newsletter_max":false,"woocommerce_thumbnail":false,"woocommerce_single":false,"woocommerce_gallery_thumbnail":false,"shop_catalog":false,"shop_single":false,"shop_thumbnail":false},"uagb_author_info":{"display_name":"weijing","author_link":"http:\/\/www.weijing.co\/?author=4"},"uagb_comment_info":0,"uagb_excerpt":"CRI &#8211; Container Runtime Interface\uff08\u5bb9\u5668\u8fd0\u884c\u65f6\u63a5\u53e3\uff09 CRI\u4e2d\u5b9a\u4e49&hellip;","_links":{"self":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/1894"}],"collection":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1894"}],"version-history":[{"count":0,"href":"http:\/\/www.weijing.co\/index.php?rest_route=\/wp\/v2\/posts\/1894\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1894"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1894"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.weijing.co\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1894"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}