{"id":500,"date":"2019-12-12T14:18:12","date_gmt":"2019-12-12T06:18:12","guid":{"rendered":"https:\/\/www.myway5.com\/?p=500"},"modified":"2023-07-05T21:37:15","modified_gmt":"2023-07-05T13:37:15","slug":"kubernetes-pod","status":"publish","type":"post","link":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/","title":{"rendered":"Kubernetes Pod \u89e3\u6790"},"content":{"rendered":"<h2>pod \u57fa\u7840\u6982\u5ff5<\/h2>\n<p>\u5728 Kubernetes \u4e2d\uff0c Pod \u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u5b83\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u7ec4\u6210\uff0c\u8fd9\u4e9b\u5bb9\u5668\u5171\u4eab\u5b58\u50a8\u3001\u7f51\u7edc\u3001\u8fdb\u7a0b\u7a7a\u95f4\uff0c\u4ee5\u53ca\u53ef\u4ee5\u4f7f\u7528\u8fdb\u7a0b\u95f4\u901a\u4fe1\u3002<\/p>\n<p>Pod \u662f\u96c6\u7fa4\u4e2d\u6700\u5c0f\u7684\u8c03\u5ea6\u5355\u4f4d\uff0c\u5982\u679c\u628a Kubernetes \u96c6\u7fa4\u6bd4\u4f5c\u64cd\u4f5c\u7cfb\u7edf\uff0c\u90a3\u4e48 Pod \u5219\u662f\u4e00\u4e2a\u8fdb\u7a0b\u3002\u4e00\u4e2a Pod \u88ab\u521b\u5efa\u51fa\u6765\u4e4b\u540e\uff0c\u5b83\u4f1a\u88ab\u8c03\u5ea6\u5230\u96c6\u7fa4\u4e2d\u7684\u67d0\u4e00\u4e2a\u8282\u70b9\u4e0a\u5f00\u59cb\u8fd0\u884c\uff0cPod \u4e2d\u7684 Container \u90fd\u4f1a\u5728\u8be5\u8282\u70b9\u4e0a\u542f\u52a8\u3002<\/p>\n<p>Pod \u662f\u77ed\u6682\u7684\uff0c\u5c31\u8ddf\u8fdb\u7a0b\u4e00\u6837\uff0c\u5728\u88ab\u521b\u5efa\u4e4b\u540e\u53ef\u80fd\u4f1a\u968f\u65f6\u88ab\u7ec8\u6b62\u3002\u4f46\u662f Kubernetes \u4f1a\u6839\u636e\u9700\u6c42\u6765\u7684\u53ca\u65f6\u7684\u91cd\u65b0\u521b\u5efa\u4e00\u4e2a Pod\uff0c\u6240\u4ee5\u5355\u72ec\u4ece Pod \u7684\u5c42\u9762\u6765\u8bf4\uff0c\u5b83\u5e94\u8be5\u662f\u4e00\u4e2a\u65e0\u72b6\u6001\u7684\u5e94\u7528\u3002<\/p>\n<p>\u96c6\u7fa4\u4e2d\u7684\u6bcf\u4e2a Pod \u90fd\u4f1a\u6709\u552f\u4e00\u7684 ID (UID)\uff0c\u8fd9\u8ddf\u8fdb\u7a0b\u7684\u8fdb\u7a0b\u53f7\u662f\u552f\u4e00\u7684\u4e00\u6837\u3002<\/p>\n<h2>\u5171\u4eab\u547d\u540d\u7a7a\u95f4<\/h2>\n<p>\u8fd9\u91cc\u4ee5 docker \u5728 linux \u4e0b\u7684\u5b9e\u73b0\u4e3a\u4f8b\uff0cdocker \u4e3b\u8981\u4f7f\u7528\u4e86 linux namespace \u505a\u7684\u8d44\u6e90\u9694\u79bb\u3002\u5728 pod \u4e2d\uff0c\u6240\u6709\u7684 docker \u5bb9\u5668\u90fd\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4e2a network, ipc, pid\u547d\u540d\u7a7a\u95f4\uff0c\u5e76\u4e14\u53ef\u4ee5\u901a\u8fc7\u6302\u8f7d\u540c\u4e00\u4e2a\u5377\u7684\u65b9\u5f0f\u6765\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u53ea\u6709 network \u8fd9\u4e2a\u547d\u540d\u7a7a\u95f4\u662f\u5f00\u542f\u7684\uff0c\u5176\u4ed6\u7684\u9700\u8981\u901a\u8fc7 <code>shareProcessNamespace<\/code>\u3001 <code>SYS_PTRACE<\/code> \u548c <code>emptyDir<\/code> \u7b49\u5b57\u6bb5\u6765\u5f00\u542f\u3002<\/p>\n<p>\u4e3a\u4e86\u8bf4\u660e\uff0c\u53ef\u4ee5\u5728 kubernetes \u96c6\u7fa4\u4e2d\u521b\u5efa\u4e0b\u9762\u8fd9\u4e2a pod<\/p>\n<pre><code class=\"line-numbers\">apiVersion: v1\nkind: Pod\nmetadata:\n  name: nginx\nspec:\n  shareProcessNamespace: true\n  containers:\n  - name: nginx\n    image: nginx\n    volumeMounts:\n      - mountPath: \/cache\n        name: cache-volume\n  - name: shell\n    image: busybox\n    volumeMounts:\n      - mountPath: \/cache\n        name: cache-volume\n    securityContext:\n      capabilities:\n        add:\n        - SYS_PTRACE\n    stdin: true\n    tty: true\n  volumes:\n  - name: cache-volume\n    emptyDir: {}\n<\/code><\/pre>\n<p>\u4e0a\u9762\u521b\u5efa\u7684 Pod \u6709\u4e24\u4e2a\u5bb9\u5668\uff0c\u4e00\u4e2a\u662f nginx\uff0c\u53e6\u4e00\u4e2a\u662f shell\u3002\u6211\u4eec\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u8fdb\u5165\u5230 shell \u5bb9\u5668\u4e2d\u3002<\/p>\n<pre><code class=\"line-numbers\">kubectl exec -it nginx -c shell sh\n<\/code><\/pre>\n<h3>network<\/h3>\n<p>\u4e3a\u4e86\u9a8c\u8bc1\u540c\u4e00\u4e2a Pod \u4e0b network \u662f\u5171\u4eab\u7684\uff0c\u53ef\u4ee5\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9a8c\u8bc1<\/p>\n<pre><code class=\"line-numbers\">$ wget localhost\nConnecting to localhost (127.0.0.1:80)\nsaving to 'index.html'\nindex.html           100% |******************************************|   612  0:00:00 ETA\n'index.html' saved\n<\/code><\/pre>\n<p>\u5f88\u660e\u663e\uff0c\u8fd9\u91cc\u7684 localhost \u6307\u5411\u4e86 nginx \u5bb9\u5668\u3002<\/p>\n<h3>pid<\/h3>\n<pre><code class=\"line-numbers\">$ ps -el\nPID   USER     TIME  COMMAND\n    1 root      0:00 \/pause\n    6 root      0:00 nginx: master process nginx -g daemon off;\n   11 101       0:00 nginx: worker process\n   12 root      0:00 sh\n   20 root      0:00 sh\n   26 root      0:00 ps\n<\/code><\/pre>\n<p>\u5728 shell \u5bb9\u5668\u4e2d\u67e5\u770b\u8fdb\u7a0b\u53ef\u4ee5\u770b\u5230 \/pause \u548c nginx \u7b49\u8fdb\u7a0b\u3002\u56e0\u4e3a\u5171\u4eab\u4e86 pid \u547d\u540d\u7a7a\u95f4\uff0c\u6240\u4ee5\u53ef\u4ee5\u770b\u5230\u5176\u4ed6\u5bb9\u5668\u7684\u8fdb\u7a0b\u3002\u8fd9\u91cc\u7684 pause \u662f\u4e00\u4e2a\u5f88\u7279\u6b8a\u7684\u8fdb\u7a0b\uff0c\u5728\u540e\u6587\u7ae0\u4f1a\u5355\u72ec\u89e3\u91ca\u3002<\/p>\n<h3>ipc<\/h3>\n<pre><code class=\"line-numbers\">$ kill -9 11\n$ ps -el\nPID   USER     TIME  COMMAND\n    1 root      0:00 \/pause\n    6 root      0:00 nginx: master process nginx -g daemon off;\n   12 root      0:00 sh\n   20 root      0:00 sh\n   29 101       0:00 nginx: worker process\n   30 root      0:00 ps -el\n<\/code><\/pre>\n<p>\u63a5\u7740\u4e0a\u9762\u7684\u547d\u4ee4\uff0c\u6211\u4eec\u6740\u6b7b\u4e86 nginx \u7684 worker \u8fdb\u7a0b\uff0cnginx master \u8fdb\u7a0b\u53c8\u91cd\u542f\u4e86 worker\uff0c\u91cd\u542f\u540e\u7684 worker PID \u662f 29\u3002\u53ef\u4ee5\u5728 shell \u5bb9\u5668\u4e2d\u4f7f\u7528\u4fe1\u53f7\u6740\u6b7b nginx \u4e2d\u7684\u8fdb\u7a0b\uff0c\u8bf4\u660e IPC \u547d\u540d\u7a7a\u95f4\u662f\u5171\u4eab\u7684\u3002<\/p>\n<h3>shared volume<\/h3>\n<pre><code class=\"line-numbers\">$ cd cache\n$ touch test\n$ kubectl exec -it nginx -c nginx sh\n$ ls \/cache\ntest\n<\/code><\/pre>\n<p>\u6211\u4eec\u5728 shell \u5bb9\u5668\u4e2d cache \u6587\u4ef6\u5939\u4e0b\u521b\u5efa\u4e86\u6587\u4ef6 test, \u5728 nginx \u5bb9\u5668\u4e2d\u4e5f\u80fd\u770b\u5230\uff0c\u8bf4\u660e\u4e24\u4e2a\u5bb9\u5668\u53ef\u4ee5\u5171\u4eab\u6587\u4ef6\u7cfb\u7edf\u7684\u67d0\u4e9b\u76ee\u5f55\u3002<\/p>\n<h2>\u5bb9\u5668\u63a2\u9488<\/h2>\n<p>\u4e4b\u6240\u4ee5\u7279\u5730\u63d0\u5230\u5bb9\u5668\u63a2\u9488\u662f\u56e0\u4e3a\u5bb9\u5668\u63a2\u9488\u662f\u4e00\u4e2a\u975e\u5e38\u597d\u7684\u68c0\u67e5\u670d\u52a1\u662f\u5426\u6b63\u786e\u8fd0\u884c\u7684\u65b9\u5f0f\u3002<\/p>\n<p>TODO: \u51e0\u79cd\u63a2\u9488\u7684\u4f7f\u7528\u573a\u666f\u548c<\/p>\n<p>\u63a2\u9488\u662f\u7531 kubelet \u5468\u671f\u6027\u5bf9\u5bb9\u5668\u6267\u884c\u7684\u8bca\u65ad\u63aa\u65bd\u3002kubernetes \u63d0\u4f9b\u4e86\u4e09\u79cd\u65b9\u5f0f:<\/p>\n<ul>\n<li>ExecAction: \u5728\u5bb9\u5668\u4e2d\u6267\u884c\u547d\u4ee4\uff0c\u5982\u679c\u547d\u4ee4\u7684 exit code \u662f 0 \u5219\u4ee3\u8868\u6210\u529f\u3002<\/li>\n<li>TCPSocketAction: \u5728\u5bb9\u5668\u7684ip\u548c\u7aef\u53e3\u4e0a\u6267\u884c tcp \u8fde\u63a5\u68c0\u67e5\uff0c\u5982\u679c\u7aef\u53e3\u662f\u6253\u5f00\u7684\u5219\u8868\u660e\u8bca\u65ad\u6210\u529f\u3002<\/li>\n<li>HTTPGetAction: \u5728\u5bb9\u5668\u7684ip\u548c\u5236\u5b9a\u7aef\u53e3\u548c\u8def\u5f84\u4e0a\u6267\u884c\uff0c\u5982\u679c\u8fd4\u56de\u7684\u72b6\u6001\u7801\u5927\u4e8e\u7b49\u4e8e 200 ,\u5c0f\u4e8e400\u5c31\u8868\u660e\u6210\u529f\u3002<\/li>\n<\/ul>\n<p>\u76f4\u5230 kubernetes v1.16 \u6b62\uff0c\u5171\u6709\u4e09\u79cd\u63a2\u9488\u53ef\u4ee5\u4f7f\u7528\uff0c\u5206\u522b\u662f livenessProbe, readinessProbe, startupProbe.<\/p>\n<ul>\n<li><code>livenessProbe<\/code>: \u68c0\u67e5\u5bb9\u5668\u662f\u5426\u5728\u8fd0\u884c\uff0c\u5982\u679c liveness \u63a2\u9488\u5931\u8d25\uff0ckubelet \u4f1a\u6740\u6b7b\u8fd9\u4e2a\u5bb9\u5668\uff0c\u8fd9\u4e2a\u5bb9\u5668\u4f1a\u9075\u5faa\u5b83\u7684\u91cd\u542f\u7b56\u7565\u3002\u5982\u679c\u4e00\u4e2a\u5bb9\u5668\u6ca1\u6709\u63d0\u4f9b liveness \u63a2\u9488\uff0c\u9ed8\u8ba4\u72b6\u6001\u662f <code>Success<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p><code>readinessProbe<\/code>: \u8868\u660e\u5bb9\u5668\u662f\u5426\u51c6\u5907\u597d\u63a5\u6536\u8bf7\u6c42\u4e86\u3002\u5982\u679c readiness \u63a2\u9488\u5931\u8d25\uff0cendpoints \u63a7\u5236\u5668\u4f1a\u4ece\u7b26\u5408\u8fd9\u4e2a Pod \u7684\u6240\u6709 service \u7684 endpoint \u5217\u8868\u4e2d\u79fb\u9664\u8be5 Pod\u3002\u9ed8\u8ba4\u72b6\u6001\u662f <code>Failure<\/code>\u3002\u5982\u679c\u5bb9\u5668\u6ca1\u6709\u63d0\u4f9b readiness \u63a2\u9488\uff0c\u9ed8\u8ba4\u72b6\u6001\u5c31\u662f <code>Success<\/code>\u3002<\/p>\n<\/li>\n<li>\n<p><code>startupProbe<\/code>: \u8868\u660e\u5bb9\u5668\u4e2d\u7684\u5e94\u7528\u662f\u5426\u542f\u52a8\u5b8c\u6210\u3002\u5982\u679c\u63d0\u4f9b\u4e86 startup \u63a2\u9488\uff0c\u5176\u4ed6\u7684\u63a2\u9488\u90fd\u88ab\u7981\u7528\u76f4\u5230 startup \u63a2\u9488\u6210\u529f\u3002\u5982\u679c startup \u63a2\u9488\u5931\u8d25\uff0ckuberlet \u6740\u6b7b\u5bb9\u5668\uff0c\u5bb9\u5668\u4f1a\u9075\u5faa\u5b83\u7684\u91cd\u542f\u7b56\u7565\u3002\u662f\u5426\u5bb9\u5668\u6ca1\u6709\u63d0\u4f9b startup \u63a2\u9488\uff0c\u9ed8\u8ba4\u72b6\u6001\u662f <code>Success<\/code>\u3002<\/p>\n<\/li>\n<\/ul>\n<h2>init container<\/h2>\n<p>\u6211\u4eec\u90fd\u77e5\u9053 Pod \u53ef\u4ee5\u6709\u591a\u4e2a\u5bb9\u5668\uff0c\u5176\u4e2d init \u5bb9\u5668\u662f\u6bd4\u8f83\u7279\u6b8a\u7684\u4e00\u4e2a\uff0c\u5b83\u7531 spec.initContainers \u6307\u5b9a\uff0c\u4e0e\u666e\u901a\u5bb9\u5668\u4e0d\u540c\u7684\u662f\uff0c\u53ea\u6709\u5728 init \u5bb9\u5668\u8fd0\u884c\u5b8c\u6210\u4e4b\u540e\uff0cKubernetes \u624d\u4f1a\u521d\u59cb\u5316 Pod \u548c\u8fd0\u884c\u5e94\u7528\u5bb9\u5668\u3002<\/p>\n<p>\u5b9e\u9645\u5e94\u7528\u4e2d\uff0cinit \u5bb9\u5668\u7684\u804c\u8d23\u57fa\u672c\u4e0a\u90fd\u662f\u548c\u5b83\u540d\u5b57\u63cf\u8ff0\u7684\u4e00\u6837\uff0c\u7528\u6765\u505a\u521d\u59cb\u5316\u7528\u3002\u6bd4\u5982\u5728 argo \u8fd9\u4e2a\u5de5\u4f5c\u6d41\u8c03\u5ea6\u5e94\u7528\u4e2d\uff0c\u5b83\u4f1a\u4e3a\u6bcf\u4e2a\u8c03\u5ea6\u7684 Pod \u521d\u59cb\u5316\u4e00\u4e2a init \u5bb9\u5668\uff0c\u7528\u6765\u8f7d\u5165\u8be5\u6b65\u9aa4\u9700\u8981\u4f7f\u7528\u7684\u6587\u4ef6\u8d44\u6e90\u7b49\u7b49\u3002<\/p>\n<h2>pause container<\/h2>\n<p>\u5728\u4e0a\u9762\u63d0\u5230\u4e86 pid namespace \u5171\u4eab\u4e2d\uff0c\u6709\u4e00\u4e2a PID \u4e3a 1 \u7684 Pause \u8fdb\u7a0b\uff0c\u8fd9\u5c31\u662f\u73b0\u5728\u63d0\u5230\u7684 pause container\uff0cpause container \u5bf9 kubernetes \u7528\u6237\u662f\u4e0d\u611f\u77e5\u7684\u3002\u4f46\u662f\u6211\u4eec\u5728 kubernetes \u8282\u70b9\u4e0a\u4f7f\u7528 <code>docker ps<\/code>\u6765\u67e5\u770b\uff0c\u4f1a\u53d1\u73b0\u5f88\u591a\u7684 pause \u5bb9\u5668\u3002pause \u5bb9\u5668\u7684\u4f5c\u7528\u4e3b\u8981\u6709\u4e24\u70b9\uff1a<\/p>\n<ul>\n<li>\u5728 pod \u4e2d\u4f5c\u4e3a linux namespace \u5171\u4eab\u7684\u57fa\u7840\u5bb9\u5668<\/li>\n<li>\u5728 PID namespace \u5171\u4eab\u7684\u524d\u63d0\u4e0b\uff0c\u4f5c\u4e3a\u6bcf\u4e2a pod \u4e2d\u7684PID 1\uff0c\u7136\u540e\u56de\u6536\u50f5\u5c38\u8fdb\u7a0b<\/li>\n<\/ul>\n<p>\u4e3a\u4e86\u7814\u7a76pause\u7684\u4f5c\u7528\uff0c\u53ef\u4ee5\u5728\u7535\u8111\u4e0a\u6267\u884c\u4ee5\u4e0b\u7684\u547d\u4ee4\uff1a<\/p>\n<pre><code class=\"line-numbers\">docker run -d --ipc=shareable --name pause -p 8080:80 warrior\/pause-amd64:3.0\n\ndocker run -d --name nginx -v \/home\/jiang\/projects\/testk8s\/nginx.conf:\/etc\/nginx\/nginx.conf --net=container:pause --ipc=container:pause --pid=container:pause nginx\n\ndocker run -d --name ghost --net=container:pause --ipc=container:pause --pid=container:pause ghost\n<\/code><\/pre>\n<p>nginx.conf \u5982\u4e0b:<\/p>\n<pre><code class=\"line-numbers\">error_log stderr;\nevents {worker_connections 1024;}\nhttp {\n    access_log \/dev\/stdout combined;\n    server {\n        listen 80 default_server;\n        server_name example.com;\n        location \/ {\n            proxy_pass http:\/\/127.0.0.1:2368;\n        }\n    }\n}\n<\/code><\/pre>\n<p>\u6211\u4eec\u9996\u5148\u542f\u52a8\u4e86\u4e00\u4e2a pause \u5bb9\u5668\uff0c\u5e76\u4e14\u5f00\u59cb\u4e86 ipc \u7684\u5171\u4eab\u3002\u7136\u540e\u53c8\u542f\u52a8\u4e86 nginx \u548c ghost \u5bb9\u5668\uff0c\u5e76\u4e14\u8fd9\u4e24\u4e2a\u5bb9\u5668\u90fd\u52a0\u5165\u4e86 pause \u7684network\u3001ipc\u548cpid\u547d\u540d\u7a7a\u95f4\u3002<\/p>\n<p>\u5728\u6d4f\u89c8\u5668\u4e2d\u6253\u5f00\u5730\u5740: <code>http:\/\/localhost:8080<\/code>, \u53d1\u73b0\u6253\u5f00\u4e86 ghost \u535a\u5ba2\u7f51\u9875\u3002\u6211\u4eec\u5728\u5bb9\u5668 pause \u4e2d\u5f00\u542f\u7684 8080 \u7aef\u53e3\uff0c\u7136\u540e\u7ecf\u8fc7 nginx \u5bb9\u5668\u4ee3\u7406\u5230\u4e86 ghost \u5bb9\u5668\u3002\u6211\u4eec\u7684\u5e94\u7528\u5bb9\u5668 pause \u5bb9\u5668\u5b8c\u6210\u4e86\u547d\u540d\u7a7a\u95f4\u7684\u5171\u4eab\u3002<\/p>\n<p>\u6211\u4eec\u518d\u6765\u770b\u4e00\u4e0b pause \u7684\u4ee3\u7801:<\/p>\n<pre><code class=\"line-numbers\">\/*\nCopyright 2016 The Kubernetes Authors.\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n    http:\/\/www.apache.org\/licenses\/LICENSE-2.0\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n*\/\n\n#include &lt;signal.h&gt;\n#include &lt;stdio.h&gt;\n#include &lt;stdlib.h&gt;\n#include &lt;sys\/types.h&gt;\n#include &lt;sys\/wait.h&gt;\n#include &lt;unistd.h&gt;\n\nstatic void sigdown(int signo) {\n  psignal(signo, \"Shutting down, got signal\");\n  exit(0);\n}\n\nstatic void sigreap(int signo) {\n  while (waitpid(-1, NULL, WNOHANG) &gt; 0);\n}\n\nint main() {\n  if (getpid() != 1)\n    \/* Not an error because pause sees use outside of infra containers. *\/\n    fprintf(stderr, \"Warning: pause should be the first process\\n\");\n\n  if (sigaction(SIGINT, &amp;(struct sigaction){.sa_handler = sigdown}, NULL) &lt; 0)\n    return 1;\n  if (sigaction(SIGTERM, &amp;(struct sigaction){.sa_handler = sigdown}, NULL) &lt; 0)\n    return 2;\n  if (sigaction(SIGCHLD, &amp;(struct sigaction){.sa_handler = sigreap,\n                                             .sa_flags = SA_NOCLDSTOP},\n                NULL) &lt; 0)\n    return 3;\n\n  for (;;)\n    pause();\n  fprintf(stderr, \"Error: infinite loop terminated\\n\");\n  return 42;\n}\n<\/code><\/pre>\n<p>\u8fd9\u6bb5\u4ee3\u7801\u5728\u76d1\u542c\u4e86\u4e09\u4e2a\u4fe1\u53f7\u91cf\uff0c\u5728 <code>SIGINT<\/code> \u548c\u3000<code>SIGTERM<\/code>\u3000\u65f6\u8c03\u7528 <code>sigdown()<\/code> \u6765\u9000\u51fa\u3002\u5728\u63a5\u6536\u5230\u3000<code>SIGCHLD<\/code> \u4fe1\u53f7\u65f6\u4f7f\u7528 <code>waitpid<\/code>\uff0c\u56e0\u4e3a pause \u8fdb\u7a0b\u7684 PID \u662f\uff11\uff0c\u6240\u4ee5\u6240\u6709\u7684\u50f5\u5c38\u8fdb\u7a0b\u90fd\u4f1a\u88ab\u6302\u5230 pause \u8fdb\u7a0b\u4e4b\u4e0b\uff0c\u56e0\u6b64 waitpid \u53ef\u4ee5\u56de\u6536\u50f5\u5c38\u8fdb\u7a0b\u3002<\/p>\n<h2>multi containers design pattern<\/h2>\n<p>\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0cPod \u5f80\u5f80\u53ea\u6709\u4e00\u4e2a\u5bb9\u5668\uff0c\u56e0\u4e3a\u4e00\u4e2a Pod \u7684\u804c\u8d23\u662f\u552f\u4e00\u7684\u3002\u4f46\u662f\u540c\u6837\u7684\uff0c\u4e5f\u6709\u4e00\u4e9b\u503c\u5f97\u501f\u9274\u7684\u591a\u5bb9\u5668\u8bbe\u8ba1\u6a21\u5f0f\u3002<\/p>\n<p>\u5e38\u7528\u7684\u6a21\u5f0f\u6709\u4e09\u79cd: sidecar, adapter, ambassador, \u4e0b\u56fe\u662f\u5e38\u89c1\u7684\u4e09\u79cd\u8bbe\u8ba1\u6a21\u5f0f\u56fe\uff0c\u56fe\u7247\u6765\u6e90\u4e8e\u7f51\u7edc:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png\" alt=\"multi container pod design\" \/><\/p>\n<h3>sidecar \u6a21\u5f0f<\/h3>\n<p>\u5728 sidecar \u6a21\u5f0f\u4e2d\uff0c\u901a\u5e38\u6709\u4e00\u4e2a\u4e3b\u8981\u7684\u5bb9\u5668A&#8211;\u6bd4\u5982\u6211\u4eec\u7684 web \u5e94\u7528\uff0c\u7136\u540e\u6709\u53e6\u5916\u4e00\u4e2a\u91cd\u8981\u7684\u5bb9\u5668B\uff0c\u8d1f\u8d23\u5904\u7406 A \u5bb9\u5668\u7684\u4e00\u4e9b\u529f\u80fd\uff0c\u4f46\u662f B \u5bb9\u5668\u53c8\u4e0d\u662f\u5fc5\u987b\u7684\u3002\u8fd9\u4e2a B \u5bb9\u5668\u6211\u4eec\u901a\u5e38\u79f0\u5b83\u4e3a sidecar \u5bb9\u5668\u3002<\/p>\n<p>\u5e38\u89c1\u7684 sidecar \u5bb9\u5668\u6709 \u65e5\u5fd7\uff0c\u540c\u6b65\u670d\u52a1\uff0c\u76d1\u63a7\u7b49\u804c\u8d23\u3002\u5f53\u5e94\u7528\u5bb9\u5668\u4e0d\u5728\u8fd0\u884c\u65f6\uff0c\u65e5\u5fd7\u5bb9\u5668\u7684\u8fd0\u884c\u662f\u6ca1\u6709\u610f\u4e49\u7684\uff0c\u6240\u4ee5\u6211\u4eec\u901a\u5e38\u4f1a\u521b\u5efa\u4e00\u4e2a Pod \u5305\u542b\u4e3b\u8981\u7684\u5bb9\u5668\u548c\u4e00\u4e2a sidecar \u5bb9\u5668\uff0c\u6765\u534f\u540c\u5de5\u4f5c\u3002\u8fd9\u6837\u7684\u597d\u5904\u5c31\u662f\u51cf\u5c11\u5e94\u7528\u5bb9\u5668\u7684\u529f\u80fd\u9700\u6c42\uff0c\u5c06\u901a\u7528\u7684\u529f\u80fd\u4ea4\u7ed9 sidecar \u5bb9\u5668\u53bb\u6267\u884c\uff0c\u800c\u53c8\u4e0d\u4f1a\u4fb5\u5165\u5e94\u7528\u5bb9\u5668\u3002<\/p>\n<h3>adapter \u6a21\u5f0f<\/h3>\n<p>adapter \u6a21\u5f0f\u5c31\u662f\u7a0b\u5e8f\u8bbe\u8ba1\u4e2d\u5e38\u7528\u7684\u9002\u914d\u5668\u6a21\u5f0f\uff0c\u8d1f\u8d23\u5c06\u5e94\u7528\u5bb9\u5668\u4e2d\u4e00\u4e9b\u4e0d\u517c\u5bb9\u7684\u529f\u80fd\u8c03\u6574\u6210\u517c\u5bb9\u7684\u683c\u5f0f\u3002\u6bd4\u5982\u4e00\u4e2a\u5927\u578b\u7cfb\u7edf\u4e2d\u6709\u5f88\u591a\u5c0f\u7684\u7cfb\u7edf\uff0c\u6bcf\u4e2a\u7cfb\u7edf\u8f93\u51fa\u7684\u65e5\u5fd7\u683c\u5f0f\u90fd\u4e0d\u540c\u3002\u800c\u6211\u4eec\u7684\u7edf\u4e00\u76d1\u63a7\u7cfb\u7edf\u53ea\u63a5\u53d7\u4e00\u79cd\u65e5\u5fd7\u683c\u5f0f\u3002\u8fd9\u65f6\u5019\u5c31\u53ef\u4ee5\u4f7f\u7528 adapter \u6a21\u5f0f\u5728 Pod \u7684\u52a0\u5165\u4e00\u4e2a\u8d1f\u8d23\u9002\u914d\u7684\u5bb9\u5668\uff0c\u5c06\u5404\u79cd\u683c\u5f0f\u7684\u65e5\u5fd7\u8c03\u6574\u6210\u76f8\u540c\u7684\u7edf\u4e00\u53d1\u9001\u7ed9\u65e5\u5fd7\u7cfb\u7edf\u3002<\/p>\n<h3>ambassador \u6a21\u5f0f<\/h3>\n<p>ambassador \u6a21\u5f0f\u5e38\u7528\u6765\u5c06\u5e94\u7528\u5bb9\u5668\u8fde\u63a5\u5230\u5bb9\u5668\u4e4b\u5916\u7684\u7f51\u7edc\u3002\u6bd4\u5982\u6570\u636e\u5e93\uff0c\u6211\u4eec\u7684\u5e94\u7528\u5bb9\u5668\u53ea\u8d1f\u8d23\u8fde\u63a5 localhost \u7684\u5730\u5740\uff0c\u7136\u540e\u7531 ambassador \u5bb9\u5668\u5224\u65ad\u5f53\u524d\u7684\u73af\u5883\uff0c\u5c06\u5e94\u7528\u5bb9\u5668\u7684\u6570\u636e\u5e93\u8bf7\u6c42\u4ee3\u7406\u5230\u4e0d\u540c\u7684\u6570\u636e\u5e93\u4e0a\u3002\u8fd9\u6837\uff0c\u6211\u4eec\u5728\u5f00\u53d1\u73af\u5883\uff0c\u6d4b\u8bd5\u73af\u5883\uff0c\u751f\u4ea7\u73af\u5883\u90fd\u53ea\u9700\u8981\u4e00\u5957\u914d\u7f6e\u3002<\/p>\n<h2>pod lifecycle<\/h2>\n<p>pod \u7684\u72b6\u6001\u5305\u542b\u4e00\u4e2a phase \u5c5e\u6027\uff0c\u8fd9\u4e2a\u5c5e\u6027\u7528\u6765\u63cf\u8ff0\u5f53\u524d pod \u7684\u72b6\u6001\uff0c\u53ef\u80fd\u7684\u503c\u6709:<\/p>\n<ul>\n<li>Pending: Pod \u5df2\u7ecf\u88ab Kubernetes \u7cfb\u7edf\u63a5\u53d7\uff0c\u4f46\u662f\u6709\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u955c\u50cf\u5c1a\u672a\u521b\u5efa\u3002\u7b49\u5f85\u65f6\u95f4\u5305\u62ec\u8c03\u5ea6 Pod \u7684\u65f6\u95f4\u548c\u901a\u8fc7\u7f51\u7edc\u4e0b\u8f7d\u955c\u50cf\u7684\u65f6\u95f4\u3002<\/li>\n<li>Running: Pod \u5df2\u7ecf\u7ed1\u5b9a\u5230\u4e00\u4e2a\u8282\u70b9\u4e0a\uff0cPod \u4e2d\u6240\u6709\u7684\u5bb9\u5668\u90fd\u5df2\u7ecf\u88ab\u521b\u5efa\uff0c\u81f3\u5c11\u6709\u4e00\u4e2a\u5bb9\u5668\u6b63\u5728\u8fd0\u884c\uff0c\u6216\u8005\u6b63\u5904\u4e8e\u542f\u52a8\u6216\u91cd\u542f\u72b6\u6001\u3002<\/li>\n<li>Succeeded: Pod\u4e2d\u7684\u6240\u6709\u5bb9\u5668\u90fd\u88ab\u6210\u529f\u7ec8\u6b62\uff0c\u5e76\u4e14\u4e0d\u4f1a\u518d\u91cd\u542f\u3002<\/li>\n<li>Failed: Pod\u4e2d\u6240\u6709\u5bb9\u5668\u90fd\u5df2\u7ecf\u7ec8\u6b62\uff0c\u5e76\u4e14\u81f3\u5c11\u6709\u4e00\u4e2a\u5bb9\u5668\u662f\u56e0\u4e3a\u5931\u8d25\u7ec8\u6b62\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5bb9\u5668\u4ee5\u975e0\u72b6\u6001\u9000\u51fa\u6216\u88ab\u7cfb\u7edf\u7ec8\u6b62\u3002<\/li>\n<li>Unknown: \u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u65e0\u6cd5\u53d6\u5f97 Pod \u7684\u72b6\u6001\uff0c\u901a\u8fc7\u662f\u56e0\u4e3a\u4e0e Pod \u6240\u5728\u7684\u4e3b\u673a\u901a\u4fe1\u5931\u8d25\u3002<\/li>\n<\/ul>\n<p>\u4e0b\u56fe\u662f\u4e00\u4e2a Pod \u7684\u751f\u547d\u5468\u671f\u72b6\u6001\uff0c\u56fe\u7247\u6765\u6e90\u4e8e\u7f51\u7edc\uff1a<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/kubernetes-pod-life-cycle.jpg\" alt=\"kubernetes-pod-life-cycle\" \/><\/p>\n<p>\u5728 Pod \u7684\u6574\u4e2a\u751f\u547d\u5468\u671f\u4e2d\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u5bb9\u5668\u7684\u751f\u547d\u5468\u671f\u94a9\u5b50\u6765\u5728\u67d0\u4e9b\u9636\u6bb5\u5904\u7406\u4e00\u4e9b\u5de5\u4f5c\u3002<\/p>\n<ul>\n<li>PostStart: \u5f53\u5bb9\u5668\u88ab\u521b\u5efa\u7684\u65f6\u5019\uff0c\u8fd9\u4e2a\u94a9\u5b50\u4f1a\u7acb\u523b\u6267\u884c\u3002<\/p>\n<\/li>\n<li>\n<p>PreStop: \u5f53\u5bb9\u5668\u9000\u51fa\u65f6\u6267\u884c<\/p>\n<\/li>\n<\/ul>\n<p>\u5728\u4e24\u79cd\u94a9\u5b50\u89e6\u53d1\u65f6\u6211\u4eec\u53ef\u4ee5\u9009\u62e9\u8c03\u7528\u811a\u672c\u6267\u884c\u8fd8\u662f\u53d1\u9001HTTP\u8bf7\u6c42\u3002<\/p>\n<h2>\u53c2\u8003\u8d44\u6599<\/h2>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/pod\/\">Pods-Kubernetes<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/jimmysong.io\/kubernetes-handbook\/concepts\/pod-state-and-lifecycle.html\">Pod\u72b6\u6001\u4e0e\u751f\u547d\u5468\u671f\u7ba1\u7406<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/www.ianlewis.org\/en\/almighty-pause-container\">The Almighty Pause Container<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/kubernetes.io\/blog\/2015\/06\/the-distributed-system-toolkit-patterns\/\">The Distributed System Toolkit: Patterns for Composite Containers<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/kubernetes.io\/blog\/2016\/06\/container-design-patterns\/\">Container Design Patterns<\/a><\/p>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/matthewpalmer.net\/kubernetes-app-developer\/articles\/multi-container-pod-design-patterns.html\">Multi-Container Pod Design Patterns in Kubernetes<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>pod \u57fa\u7840\u6982\u5ff5 \u5728 Kubernetes \u4e2d\uff0c Pod \u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u5b83\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u7ec4\u6210\uff0c\u8fd9\u4e9b\u5bb9 &hellip; <a href=\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">Kubernetes Pod \u89e3\u6790<\/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-500","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 Pod \u89e3\u6790 - \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\/2019\/12\/12\/kubernetes-pod\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Kubernetes Pod \u89e3\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"og:description\" content=\"pod \u57fa\u7840\u6982\u5ff5 \u5728 Kubernetes \u4e2d\uff0c Pod \u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u5b83\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u7ec4\u6210\uff0c\u8fd9\u4e9b\u5bb9 &hellip; \u7ee7\u7eed\u9605\u8bfbKubernetes Pod \u89e3\u6790\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\" \/>\n<meta property=\"og:site_name\" content=\"\u4e00\u53ea\u5b89\u9759\u7684\u732b\" \/>\n<meta property=\"article:published_time\" content=\"2019-12-12T06:18:12+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-07-05T13:37:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png\" \/>\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=\"5 \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\/2019\/12\/12\/kubernetes-pod\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\"},\"author\":{\"name\":\"jiangpengfei\",\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"headline\":\"Kubernetes Pod \u89e3\u6790\",\"datePublished\":\"2019-12-12T06:18:12+00:00\",\"dateModified\":\"2023-07-05T13:37:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\"},\"wordCount\":226,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png\",\"articleSection\":[\"k8s\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\",\"url\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\",\"name\":\"Kubernetes Pod \u89e3\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b\",\"isPartOf\":{\"@id\":\"https:\/\/www.myway5.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png\",\"datePublished\":\"2019-12-12T06:18:12+00:00\",\"dateModified\":\"2023-07-05T13:37:15+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage\",\"url\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png\",\"contentUrl\":\"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png\",\"width\":1614,\"height\":636},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.myway5.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Kubernetes Pod \u89e3\u6790\"}]},{\"@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 Pod \u89e3\u6790 - \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\/2019\/12\/12\/kubernetes-pod\/","og_locale":"zh_CN","og_type":"article","og_title":"Kubernetes Pod \u89e3\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","og_description":"pod \u57fa\u7840\u6982\u5ff5 \u5728 Kubernetes \u4e2d\uff0c Pod \u662f\u4e00\u4e2a\u975e\u5e38\u91cd\u8981\u7684\u6982\u5ff5\uff0c\u5b83\u7531\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u7ec4\u6210\uff0c\u8fd9\u4e9b\u5bb9 &hellip; \u7ee7\u7eed\u9605\u8bfbKubernetes Pod \u89e3\u6790","og_url":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/","og_site_name":"\u4e00\u53ea\u5b89\u9759\u7684\u732b","article_published_time":"2019-12-12T06:18:12+00:00","article_modified_time":"2023-07-05T13:37:15+00:00","og_image":[{"url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png","type":"","width":"","height":""}],"author":"jiangpengfei","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"jiangpengfei","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"5 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#article","isPartOf":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/"},"author":{"name":"jiangpengfei","@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"headline":"Kubernetes Pod \u89e3\u6790","datePublished":"2019-12-12T06:18:12+00:00","dateModified":"2023-07-05T13:37:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/"},"wordCount":226,"commentCount":0,"publisher":{"@id":"https:\/\/www.myway5.com\/#\/schema\/person\/b19267e8b106343431e163ec96950685"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png","articleSection":["k8s"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/","url":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/","name":"Kubernetes Pod \u89e3\u6790 - \u4e00\u53ea\u5b89\u9759\u7684\u732b","isPartOf":{"@id":"https:\/\/www.myway5.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage"},"image":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage"},"thumbnailUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png","datePublished":"2019-12-12T06:18:12+00:00","dateModified":"2023-07-05T13:37:15+00:00","breadcrumb":{"@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#primaryimage","url":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png","contentUrl":"https:\/\/www.myway5.com\/wp-content\/uploads\/2019\/12\/multi-container-pod-design.png","width":1614,"height":636},{"@type":"BreadcrumbList","@id":"https:\/\/www.myway5.com\/index.php\/2019\/12\/12\/kubernetes-pod\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.myway5.com\/"},{"@type":"ListItem","position":2,"name":"Kubernetes Pod \u89e3\u6790"}]},{"@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":5080,"_links":{"self":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/500","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=500"}],"version-history":[{"count":2,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/500\/revisions"}],"predecessor-version":[{"id":1566,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/posts\/500\/revisions\/1566"}],"wp:attachment":[{"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/media?parent=500"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/categories?post=500"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.myway5.com\/index.php\/wp-json\/wp\/v2\/tags?post=500"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}