{"id":10310,"date":"2023-03-28T23:03:39","date_gmt":"2023-03-28T15:03:39","guid":{"rendered":"http:\/\/123.57.164.21\/?p=10310"},"modified":"2024-04-16T19:04:05","modified_gmt":"2024-04-16T11:04:05","slug":"openshift-%e6%a0%b8%e5%bf%83%e6%a6%82%e5%bf%b5","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=10310","title":{"rendered":"OpenShift \u2014 \u6838\u5fc3\u6982\u5ff5"},"content":{"rendered":"\n<p><strong>\u5bb9\u5668\uff08Container\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Container \u7684\u5b9e\u73b0\u57fa\u4e8e Linux Kernel \u7684 chroot\u3001namespace\u3001cgroups \u6280\u672f\uff1a<\/p>\n\n\n\n<ul>\n<li>chroot\uff1a\u6bcf\u4e2a\u5bb9\u5668\u5177\u6709\u72ec\u7acb\u7684\u6587\u4ef6\u7cfb\u7edf\u3002<\/li>\n\n\n\n<li>namespace\uff1a\u6bcf\u4e2a\u5bb9\u5668\u5177\u6709\u72ec\u7acb\u7684\u64cd\u4f5c\u7cfb\u7edf\u8d44\u6e90\u89c6\u56fe\uff08\u9694\u79bb\uff09\u3002<\/li>\n\n\n\n<li>cgroups\uff1a\u6bcf\u4e2a\u5bb9\u5668\u5177\u6709\u72ec\u7acb\u7684\u64cd\u4f5c\u7cfb\u7edf\u8d44\u6e90\u914d\u989d\uff08\u9650\u5236\uff09\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u5f53\u4f7f\u7528 Docker \u521b\u5efa Container \u65f6\uff0c\u5b83\u4f1a\u4e3a\u6bcf\u4e2a Container \u521b\u5efa Namespace \u548c Cgroups\u3002<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"531\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-346-1024x531.png\" alt=\"\" class=\"wp-image-10311\" style=\"width:516px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-1024x531.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-300x156.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-768x398.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-1536x797.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-830x430.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-230x119.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-350x181.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346-480x249.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-346.png 1562w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><strong>\u955c\u50cf\uff08Image\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u800c Image \u7684\u672c\u8d28\u5c31\u662f\u4e00\u4e2a\u5305\u542b\u4e86 Application Container \u8fd0\u884c\u6240\u9700\u8981\u7684\u6587\u4ef6\u96c6\u5408\uff0c\u5982\uff1a\u4ee3\u7801\u3001\u8fd0\u884c\u65f6\u73af\u5883\u3001\u7cfb\u7edf\u5de5\u5177\u3001\u7cfb\u7edf\u5e93\u548c\u8bbe\u7f6e\u7b49\u3002<\/p>\n\n\n\n<p>\u5bb9\u5668\u955c\u50cf\u4ed3\u5e93\uff08Container Image Registry\uff09\u662f\u4e00\u79cd\u96c6\u4e2d\u7684\u5b58\u50a8\u548c\u5206\u53d1\u5bb9\u5668\u955c\u50cf\u7684\u670d\u52a1\u3002\u4e00\u4e2a Registry \u4e2d\u53ef\u5305\u542b\u591a\u4e2a\u4ed3\u5e93\uff08Repository\uff09\uff0c\u6bcf\u4e2a\u4ed3\u5e93\u53ef\u4ee5\u5305\u542b\u591a\u4e2a\u6807\u7b7e\uff08Tag\uff09\uff0c\u6bcf\u4e2a\u6807\u7b7e\u5bf9\u5e94\u4e00\u4e2a Image\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u4e00\u4e2a\u4ed3\u5e93\u4f1a\u5305\u542b\u540c\u4e00\u4e2a\u8f6f\u4ef6\u4e0d\u540c\u7248\u672c\u7684\u955c\u50cf\uff0c\u800c\u6807\u7b7e\u5c31\u5e38\u7528\u4e8e\u5bf9\u5e94\u8be5\u8f6f\u4ef6\u7684\u5404\u4e2a\u7248\u672c\u3002\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7 &lt;\u4ed3\u5e93\u540d&gt;:&lt;\u6807\u7b7e&gt; \u7684\u683c\u5f0f\u6765\u6307\u5b9a\u5177\u4f53\u662f\u8f6f\u4ef6\u54ea\u4e2a\u7248\u672c\u7684\u955c\u50cf\u3002<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"508\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-347-1024x508.png\" alt=\"\" class=\"wp-image-10312\" style=\"width:486px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-1024x508.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-300x149.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-768x381.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-1536x762.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-830x412.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-230x114.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-350x174.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347-480x238.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-347.png 1580w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><strong>\u7528\u6237\uff08User\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>OpenShif \u4e3b\u8981\u6709\u4ee5\u4e0b 3 \u7c7b User\uff1a<\/p>\n\n\n\n<ul>\n<li>Regular User\uff08\u5e38\u89c4\u7528\u6237\uff09\uff1a\u53ef\u901a\u8fc7 API \u521b\u5efa\uff0c\u4ee5 User \u5bf9\u8c61\u8868\u793a\u3002<\/li>\n\n\n\n<li>System User\uff08\u7cfb\u7edf\u7528\u6237\uff09\uff1a\u5927\u90e8\u5206 System User \u5728 Cluter \u90e8\u7f72\u5b8c\u6210\u540e\u81ea\u52a8\u88ab\u521b\u5efa\uff0c\u4e3b\u8981\u7528\u4e8e\u57fa\u7840\u67b6\u6784\u548c API \u670d\u52a1\u4e4b\u95f4\u7684\u5b89\u5168\u901a\u4fe1\u3002\u6bd4\u5982\uff1a\u4e00\u4e2a\u96c6\u7fa4\u7ba1\u7406\u5458\u3001\u6bcf\u4e2a\u8282\u70b9\u4e0a\u7684\u4e00\u4e2a\u7cfb\u7edf\u7528\u6237\u7b49\u3002<\/li>\n\n\n\n<li>Service Account\uff08\u670d\u52a1\u8d26\u6237\uff09\uff1a\u8fd9\u662f Project \u5185\u7684\u7279\u6b8a\u7cfb\u7edf\u7528\u6237\u3002\u67d0\u4e9b Service Account \u5728 Project \u521b\u5efa\u5b8c\u6210\u540e\u81ea\u52a8\u521b\u5efa\uff0c\u9879\u76ee\u7ba1\u7406\u5458\u4e5f\u53ef\u4ee5\u521b\u5efa Service Account\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u9879\u76ee\uff08Project\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Kubernetes Namespace \u4e3a Cluster \u4e2d\u7684\u8d44\u6e90\u5212\u5206\u4e86\u8303\u56f4\u3002OpenShift Project \u57fa\u4e8e Kubernetes Namespace \u6982\u5ff5\u65b0\u589e\u4e86\u4e00\u4e9b\u529f\u80fd\uff0c\u7528\u4e8e\u5bf9\u76f8\u5173\u5bf9\u8c61\u8fdb\u884c\u5206\u7ec4\u548c\u9694\u79bb\u3002\u6bcf\u4e2a OpenShift Project \u5bf9\u8c61\u5bf9\u5e94\u4e00\u4e2a Kubernetes Namespace \u5bf9\u8c61\u3002\u96c6\u7fa4\u7ba1\u7406\u5458\u53ef\u6388\u4e88\u7528\u6237\u5bf9\u67d0\u4e9b\u9879\u76ee\u7684\u8bbf\u95ee\u6743\u9650\u3001\u5141\u8bb8\u7528\u6237\u521b\u5efa\u9879\u76ee\uff0c\u4ee5\u53ca\u6388\u4e88\u7528\u6237\u5728\u9879\u76ee\u4e2d\u7684\u6743\u9650\u3002<\/p>\n\n\n\n<p><strong>\u5bb9\u5668\u6c99\u7bb1\uff08Pod\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>OpenShift \u5f15\u5165\u4e86 Kubernetes \u4e2d\u7684 Pod \u6982\u5ff5\u3002Pod \u662f OpenShift \u5e94\u7528\u7684\u6700\u5c0f\u53ef\u6267\u884c\u548c\u53ef\u8c03\u5ea6\u5355\u5143\uff0c\u5373\u5e94\u7528\u7684\u4e00\u4e2a\u5b9e\u4f8b\u3002Pod \u5b9a\u4e49\u4e2d\u5305\u542b\u5e94\u7528\u7684\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u3001\u5b58\u50a8\u8d44\u6e90\u3001\u552f\u4e00\u7684\u7f51\u7edc IP\uff0c\u4ee5\u53ca\u5176\u4ed6\u5b9a\u4e49\u5bb9\u5668\u5982\u4f55\u8fd0\u884c\u7684\u9009\u9879\u3002OpenShift \u5bb9\u5668\u4e91\u5e73\u53f0\u4f7f\u7528 Docker \u6765\u8fd0\u884c Pod \u4e2d\u7684\u5bb9\u5668\u3002\u6bcf\u4e2a Pod \u90fd\u88ab\u5206\u914d\u4e86\u72ec\u7acb\u7684 IP \u5730\u5740\uff0cPod \u4e2d\u7684\u6240\u6709\u5bb9\u5668\u5171\u4eab\u672c\u5730\u5b58\u50a8\u548c\u7f51\u7edc\uff0c\u5bb9\u5668\u4f7f\u7528 localhost \u4e92\u76f8\u901a\u4fe1\u3002Pod \u53ef\u62e5\u6709\u5171\u4eab\u7684\u5b58\u50a8\u5377\uff0cPod \u4e2d\u7684\u6240\u6709\u5bb9\u5668\u90fd\u80fd\u8bbf\u95ee\u8fd9\u4e9b\u5377\u3002<\/p>\n\n\n\n<ul>\n<li>Pod \u662f\u6709\u751f\u547d\u5468\u671f\u7684\uff0c\u4ece\u88ab\u5b9a\u4e49\u5f00\u59cb\uff0c\u5230\u88ab\u5206\u914d\u5230\u67d0\u4e2a\u8282\u70b9\u4e0a\u8fd0\u884c\uff0c\u518d\u5230\u88ab\u91ca\u653e\u3002<\/li>\n\n\n\n<li>Pod \u662f\u4e0d\u53ef\u4ee5\u4fee\u6539\u7684\uff0c\u4e5f\u5c31\u662f\u8bf4\u4e00\u4e2a\u8fd0\u884c\u4e2d\u7684 Pod \u7684\u5b9a\u4e49\u65e0\u6cd5\u4fee\u6539\u3002<\/li>\n\n\n\n<li>Pod \u662f\u4e34\u65f6\u6027\u7684\uff0c\u7528\u5b8c\u5373\u4e22\u5f03\uff0c\u5f53 Pod \u4e2d\u7684\u8fdb\u7a0b\u7ed3\u675f\u3001\u6240\u5728\u8282\u70b9\u6545\u969c\uff0c\u6216\u8005\u8d44\u6e90\u77ed\u7f3a\u65f6\uff0cPod \u5373\u4f1a\u88ab\u7ec8\u6b62\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u9759\u6001 Pod\uff08Static Pod\uff09\u662f\u4e00\u7c7b\u7279\u6b8a\u7684 Pod\u3002\u8fd9\u79cd Pod \u7531 Kubelet \u521b\u5efa\u548c\u7ba1\u7406\uff0c\u4ec5\u8fd0\u884c\u5728 kubelet \u8fd0\u884c\u7684 Node \u4e0a\uff0c\u4e0d\u80fd\u901a\u8fc7 API Server \u8fdb\u884c\u7ba1\u7406\uff0c\u65e0\u6cd5\u4e0e ReplicationController \u7b49\u5173\u8054\u3002OpenShift \u63a7\u5236\u5e73\u9762\u7ec4\u4ef6\uff08e.g. etcd\u3001API Server\u3001Scheduler\u3001Controller\uff09\u4f1a\u4ee5 Static Pod \u7684\u5f62\u5f0f\u8fd0\u884c\u5728 Master \u4e0a\uff0c\u7531\u5176\u4e0a\u7684 kubelet \u521b\u5efa\u548c\u7ba1\u7406\u3002<\/p>\n\n\n\n<p>\u53e6\u4e00\u7c7b\u7279\u6b8a\u7684 Pod \u4e3a\u5b88\u62a4 Pod\uff08Daemon Pod\uff09\uff0c\u4e00\u4e2a Node \u4e0a\u53ea\u6709\u4e00\u4e2a Daemon Pod \u7684\u526f\u672c\u3002OpenShift \u7684 openshift-sdn\u548c openvswitch \u7ec4\u4ef6\u4ee5 Daemon Pod \u7684\u5f62\u5f0f\u8fd0\u884c\u5728\u6240\u6709 Node \u4e0a\u3002<\/p>\n\n\n\n<p>\u6b63\u662f\u7531\u4e8e Pod \u5177\u6709\u4e34\u65f6\u6027\u3001\u4e0d\u53ef\u4fee\u6539\u3001\u65e0\u6cd5\u81ea\u6108\u7b49\u7279\u6027\uff0c\u7528\u6237\u5f88\u5c11\u76f4\u63a5\u521b\u5efa\u72ec\u7acb\u7684 Pod\uff0c\u800c\u4f1a\u901a\u8fc7 ReplicationController \u8fd9\u6837\u7684\u63a7\u5236\u5668\u6765\u5bf9\u5b83\u8fdb\u884c\u63a7\u5236\u3002\u5982\u679c\u9700\u8981\uff0c\u53ef\u901a\u8fc7 oc create \u2013f \u547d\u4ee4\u6765\u521b\u5efa Pod \u5b9e\u4f8b\u3002<\/p>\n\n\n\n<p>\u4e00\u4e2a OpenShift Pod \u53ef\u80fd\u4f1a\u5305\u62ec\u4ee5\u4e0b\u51e0\u79cd\u5bb9\u5668\uff1a<\/p>\n\n\n\n<p>1.Infra \u5bb9\u5668\uff08\u57fa\u7840\u8bbe\u65bd\u5bb9\u5668\uff09\uff1a\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u5bb9\u5668\uff0c\u6bcf\u4e2a Pod \u90fd\u4f1a\u8fd0\u884c\u4e00\u4e2a Infra \u5bb9\u5668\uff0c\u5b83\u8d1f\u8d23\u521b\u5efa\u548c\u521d\u59cb\u5316 Pod \u7684\u5404\u79cd Namespace\uff0c\u540e\u7eed\u521b\u5efa\u5230 Pod \u4e2d\u7684\u6240\u6709 Containers \u4f1a\u88ab\u52a0\u5165\u5230\u8fd9\u4e9b Namespace \u4e2d\u3002\u8fd9\u79cd\u5bb9\u5668\u7684\u540d\u5b57\u4ee5 k8s_POD__ \u4e3a\u524d\u7f00\uff0c\u8be5\u5bb9\u5668\u4f7f\u7528\u7684\u955c\u50cf\u901a\u8fc7\u5bbf\u4e3b\u673a\u4e0a\u7684 kubelet \u7a0b\u5e8f\u7684\u542f\u52a8\u53c2\u6570 &#8211;pod-infra-container-image \u6765\u6307\u5b9a\u3002<\/p>\n\n\n\n<p>2.Init \u5bb9\u5668\uff08\u521d\u59cb\u5bb9\u5668\uff09\uff1a\u4e5f\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u5bb9\u5668\uff0c\u4e00\u4e2a Pod \u53ef\u4ee5\u6ca1\u6709\uff0c\u4e5f\u53ef\u4ee5\u6709\u4e00\u4e2a\u6216\u591a\u4e2a Init \u5bb9\u5668\u3002Init \u5bb9\u5668\u5728 Pod \u4e2d\u7684\u4e3b\u5bb9\u5668\uff08\u5e94\u7528\u5bb9\u5668\uff09\u8fd0\u884c\u524d\u8fd0\u884c\u3002\u5982\u679c\u6709\u4e00\u4e2a Init \u5bb9\u5668\u8fd0\u884c\u5931\u8d25\uff0c\u90a3\u4e48 Pod \u4e2d\u7684\u4e3b\u5bb9\u5668\u5c31\u4e0d\u4f1a\u542f\u52a8\u3002\u56e0\u6b64\uff0c\u53ef\u5229\u7528 Init \u5bb9\u5668\u6765\u68c0\u67e5\u662f\u5426\u6ee1\u8db3\u4e3b\u5bb9\u5668\u542f\u52a8\u6240\u9700\u7684\u524d\u63d0\u6761\u4ef6\u3002\u6bd4\u5982\u4e00\u4e2a\u5e94\u7528 Pod \u4e2d\u7684\u4e3b\u5bb9\u5668\u8981\u6c42 MySQL \u670d\u52a1\u5c31\u7eea\u540e\u624d\u80fd\u8fd0\u884c\uff0c\u90a3\u4e48\u53ef\u4ee5\u5728 Init \u5bb9\u5668\u4e2d\u68c0\u67e5 MySQL \u670d\u52a1\u662f\u5426\u5c31\u7eea\u3002\u4f8b\u5982\uff1a\u5b9a\u4e49\u4e86\u4e24\u4e2a Init \u5bb9\u5668\uff0c\u7b2c\u4e00\u4e2a Init \u5bb9\u5668\u4f1a\u68c0\u67e5 MyService \u670d\u52a1\u662f\u5426\u5c31\u7eea\uff0c\u7b2c\u4e8c\u4e2a Init \u5bb9\u5668\u4f1a\u68c0\u67e5 MyDB \u670d\u52a1\u662f\u5426\u5c31\u7eea\u3002\u53ea\u6709\u5728\u8fd9\u4e24\u4e2a\u670d\u52a1\u90fd\u5c31\u7eea\u4e86\u4e4b\u540e\uff0cPod \u7684\u4e3b\u5bb9\u5668 myapp-container \u624d\u4f1a\u8fd0\u884c\u3002<\/p>\n\n\n\n<p>3.\u4e3b\u5bb9\u5668\uff08\u5e94\u7528\u5bb9\u5668\uff09\uff1a\u901a\u5e38\u4e00\u4e2a Pod \u4e2d\u8fd0\u884c\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u7684\u4e3b\u5bb9\u5668\u3002\u5728\u67d0\u4e9b\u573a\u666f\u4e0b\uff0c\u4e00\u4e2a Pod \u4e2d\u4f1a\u8fd0\u884c\u591a\u4e2a\u5177\u6709\u5f3a\u8026\u5408\u5173\u7cfb\u7684\u4e3b\u5bb9\u5668\u3002\u6bd4\u5982\uff1a\u5728\u4e00\u4e2a Pod \u4e2d\u4ee5 Sidecar\uff08\u8fb9\u8f66\uff09\u5f62\u5f0f\u8fd0\u884c\u4e00\u4e2a\u65e5\u5fd7\u91c7\u96c6\u5bb9\u5668\uff0c\u7528\u4e8e\u91c7\u96c6\u8be5 Pod \u4e3b\u5bb9\u5668\u4e2d\u7684\u5e94\u7528\u5199\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d\u7684\u65e5\u5fd7\uff0c\u5e76\u5c06\u5b83\u4eec\u8f93\u51fa\u5230\u6807\u51c6\u8f93\u51fa\u3002<\/p>\n\n\n\n<p>\u56e0\u6b64\uff0cPod \u662f\u4e00\u4e2a\u6216\u591a\u4e2a\u5bb9\u5668\u7ec4\u6210\u7684\u96c6\u5408\uff0c\u8fd9\u4e9b\u5bb9\u5668\u5171\u4eab\u540c\u4e00\u4e2a\u8fd0\u884c\u73af\u5883\u3002OpenShift \u9ed8\u8ba4\u5229\u7528 Docker \u4f5c\u4e3a\u5bb9\u5668\u8fd0\u884c\u65f6\u6765\u521b\u5efa\u548c\u7ba1\u7406\u5bb9\u5668\uff0cPod \u5185\u7684\u6240\u6709\u5bb9\u5668\u5171\u4eab\u547d\u540d\u7a7a\u95f4\u3002Docker \u9996\u5148\u4e3a Pod \u521b\u5efa Infra \u5bb9\u5668\uff0c\u4e3a\u8be5\u5bb9\u5668\u521b\u5efa\u547d\u540d\u7a7a\u95f4\u548c\u63a7\u5236\u7ec4\uff0c\u7136\u540e\u4f9d\u6b21\u521b\u5efa\u548c\u8fd0\u884c Init \u5bb9\u5668\uff0c\u7b49\u5230\u6240\u6709 Init \u5bb9\u5668\u90fd\u8fd0\u884c\u540e\uff0c\u518d\u521b\u5efa\u548c\u8fd0\u884c\u4e3b\u5bb9\u5668\u3002\u8fd9\u4e9b\u5bb9\u5668\u90fd\u5171\u4eab Infra \u5bb9\u5668\u7684\u547d\u540d\u7a7a\u95f4\u3002<\/p>\n\n\n\n<p>\u4e0b\u56fe\u662f Pod \u4e2d\u7684\u5bb9\u5668\u793a\u610f\u56fe\u3002\u5b9e\u9645\u4e0a\uff0c\u4e00\u4e2a Pod \u4e2d\u7684\u6240\u6709\u5bb9\u5668\u4e2d\u7684\u8fdb\u7a0b\u90fd\u4eff\u4f5b\u8fd0\u884c\u5728\u540c\u4e00\u53f0 \u201c\u673a\u5668\u201d \u4e0a\u3002Pod \u4e2d\u7684\u6240\u6709\u5bb9\u5668\u5171\u4eab\u7f51\u7edc\u7a7a\u95f4\uff0c\u56e0\u6b64\u53ef\u4ee5\u901a\u8fc7 localhost \u4e92\u76f8\u76f4\u63a5\u901a\u4fe1\uff1b\u5b83\u4eec\u8fd8\u4f7f\u7528\u540c\u6837\u7684\u4e3b\u673a\u540d\uff08hostname\uff09\uff0c\u4ee5\u53ca\u5171\u4eab Pod \u7684\u5b58\u50a8\u5377\u3002<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"673\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-348-1024x673.png\" alt=\"\" class=\"wp-image-10313\" style=\"width:490px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-1024x673.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-300x197.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-768x505.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-1536x1010.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-830x546.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-230x151.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-350x230.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348-480x316.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-348.png 1560w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Pod \u5177\u6709\u5176\u751f\u547d\u5468\u671f\uff0c\u5176\u58f0\u660e\u4e2d\u7684 \u201cphase\u201d \u5b57\u6bb5\u8868\u793a\u5176\u5f53\u524d\u6240\u5904\u7684\u8fd0\u884c\u9636\u6bb5\u3002Pod \u7684\u4e3b\u8981\u8fd0\u884c\u9636\u6bb5\u5305\u62ec\uff1a<\/p>\n\n\n\n<p>1.Pending\uff1aOpenShift API Server \u5df2\u7ecf\u521b\u5efa\u597d\u4e86 Pod \u5bf9\u8c61\uff0c\u4f46\u8fd8\u672a\u88ab\u8c03\u5ea6\u5230\u67d0\u4e2a\u8282\u70b9\u4e0a\uff0c\u6216\u8005\u8fd8\u5728\u4e0b\u8f7d Pod \u6240\u9700\u955c\u50cf\u3002<\/p>\n\n\n\n<p>2.Running\uff1aPod \u88ab\u8c03\u5ea6\u5230\u4e86 OpenShift \u96c6\u7fa4\u7684\u67d0\u4e2a\u8282\u70b9\u4e0a\uff0cPod \u4e2d\u6240\u6709\u7684\u4e3b\u5bb9\u5668\u90fd\u5df2\u7ecf\u88ab\u521b\u5efa\u51fa\u6765\uff0c\u800c\u4e14\u81f3\u5c11\u6709\u4e00\u4e2a\u5728\u8fd0\u884c\u4e2d\u3002<\/p>\n\n\n\n<p>3.Failed\uff1aPod \u4e2d\u6240\u6709\u5bb9\u5668\u90fd\u5df2\u88ab\u7ec8\u6b62\uff0c\u800c\u4e14\u81f3\u5c11\u6709\u4e00\u4e2a\u5bb9\u5668\u7ec8\u6b62\u5931\u8d25\u3002<\/p>\n\n\n\n<p>4.Succeeded\uff1aPod \u4e2d\u6240\u6709\u5bb9\u5668\u90fd\u5df2\u88ab\u7ec8\u6b62\uff0c\u800c\u4e14\u90fd\u7ec8\u6b62\u6210\u529f\u4e86\u3002<\/p>\n\n\n\n<p>Pod \u7684\u72b6\u6001\uff08status\uff09\u548c Pod \u7684\u9636\u6bb5\uff08phase\uff09\u4e0d\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\uff1a<\/p>\n\n\n\n<ul>\n<li>\u5728 Pending \u9636\u6bb5\uff0cPod \u7684\u72b6\u6001\u901a\u5e38\u4e3a \u201cContainerCreating\u201d\u3002<\/li>\n\n\n\n<li>\u5728 Running \u9636\u6bb5\uff0cPod \u7684\u72b6\u6001\u53ef\u80fd\u4e3a \u201cRunning\u201d\uff0c\u8868\u793a\u5b83\u5728\u6b63\u5e38\u8fd0\u884c\uff1b\u4e5f\u53ef\u80fd\u4e3a \u201cError\u201d\uff0c\u6bd4\u5982\u67d0\u4e2a\u5bb9\u5668\u5931\u8d25\u4e86\u3002<\/li>\n\n\n\n<li>\u5728 Succeeded \u9636\u6bb5\uff0cPod \u7684\u72b6\u6001\u901a\u5e38\u4e3a \u201cCompleted\u201d\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u901a\u8fc7 oc get pod \u547d\u4ee4\u53ef\u67e5\u8be2\u5f53\u524d\u9879\u76ee\u4e2d\u6240\u6709 Pod \u7684\u72b6\u6001\u3002\u4e0b\u56fe\u663e\u793a\u4e86\u4e00\u4e2a\u5177\u6709\u4e24\u4e2a Init \u5bb9\u5668\u548c\u4e24\u4e2a\u4e3b\u5bb9\u5668\u7684 Pod \u542f\u52a8\u8fc7\u7a0b\u4e2d\uff0c\u5404\u4e2a\u5bb9\u5668\u7684\u542f\u52a8\u987a\u5e8f\u548c\u5bf9\u5e94 Pod \u7684\u72b6\u6001\uff0c\u4ee5\u53ca Pod \u7ec8\u6b62\u65f6\u548c\u7ec8\u6b62\u540e\u7684\u72b6\u6001\u3002<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"448\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-349-1024x448.png\" alt=\"\" class=\"wp-image-10314\" style=\"width:500px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-1024x448.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-300x131.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-768x336.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-1536x671.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-830x363.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-230x101.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-350x153.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349-480x210.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-349.png 1588w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p><strong>\u90e8\u7f72\uff08Deployment\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u4e3a\u4e86\u66f4\u597d\u5730\u7ba1\u7406\u5e94\u7528\u5f00\u53d1\u548c\u90e8\u7f72\u751f\u547d\u5468\u671f\uff0cOpenShift \u5728 Kubernetes \u7684 Replication Controller \u7684\u57fa\u7840\u4e0a\u589e\u52a0\u4e86 DeploymentConfig \u7684\u6982\u5ff5\u3002DeploymentConfig \u5bf9\u8c61\u5b9a\u4e49\u4e86\u90e8\u7f72\u7684\u5143\u6570\u636e\uff0c\u5305\u62ec ReplicationController \u7684\u5b9a\u4e49\u3001\u81ea\u52a8\u8fdb\u884c\u65b0\u90e8\u7f72\u7684\u89e6\u53d1\u5668\u3001\u5728\u90e8\u7f72\u4e4b\u95f4\u8fdb\u884c\u72b6\u6001\u8f6c\u6362\u7684\u65b9\u6cd5\uff08Rolling Strategy\uff09\uff0c\u4ee5\u53ca\u751f\u547d\u5468\u671f\u94a9\u5b50\uff08Life Cycle Hook\uff09\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7 oc get dc \u547d\u4ee4\u53ef\u67e5\u770b\u5f53\u524d Project \u4e2d\u7684 DeploymentConfig \u5bf9\u8c61\u5217\u8868\u3002\u901a\u8fc7 oc rollout latest dc\/XXX \u547d\u4ee4\u53ef\u624b\u52a8\u89e6\u53d1\u8be5\u5e94\u7528\u7684\u4e00\u6b21\u90e8\u7f72\u8fc7\u7a0b\u3002\u90e8\u7f72\u6210\u529f\u540e\uff0c\u4f1a\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 ReplicationController \u5bf9\u8c61\u3002\u6bcf\u6b21\u90e8\u7f72\u65f6\u90fd\u4f1a\u521b\u5efa\u4e00\u4e2a ReplicationController \u5bf9\u8c61\uff0c\u5e76\u7531\u5b83\u521b\u5efa\u6240\u9700 Pod\u3002Replication Controller \u786e\u4fdd\u5728\u4efb\u4f55\u65f6\u95f4\u4e0a\u8fd0\u884c Pod \u7684 \u201creplicas\u201d \u6570\u4e3a\u5b9a\u4e49\u4e2d\u7684\u6570\u91cf\u3002<\/p>\n\n\n\n<ul>\n<li>\u5982\u679c Pod \u8d85\u8fc7\u6307\u5b9a\u7684\u6570\u91cf\uff0cReplicationController \u4f1a\u7ec8\u6b62\u591a\u4f59\u7684 Pod\uff1b<\/li>\n\n\n\n<li>\u5982\u679c Pod \u5c11\u4e8e\u6307\u5b9a\u6570\u91cf\uff0c\u5b83\u5c06\u542f\u52a8\u66f4\u591aPod\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4e0e\u624b\u52a8\u521b\u5efa\u7684 Pod \u4e0d\u540c\uff0c\u5982\u679c\u6709 Pod \u5931\u8d25\u3001\u88ab\u5220\u9664\u6216\u88ab\u7ec8\u6b62\uff0cReplicationController \u4f1a\u81ea\u52a8\u7ef4\u62a4\u5e76\u66ff\u4ee3\u8fd9\u4e9b Pod\u3002\u901a\u8fc7 oc get rc \u547d\u4ee4\u53ef\u67e5\u770b\u5f53\u524d\u9879\u76ee\u4e2d\u7684 ReplicationController \u5bf9\u8c61\u5217\u8868\u3002<\/p>\n\n\n\n<p>\u8fd8\u53ef\u4ee5\u5728 DeploymentConfig \u914d\u7f6e\u4e2d\u5b9a\u4e49\u90e8\u7f72\u89e6\u53d1\u5668\uff0c\u5728\u6307\u5b9a\u6761\u4ef6\u53d1\u751f\u65f6\u5373\u8fdb\u884c\u4e00\u6b21\u65b0\u7684\u90e8\u7f72\u3002\u4e0b\u9762\u662f\u67d0 DeploymentConfig \u5b9a\u4e49\u7684 Trigger \u90e8\u5206\uff0c\u8bbe\u7f6e\u4e86 ImageChange \u89e6\u53d1\u5668\uff0c\u4f7f\u5f97 mywebapp \u955c\u50cf\u6d41\u7684 latest \u6807\u7b7e\u88ab\u76d1\u63a7\uff0c\u4e00\u65e6\u8be5\u6807\u7b7e\u503c\u53d1\u751f\u6539\u53d8\uff08\u610f\u5473\u7740\u6709\u65b0\u7684\u955c\u50cf\u88ab\u63a8\u9001\u8fdb\u6765\uff09\uff0c\u5373\u4f1a\u89e6\u53d1\u4e00\u6b21\u65b0\u7684\u90e8\u7f72\u8fc7\u7a0b\u3002<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">triggers:\n  - type: \"ImageChange\"\n    imageChangeParams:\n      automatic: true\n      from:\n        kind: \"ImageStreamTag\"\n        name: \"mywebapp:latest\"\n        namespace: \"myproject<\/pre>\n\n\n\n<p><strong>\u670d\u52a1\uff08Service\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u7531\u4e8e Pod \u662f\u4e34\u65f6\u6027\u7684\uff0c\u56e0\u6b64\u5b83\u7684 IP:Port \u4e5f\u662f\u52a8\u6001\u53d8\u5316\u7684\u3002\u8fd9\u5c06\u5bfc\u81f4\u4ee5\u4e0b\u95ee\u9898\uff1a\u5982\u679c\u4e00\u7ec4\u540e\u7aef Pod \u4f5c\u4e3a\u670d\u52a1\u63d0\u4f9b\u65b9\uff0c\u4f9b\u4e00\u7ec4\u524d\u7aef Pod \u8c03\u7528\uff0c\u90a3\u4e48\u670d\u52a1\u8c03\u7528\u65b9\u600e\u4e48\u4f7f\u7528\u4e0d\u65ad\u53d8\u5316\u7684\u540e\u7aef Pod \u7684 IP \u5462\uff1f<\/p>\n\n\n\n<p>\u4e3a\u4e86\u89e3\u51b3\u6b64\u95ee\u9898\uff0cOpenShift \u5f15\u5165\u4e86 Kubernetes \u4e2d\u7684 Service \u6982\u5ff5\u3002\u4e00\u4e2a Service \u53ef\u88ab\u770b\u4f5c OpenShift \u7684\u4e00\u4e2a\u5185\u90e8\u8d1f\u8f7d\u5747\u8861\u5668\u3002\u5b83\u5b9a\u4f4d\u4e00\u7ec4 Pod\uff0c\u5e76\u5c06\u7f51\u7edc\u6d41\u91cf\u5bfc\u5165\u5176\u4e2d\u3002\u53ef\u4ee5\u901a\u8fc7 oc get svc \u547d\u4ee4\u6765\u83b7\u53d6\u5f53\u524d\u9879\u76ee\u4e2d\u7684 Service \u5b9e\u4f8b\u3002<\/p>\n\n\n\n<p>Service \u7684\u540e\u7aef Pods \u901a\u8fc7 Selector\uff08\u7b5b\u9009\u5668\uff09\u7b5b\u9009\u51fa\u6765\uff0c\u4f8b\u5982\uff1a\u540e\u7aef Pod \u662f\u5305\u542b \u201cdeploymentconfig=mywebapp\u201d \u7684\u6240\u6709 Pods\uff0c\u5176 IP: Port \u5206\u522b\u4e3a 10.129.0.108:8080 \u548c 10.130.0.142:8080\uff0c\u800c\u8be5 Service \u5219\u88ab\u5206\u914d\u4e86 IP \u5730\u5740 172.30.151.210\uff0c\u7aef\u53e3\u53f7\u4e3a 8080\u3002\u6709\u4e86\u6b64 Service \u4e4b\u540e\uff0c\u5ba2\u6237\u7aef\u5c31\u5c31\u53ef\u4ee5\u4f7f\u7528\u8be5 Service \u7684 IP:Port \u6765\u8bbf\u95ee\u540e\u7aef Pods \u63d0\u4f9b\u7684\u5e94\u7528\u4e1a\u52a1\u4e86\u3002<\/p>\n\n\n\n<p>\u90a3 Service \u662f\u5982\u4f55\u5c06\u7f51\u7edc\u6d41\u91cf\u5bfc\u5165\u540e\u7aef Pods \u7684\u5462\uff1fOpenShift \u652f\u6301\u4e24\u79cd\u670d\u52a1\u8def\u7531\u5b9e\u73b0\uff1a<\/p>\n\n\n\n<p>1.\u9ed8\u8ba4\u662f\u57fa\u4e8e iptables \u7684\uff0c\u4f7f\u7528 iptables \u89c4\u5219\u5c06\u53d1\u9001\u5230 Service \u7684 Cluster IP \u7684\u8bf7\u6c42\u8f6c\u53d1\u5230\u670d\u52a1\u7684\u540e\u7aef Pods\uff1b<\/p>\n\n\n\n<p>2.\u8f83\u65e9\u671f\u7684\u5b9e\u73b0\u662f\u57fa\u4e8e\u7528\u6237\u7a7a\u95f4\u8fdb\u7a0b\uff0c\u5b83\u5c06\u6536\u5230\u7684\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u4e00\u4e2a\u53ef\u7528\u540e\u7aef Pods\u3002<\/p>\n\n\n\n<p>\u76f8\u6bd4\u4e4b\u4e0b\uff0c\u57fa\u4e8e iptables \u7684\u5b9e\u73b0\u6548\u7387\u66f4\u9ad8\uff0c\u4f46\u8981\u6c42\u6bcf\u4e2a Pods \u90fd\u80fd\u63a5\u6536\u8bf7\u6c42\uff1b\u7528\u6237\u7a7a\u95f4\u8fdb\u7a0b\uff08userspace\uff09\u5b9e\u73b0\u65b9\u5f0f\u7684\u901f\u5ea6\u8f83\u6162\u4e00\u4e9b\uff0c\u4f46\u4f1a\u5c1d\u8bd5\u540e\u7aef Pods \u76f4\u5230\u627e\u5230\u4e00\u4e2a\u53ef\u7528 Pod \u4e3a\u6b62\u3002\u56e0\u6b64\uff0c\u5982\u679c\u6709\u5b8c\u5584\u7684 Pod \u53ef\u7528\u6027\u68c0\u67e5\u673a\u5236\uff08Readiness Check\uff09\uff0c\u90a3\u57fa\u4e8e iptables \u7684\u65b9\u6848\u662f\u6700\u4f73\u9009\u62e9\uff1b\u5426\u5219\uff0c\u57fa\u4e8e\u7528\u6237\u7a7a\u95f4\u4ee3\u7406\u8fdb\u7a0b\u7684\u65b9\u6848\u4f1a\u6bd4\u8f83\u5b89\u5168\u3002<\/p>\n\n\n\n<p>Service \u7684\u540e\u7aef\u670d\u52a1\u5668\u88ab\u79f0\u4e3a\u7aef\u70b9\uff0c\u4ee5 Endpoints \u5bf9\u8c61\u8868\u793a\uff0c\u5176\u540d\u79f0\u548c\u670d\u52a1\u76f8\u540c\u3002\u5f53\u670d\u52a1\u7684\u540e\u7aef\u662f Pod \u65f6\uff0c\u901a\u5e38\u5728 Service \u7684\u5b9a\u4e49\u4e2d\u6307\u5b9a Label \u9009\u62e9\u5668\u6765\u6307\u5b9a\u5c06\u54ea\u4e9b Pod \u4f5c\u4e3a Service \u7684\u540e\u7aef\uff0c\u7136\u540e OpenShift \u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a Endpoints \u6307\u5411\u8fd9\u4e9b Pods\u3002\u901a\u8fc7 oc get ep \u547d\u4ee4\u67e5\u8be2\u5f53\u524d\u9879\u76ee\u4e2d\u7684 Endpoints \u5bf9\u8c61\u3002<\/p>\n\n\n\n<p><strong>\u8def\u7531\uff08Router\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>ervice \u63d0\u4f9b\u4e86\u4e00\u4e2a\u901a\u5f80 Backend Pods \u7684\u7a33\u5b9a\u5165\u53e3\uff0c\u4f46\u662f Service \u7684 IP \u5730\u5740\u53ea\u662f\u96c6\u7fa4\u5185\u90e8\u8282\u70b9\u53ca\u5bb9\u5668\u53ef\u89c1\u3002\u5bf9\u4e8e\u5916\u90e8\u7684\u5e94\u7528\u6216\u8005\u7528\u6237\u6765\u8bf4\uff0c\u8fd9\u4e2a\u5730\u5740\u662f\u4e0d\u53ef\u8fbe\u7684\u3002<\/p>\n\n\n\n<p>\u4e3a\u4e86\u4ece\u96c6\u7fa4\u5916\u90e8\u80fd\u8bbf\u95ee\u5230\u90e8\u7f72\u5728 OpenShift \u5185\u90e8\u7684\u5e94\u7528\uff0cOpenShift \u63d0\u4f9b\u4e86 Router\uff08\u8def\u7531\u5668\uff09\u7ec4\u4ef6\u3002Router \u662f\u4e00\u4e2a\u91cd\u8981\u7ec4\u4ef6\uff0c\u662f\u4ece\u96c6\u7fa4\u5916\u90e8\u8bbf\u95ee\u96c6\u7fa4\u5185\u7684\u5bb9\u5668\u5e94\u7528\u7684\u5165\u53e3\u3002\u96c6\u7fa4\u5916\u90e8\u8bf7\u6c42\u90fd\u4f1a\u5230\u8fbe Router\uff0c\u518d\u7531\u5b83\u5206\u53d1\u5230\u5177\u4f53\u5e94\u7528\u5bb9\u5668\u4e2d\u3002Router \u7ec4\u4ef6\u7531\u96c6\u7fa4\u7ba1\u7406\u5458\u8d1f\u8d23\u90e8\u7f72\u548c\u914d\u7f6e\uff0c\u4ee5\u63d2\u4ef6\u5f62\u5f0f\u5b9e\u73b0\uff0cOpenShift \u652f\u6301\u591a\u79cd Router \u63d2\u4ef6\uff0c\u9ed8\u8ba4\u91c7\u7528\u4e86 HAProxy \u5b9e\u73b0\u3002<\/p>\n\n\n\n<p>Router \u7ec4\u4ef6\u5c31\u7eea\u4e4b\u540e\uff0c\u7528\u6237\u53ef\u521b\u5efa Route\uff08\u8def\u7531\u89c4\u5219\uff09\u3002\u6bcf\u4e2a Route \u5bf9\u8c61\u4f1a\u5c06\u5173\u8054\u7684 Service \u4ee5\u57df\u540d\u7684\u5f62\u5f0f\u66b4\u9732\u5230\u96c6\u7fa4\u5916\u90e8\uff0c\u4f7f\u5f97\u4ece\u96c6\u7fa4\u5916\u90e8\u80fd\u901a\u8fc7\u57df\u540d\u8bbf\u95ee\u5230\u8be5 Service\u3002\u6bcf\u4e2a Route \u5bf9\u8c61\u5305\u542b Name\u3001DomainName\u3001Service Selector \u548c\u53ef\u9009\u7684\u5b89\u5168\u53c2\u6570\u7b49\u914d\u7f6e\u3002Route \u88ab\u521b\u5efa\u540e\u4f1a\u88ab Router \u52a0\u8f7d\uff0cRouter \u901a\u8fc7 Route \u7684 Service Selector \u5b9a\u4f4d\u5230\u8be5 Route \u7684\u6240\u6709 Backend Services\uff0c\u5e76\u5c06\u5176\u6240\u6709\u540e\u7aef\u66f4\u65b0\u5230\u81ea\u8eab\u7684\u914d\u7f6e\u4e4b\u4e2d\u3002\u540c\u65f6\uff0cRouter \u8fd8\u80fd\u52a8\u6001\u5730\u8ddf\u8e2a\u8be5\u670d\u52a1\u540e\u7aef\u7684\u53d8\u5316\uff0c\u5e76\u76f4\u63a5\u66f4\u65b0\u81ea\u5df1\u7684\u914d\u7f6e\u3002<\/p>\n\n\n\n<p>\u5f53\u7528\u6237\u8bbf\u95ee Domain \u65f6\uff0c\u9996\u5148\u4f1a\u88ab DNS \u670d\u52a1\u5668\u89e3\u6790\u5e76\u6307\u5411 Router \u6240\u5728 Node \u7684 IP \u5730\u5740\u3002Router \u83b7\u53d6\u8be5\u8bf7\u6c42\u540e\uff0c\u6839\u636e Route \u89c4\u5219\uff0c\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u8be5 Backend Service\uff0c\u6700\u7ec8\u518d\u8f6c\u53d1\u5230 Service \u6240\u5173\u8054\u7684 Pods \u5bb9\u5668\u5b9e\u4f8b\u3002\u901a\u8fc7 oc get route \u547d\u4ee4\u53ef\u83b7\u53d6\u5f53\u524d\u9879\u76ee\u4e2d\u7684\u6240\u6709\u8def\u7531\u89c4\u5219\u3002<\/p>\n\n\n\n<p>\u6ce8\u610f\uff0cOpenShfit \u4e2d\uff0cRoute \u548c Service \u90fd\u63d0\u4f9b\u4e86\u8d1f\u8f7d\u5747\u8861\u529f\u80fd\uff0c\u4f46\u4f7f\u7528\u573a\u666f\u548c\u4f5c\u7528\u4e0d\u540c\u3002Router\uff08\u5bf9\u5916\uff09\u8d1f\u8d23\u5c06\u96c6\u7fa4\u5916\u7684\u8bbf\u95ee\u8bf7\u6c42\u8f6c\u53d1\u7ed9 Backend Services\uff0c\u800c Service\uff08\u5bf9\u5185\uff09\u5219\u8d1f\u8d23\u5c06\u96c6\u7fa4\u5185\u7684\u8bbf\u95ee\u8bf7\u6c42\u8f6c\u53d1\u7ed9 Backend Pods\u3002<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"337\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-350-1024x337.png\" alt=\"\" class=\"wp-image-10317\" style=\"width:558px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-1024x337.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-300x99.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-768x253.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-1536x506.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-830x273.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-230x76.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-350x115.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350-480x158.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-350.png 1616w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>Pod\u3001Service\u3001Deployment \u548c Router \u7684\u5173\u7cfb\u5982\u4e0a\u56fe\u6240\u793a\uff1a<\/p>\n\n\n\n<ul>\n<li>DeploymenetConfig\uff1a\u662f\u90e8\u7f72\u7684\u9759\u6001\u5b9a\u4e49\uff0c\u6bcf\u6b21\u90e8\u7f72\u64cd\u4f5c\u90fd\u4f1a\u4ea7\u751f\u4e00\u4e2a Replication Controller \u5bf9\u8c61\u3002<\/li>\n\n\n\n<li>ReplicationController\uff1a\u5bf9\u8c61\u8d1f\u8d23\u7ef4\u62a4\u5728 DeploymenetConfig \u4e2d\u5b9a\u4e49\u7684 Pod \u526f\u672c\u6570\u3002Pod \u662f OpenShift \u4e2d\u6700\u5c0f\u7684\u53ef\u8c03\u5ea6\u5355\u5143\uff0c\u5728\u5176\u4e2d\u8fd0\u884c\u5e94\u7528\u5bb9\u5668\u3002<\/li>\n\n\n\n<li>Service\uff1a\u662f\u96c6\u7fa4\u5185\u90e8\u8d1f\u8f7d\u5747\u8861\u5668\uff0c\u672c\u8eab\u5e26\u6709 IP \u5730\u5740\u548c\u7aef\u53e3\uff0c\u4ee5 Pod \u4f5c\u4e3a\u5176\u540e\u7aef\uff0c\u5c06\u5bf9\u81ea\u8eab\u7684\u8bf7\u6c42\u8f6c\u53d1\u81f3\u8fd9\u4e9b\u540e\u7aef Pod\u3002<\/li>\n\n\n\n<li>Router\uff1a\u4e2d\u5305\u542b\u591a\u4e2a Route\uff0c\u6bcf\u4e2a Route \u5bf9\u5e94\u4e00\u4e2a Service\uff0c\u5c06\u5176\u4ee5\u57df\u540d\u5f62\u5f0f\u66b4\u9732\u5230\u96c6\u7fa4\u5916\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u6301\u4e45\u5316\u5b58\u50a8\uff08Persistent Storage\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u5bb9\u5668\u9ed8\u8ba4\u662f\u975e\u6301\u4e45\u5316\u7684\uff0c\u6240\u6709\u7684\u4fee\u6539\u5728\u5bb9\u5668\u9500\u6bc1\u65f6\u90fd\u4f1a\u4e22\u5931\u3002\u4f46\u73b0\u5b9e\u662f\u4f20\u7edf\u7684\u5e94\u7528\u5927\u591a\u90fd\u662f\u6709\u72b6\u6001\u7684\uff0c\u56e0\u6b64\u8981\u6c42\u67d0\u4e9b\u5bb9\u5668\u5185\u7684\u6570\u636e\u5fc5\u987b\u6301\u4e45\u5316\uff0c\u5bb9\u5668\u4e91\u5e73\u53f0\u5fc5\u987b\u4e3a\u5bb9\u5668\u63d0\u4f9b\u6301\u4e45\u5316\u5b58\u50a8\uff08persistent storage\uff09\u3002<\/p>\n\n\n\n<p>Docker \u672c\u8eab\u63d0\u4f9b\u4e86\u6301\u4e45\u5316\u5377\u6302\u8f7d\u7684\u80fd\u529b\u3002OpenShift \u9664\u4e86\u652f\u6301 Docker \u6301\u4e45\u5316\u7684\u6302\u8f7d\u65b9\u5f0f\u5916\uff0c\u8fd8\u63d0\u4f9b\u4e86\u4e00\u79cd\u6301\u4e45\u5316\u4f9b\u7ed9\u6a21\u578b\uff0c\u5373 Persistent Volume\uff08\u6301\u4e45\u5316\u5377\uff0cPV\uff09\u53ca Persistent Volume Claim\uff08\u6301\u4e45\u5316\u5377\u8bf7\u6c42\uff0cPVC\uff09\u6a21\u578b\u3002\u5728 PV \u548c PVC \u6a21\u578b\u4e2d\uff0c\u96c6\u7fa4\u7ba1\u7406\u5458\u4f1a\u521b\u5efa\u5927\u91cf\u5927\u5c0f\u4e0d\u540c\u548c\u4e0d\u540c\u7279\u6027\u7684 PV\u3002<\/p>\n\n\n\n<p>\u7528\u6237\u5728\u90e8\u7f72\u5e94\u7528\u65f6\uff0c\u5148\u662f\u58f0\u660e\u5bf9\u6301\u4e45\u5316\u7684\u9700\u6c42\uff0c\u521b\u5efa PVC\uff0c\u7528\u6237\u5728 PVC \u4e2d\u5b9a\u4e49\u6240\u9700\u5b58\u50a8\u7684\u5927\u5c0f\u3001\u8bbf\u95ee\u65b9\u5f0f\uff08\u53ea\u8bfb\u6216\u53ef\u8bfb\u53ef\u5199\u3001\u72ec\u5360\u6216\u662f\u5171\u4eab\uff09\u3002OpenShift Cluster \u4f1a\u81ea\u52a8\u5bfb\u627e\u7b26\u5408\u8981\u6c42\u7684 PV\uff08\u6570\u636e\u7684\u5b58\u50a8\u76ee\u5f55\uff09\u548c PVC\uff08\u6570\u636e\u9700\u6c42\u7684\u8bf7\u6c42\uff09\u81ea\u52a8\u5bf9\u63a5\u3002\u901a\u8fc7 PV \u548c PVC \u6a21\u578b\uff0cOpenShift \u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u7684\u65b9\u5f0f\u6765\u6d88\u8d39\u5b58\u50a8\u8d44\u6e90\u3002<\/p>\n\n\n\n<p>OpenShift \u5bf9\u6301\u4e45\u5316\u540e\u7aef\u7684\u652f\u6301\u6bd4\u8f83\u5e7f\u6cdb\uff0c\u9664\u4e86 NFS\u3001iSCSI \u5916\uff0c\u8fd8\u652f\u6301 Ceph\u3001GluterFS \u7b49\u5206\u5e03\u5f0f\u5b58\u50a8\uff0c\u4ee5\u53ca Amazon Web Service \u548c Google Compute Engine \u7684\u4e91\u786c\u76d8\u3002<\/p>\n\n\n\n<p><strong>\u6a21\u677f\uff08Template\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>\u4e00\u4e2a Template \u5bf9\u8c61\u5b9a\u4e49\u4e86\u4e00\u7ec4\u5bf9\u8c61\uff0c\u8fd9\u4e9b\u5bf9\u8c61\u53ef\u88ab\u53c2\u6570\u5316\uff0c\u7ecf OpenShift \u5904\u7406\u540e\u4f1a\u751f\u6210\u4e00\u7ec4\u5bf9\u8c61\u3002\u8fd9\u4e9b\u5bf9\u8c61\u53ef\u4ee5\u662f\u8be5\u7528\u6237\u5728\u9879\u76ee\u4e2d\u6709\u6743\u521b\u5efa\u7684\u6240\u6709\u7c7b\u578b\u7684\u5bf9\u8c61\uff0c\u6bd4\u5982\uff1aService\uff08\u670d\u52a1\uff09\u3001BuildConfiguraiton\uff08\u6784\u5efa\u914d\u7f6e\uff09\u3001DeploymentConfig\uff08\u90e8\u7f72\u914d\u7f6e\uff09\u7b49\u3002<\/p>\n\n\n\n<p>\u7528\u6237\u53ef\u4ee5\u901a\u8fc7 JSON\/YAML \u6587\u4ef6\u6765\u5b9a\u4e49\u4e00\u4e2a Template\uff0c\u518d\u901a\u8fc7 oc create \u2013f \u547d\u4ee4\u5728 OpenShif \u521b\u5efa\u8be5 Template \u5bf9\u8c61\u3002\u901a\u8fc7 oc get template \u547d\u4ee4\u53ef\u67e5\u770b\u5f53\u524d Project \u4e2d\u7684 Template \u5bf9\u8c61\u5217\u8868\u3002<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0cOpenShfit \u4f1a\u5728 Project \u4e2d\u521b\u5efa\u4e00\u4e9b Template \u4f9b\u7528\u6237\u4f7f\u7528\u3002\u901a\u8fc7 oc get templates -n openshift \u547d\u4ee4\u53ef\u67e5\u770b\u8fd9\u4e9b\u6a21\u677f\u3002<\/p>\n\n\n\n<p><strong>\u6784\u5efa\uff08Build\uff09\u548c\u955c\u50cf\u6d41\uff08ImageStream\uff09<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-css-opacity\"\/>\n\n\n\n<p>Build \u8868\u793a\u6839\u636e\u8f93\u5165\u53c2\u6570\u6784\u5efa\u51fa\u76ee\u6807\u5bf9\u8c61\u7684\u8fc7\u7a0b\u3002\u5728 OpenShift \u4e0a\uff0c\u8be5\u8fc7\u7a0b\u7528\u4e8e\u5c06\u6e90\u4ee3\u7801\u8f6c\u5316\u4e3a\u53ef\u8fd0\u884c\u7684\u5bb9\u5668\u955c\u50cf\u3002OpenShift \u652f\u6301 4 \u79cd\u6784\u5efa\u65b9\u5f0f\uff1a<\/p>\n\n\n\n<ul>\n<li>Docker \u6784\u5efa<\/li>\n\n\n\n<li>S2I \u6784\u5efa\uff1a\u662f OpenShift \u7684\u539f\u521b\uff0c\u5b83\u6839\u636e\u6307\u5b9a\u7684\u6784\u5efa\u955c\u50cf\uff08Builder Image\uff09\u548c\u6e90\u4ee3\u7801\uff08Source Code\uff09\uff0c\u6784\u5efa\u751f\u6210\u53ef\u90e8\u7f72 Docker \u955c\u50cf\uff0c\u5e76\u63a8\u9001\u5230 OpenShift \u5185\u90e8\u96c6\u6210\u955c\u50cf\u5e93\u4e2d\u3002<\/li>\n\n\n\n<li>Pipeline \u6784\u5efa\uff1a\u5141\u8bb8\u5f00\u53d1\u8005\u5b9a\u4e49 Jenkins Pipeline\u3002\u5728\u9879\u76ee\u9996\u6b21\u4f7f\u7528\u8be5\u6784\u5efa\u65b9\u5f0f\u65f6\uff0cOpenShift \u4f1a\u542f\u52a8\u4e00\u4e2a Jenkins \u670d\u52a1\uff0c\u7136\u540e\u518d\u5c06\u8be5 Pipeline \u4ea4\u7531\u5b83\u6765\u6267\u884c\uff0c\u5e76\u8d1f\u8d23\u542f\u52a8\u3001\u76d1\u63a7\u548c\u7ba1\u7406\u8be5\u6784\u5efa\u3002BuildConfig \u5bf9\u8c61\u4e2d\u53ef\u4ee5\u76f4\u63a5\u5305\u542b Jenkins Pipeline \u7684\u5185\u5bb9\uff0c\u6216\u8005\u5305\u542b\u5176 Git \u4ed3\u5e93\u5730\u5740\u3002<\/li>\n\n\n\n<li>\u81ea\u5b9a\u4e49\u6784\u5efa<\/li>\n<\/ul>\n\n\n\n<p>Build \u5efa\u7684\u914d\u7f6e\u7531\u4e00\u4e2a BuildConfig \u5bf9\u8c61\u8868\u793a\uff0c\u5176\u5b9a\u4e49\u4e86\u6784\u5efa\u7b56\u7565\u548c\u5404\u79cd\u53c2\u6570\uff0c\u4ee5\u53ca\u89e6\u53d1\u4e00\u6b21\u65b0\u6784\u5efa\u7684\u89e6\u53d1\u5668\uff08Trigger\uff09\u3002\u901a\u8fc7 oc get bc \u547d\u4ee4\u53ef\u83b7\u53d6\u5f53\u524d\u9879\u76ee\u4e2d\u7684\u6784\u5efa\u914d\u7f6e\u5217\u8868\u3002<\/p>\n\n\n\n<p>\u4f7f\u7528 Docker \u6216 S2I \u7b56\u7565\u7684\u6784\u5efa\u914d\u7f6e\u7684\u4e00\u6b21\u6210\u529f\u6784\u5efa\u4f1a\u521b\u5efa\u4e00\u4e2a\u5bb9\u5668\u955c\u50cf\u3002\u955c\u50cf\u4f1a\u88ab\u63a8\u9001\u5230 BuildConfig \u5b9a\u4e49\u7684 output \u90e8\u5206\u6240\u6307\u5b9a\u7684\u5bb9\u5668\u955c\u50cf\u4ed3\u5e93\u4e2d\uff1a<\/p>\n\n\n\n<ul>\n<li>\u5982\u679c\u76ee\u6807\u4ed3\u5e93\u7684\u7c7b\u578b\u4e3a ImageStreamTag\uff0c\u90a3\u4e48\u955c\u50cf\u4f1a\u88ab\u63a8\u9001\u5230 OpenShift \u7684\u5185\u7f6e\u955c\u50cf\u4ed3\u5e93\u4e2d\uff1b<\/li>\n\n\n\n<li>\u5982\u679c\u7c7b\u578b\u4e3a DockerImage\uff0c\u90a3\u4e48\u955c\u50cf\u4f1a\u88ab\u63a8\u9001\u5230\u6307\u5b9a\u7684\u955c\u50cf\u4ed3\u5e93\u6216 Docker Hub \u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u4f7f\u7528 ImageStream \u7684\u76ee\u7684\u662f\u65b9\u4fbf\u5c06\u4e00\u7ec4\u76f8\u5173\u8054\u7684\u955c\u50cf\u8fdb\u884c\u6574\u5408\u7ba1\u7406\u548c\u4f7f\u7528\uff0c\u6bd4\u5982\uff1a\u53ef\u5728\u65b0\u955c\u50cf\u88ab\u521b\u5efa\u540e\u81ea\u52a8\u6267\u884c\u6307\u5b9a\u6784\u5efa\u6216\u90e8\u7f72\u64cd\u4f5c\u3002\u6784\u5efa\u548c\u90e8\u7f72\u53ef\u4ee5\u76d1\u89c6 ImageStream\uff0c\u5728\u65b0\u955c\u50cf\u88ab\u6dfb\u52a0\u540e\u4f1a\u6536\u5230\u901a\u77e5\uff0c\u5e76\u5206\u522b\u901a\u8fc7\u6267\u884c\u6784\u5efa\u6216\u90e8\u7f72\u6765\u4f5c\u51fa\u53cd\u5e94\u3002\u4f8b\u5982\uff1a\u67d0 DeploymentConfig \u4f7f\u7528\u4e00\u4e2a ImageStream\uff0c\u5f53\u8be5\u955c\u50cf\u7248\u672c\u88ab\u66f4\u65b0\u65f6\uff0c\u5e94\u7528\u4f1a\u81ea\u52a8\u8fdb\u884c\u91cd\u65b0\u90e8\u7f72\u3002<\/p>\n\n\n\n<p>\u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c\u90e8\u7f72\u5b8c\u6210\u540e\uff0cOpenShift \u5728 Project \u4e2d\u521b\u5efa\u4e00\u4e9b\u955c\u50cf\u6d41\u4f9b\u7528\u6237\u76f4\u63a5\u4f7f\u7528\u3002\u901a\u8fc7 oc get is -n openshift \u547d\u4ee4\u53ef\u67e5\u770b\u8fd9\u4e9b\u955c\u50cf\u6d41\u3002\u6bcf\u6b21\u5411 OpenShift \u5185\u7f6e\u955c\u50cf\u4ed3\u5e93\u4e2d\u63a8\u9001\u955c\u50cf\u65f6\uff0c\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u6307\u5411\u8be5\u955c\u50cf\u7684 ImageSteam \u5bf9\u8c61\u3002<\/p>\n\n\n<div class=\"wp-block-image is-resized\">\n<figure class=\"aligncenter size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"339\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2023\/03\/image-351-1024x339.png\" alt=\"\" class=\"wp-image-10319\" style=\"width:492px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-1024x339.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-300x99.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-768x254.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-1536x508.png 1536w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-830x275.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-230x76.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-350x116.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351-480x159.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2023\/03\/image-351.png 1608w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>OpenShift Build \u548c Deployment \u7684\u5173\u7cfb\u5982\u4e0a\u56fe\uff1a<\/p>\n\n\n\n<ul>\n<li>BuildConfig \u662f Build \u7684\u9759\u6001\u5b9a\u4e49\uff0c\u6bcf\u6b21\u8fd0\u884c\u540e\u4f1a\u542f\u52a8\u4e00\u6b21 Build\u3002<\/li>\n\n\n\n<li>Build \u5b8c\u6210\u540e\u4ea7\u751f\u7684\u955c\u50cf\u4f1a\u88ab\u63a8\u9001\u5230\u955c\u50cf\u4ed3\u5e93\u4e2d\uff0c\u5e76\u4ea7\u751f ImageStream \u548c ImageStream-Tag\u3002<\/li>\n\n\n\n<li>DeploymentConfig \u662f Deployment \u7684\u9759\u6001\u5b9a\u4e49\uff0c\u5b83\u5173\u8054\u67d0\u4e2a ImageStreamTag\u3002\u6bcf\u5f53 Image-StreamTag \u6240\u6307\u5411\u7684\u955c\u50cf\u53d1\u751f\u53d8\u5316\uff0c\u90fd\u4f1a\u81ea\u52a8\u89e6\u53d1\u4e00\u6b21\u90e8\u7f72\u52a8\u4f5c\uff0c\u751f\u6210\u4e00\u4e2a ReplicationController \u5bf9\u8c61\u3002<\/li>\n<\/ul>\n\n\n\n<p><strong>\u4e3a\u4ec0\u4e48\u4f7f\u7528\u955c\u50cf\u6d41<\/strong>\uff1f<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u955c\u50cf\u6d41\u53ca\u5176\u5173\u8054\u6807\u7b7e\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7528\u4e8e\u4ece OpenShift Container Platform \u4e2d\u5f15\u7528\u5bb9\u5668\u955c\u50cf\u7684\u62bd\u8c61\u96c6\u3002\u955c\u50cf\u6d41\u53ca\u5176\u6807\u7b7e\u7528\u4e8e\u67e5\u770b\u53ef\u7528\u955c\u50cf\uff0c\u786e\u4fdd\u60a8\u4f7f\u7528\u6240\u9700\u7684\u7279\u5b9a\u955c\u50cf\uff0c\u5373\u4f7f\u5b58\u50a8\u5e93\u4e2d\u7684\u955c\u50cf\u53d1\u751f\u53d8\u5316\u4e5f\u662f\u5982\u6b64\u3002<\/p>\n\n\n\n<p>\u955c\u50cf\u6d41\u4e0d\u542b\u5b9e\u9645\u955c\u50cf\u6570\u636e\uff0c\u5b83\u63d0\u4f9b\u4e86\u76f8\u5173\u955c\u50cf\u7684\u4e00\u4e2a\u5355\u72ec\u7684\u865a\u62df\u89c6\u56fe\uff0c\u7c7b\u4f3c\u4e8e\u955c\u50cf\u5b58\u50a8\u5e93\u3002<\/p>\n\n\n\n<p>\u60a8\u53ef\u914d\u7f6e\u6784\u5efa\uff08Build\uff09\u548c\u90e8\u7f72\uff08Depolyment\uff09\u6765\u76d1\u6d4b\u4e00\u4e2a\u955c\u50cf\u6d41\u7684\u901a\u77e5\u3002\u5f53\u65b0\u7684\u955c\u50cf\u88ab\u6dfb\u52a0\u65f6\uff0c\u6267\u884c\u76f8\u5e94\u7684\u6784\u5efa\u6216\u90e8\u7f72\u3002<\/p>\n\n\n\n<p>\u4f8b\u5982\uff0c\u5982\u679c\u90e8\u7f72\u6b63\u5728\u4f7f\u7528\u67d0\u4e2a\u955c\u50cf\u5e76\u4e14\u521b\u5efa\u4e86\u8be5\u955c\u50cf\u7684\u65b0\u7248\u672c\uff0c\u5219\u4f1a\u81ea\u52a8\u6267\u884c\u90e8\u7f72\u4ee5\u83b7\u53d6\u955c\u50cf\u7684\u65b0\u7248\u672c\u3002<\/p>\n\n\n\n<p>\u4f46\u662f\uff0c\u5982\u679c\u90e8\u7f72\u6216\u6784\u5efa\u6240\u7528\u7684 imagestreamtag \u6ca1\u6709\u66f4\u65b0\uff0c\u5219\u5373\u4f7f\u66f4\u65b0\u4e86\u5bb9\u5668\u955c\u50cf registry \u4e2d\u7684\u5bb9\u5668\u955c\u50cf\uff0c\u6784\u5efa\u6216\u90e8\u7f72\u4ecd\u4f1a\u7ee7\u7eed\u4f7f\u7528\u4e4b\u524d\u7684\uff0c\u5df2\u77e5\u826f\u597d\u7684\u955c\u50cf\u3002<\/p>\n\n\n\n<p><strong>\u4ee5\u5e94\u7528\u4e3a\u4e2d\u5fc3<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1014\" height=\"720\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38.png\" alt=\"\" class=\"wp-image-14395\" style=\"width:480px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38.png 1014w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38-300x213.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38-768x545.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38-830x589.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38-230x163.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38-350x249.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-38-480x341.png 480w\" sizes=\"(max-width: 1014px) 100vw, 1014px\" \/><\/figure><\/div>\n\n\n<p>\u4ece\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa\uff0c\u76f8\u5bf9\u4e8e Kubernetes\uff0cOpenShift \u65b0\u589e\u7684\u5168\u90e8\u5185\u5bb9\u51e0\u4e4e\u90fd\u662f\u56f4\u7ed5\u7740 \u201c\u4ee5\u5e94\u7528\u4e3a\u4e2d\u5fc3\u201d \u7684\u4e3b\u9898\u6765\u5c55\u5f00\u7684\u3002<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><br>Souce to Image\uff08S2I\uff0c\u6e90\u4ee3\u7801\u5230\u955c\u50cf\uff09\uff1aOpenShift \u65b0\u589e\u7684\u4e00\u79cd\u6784\u5efa\u65b9\u5f0f\uff0c\u76f4\u63a5\u4ece\u9879\u76ee\u6e90\u4ee3\u7801\u548c\u57fa\u7840\u955c\u50cf\u81ea\u52a8\u6784\u5efa\u51fa\u5e94\u7528\u955c\u50cf\u3002<br><br>\u5185\u7f6e\u955c\u50cf\u4ed3\u5e93\uff1a\u7528\u4e8e\u4fdd\u5b58 S2I \u751f\u6210\u7684\u955c\u50cf\u3002<br><br>\u6784\u5efa\u914d\u7f6e\uff08BuildConfig\uff09\uff1a\u6784\u5efa\u7684\u9759\u6001\u5b9a\u4e49\uff0c\u5b9a\u4e49\u6784\u5efa\u7684\u6e90\u4ee3\u7801\u6765\u6e90\u3001\u57fa\u7840\u955c\u50cf\u3001\u751f\u4ea7\u955c\u50cf\u7b49\u3002\u6bcf\u6b21\u6267\u884c\u5373\u5f00\u59cb\u4e00\u6b21\u6784\u5efa\u8fc7\u7a0b\u3002<br><br>\u955c\u50cf\u6d41ImageStream\uff09\uff1a\u955c\u50cf\u6d41\u4e2d\u5305\u62ec\u4e00\u4e2a\u6216\u591a\u4e2a\u6807\u7b7e\uff0c\u6bcf\u4e2a\u6807\u7b7e\u6307\u5411\u4e00\u4e2a\u955c\u50cf\u3002\u955c\u50cf\u6d41\u53ef\u7528\u4e8e\u81ea\u52a8\u6267\u884c\u67d0\u4e9b\u64cd\u4f5c\uff0c\u6bd4\u5982\u5c06\u8bbe\u5b9a DeploymentConfig \u7684\u89e6\u53d1\u5668\u4e3a\u67d0\u955c\u50cf\u6d41\u6807\u7b7e\uff0c\u5f53\u8be5\u6807\u7b7e\u6240\u6307\u955c\u50cf\u53d1\u751f\u53d8\u5316\u65f6\uff0c\u5373\u53ef\u81ea\u52a8\u89e6\u53d1\u4e00\u6b21\u90e8\u7f72\u8fc7\u7a0b\u3002<br><br>\u90e8\u7f72\u914d\u7f6e\uff08DeploymentConfig\uff09\uff1a\u90e8\u7f72\u7684\u9759\u6001\u5b9a\u4e49\uff0c\u9664\u4e86\u5b9a\u4e49\u5f85\u90e8\u7f72\u7684 Pod \u5916\uff0c\u8fd8\u5b9a\u4e49\u4e86\u81ea\u52a8\u89e6\u53d1\u90e8\u7f72\u7684\u89e6\u53d1\u5668\u3001\u66f4\u65b0\u90e8\u7f72\u7684\u7b56\u7565\u7b49\u3002<br><br>\u8def\u7531\u89c4\u5219\uff08Route\uff09\uff1a\u5c06\u90e8\u7f72\u597d\u7684\u5e94\u7528\u670d\u52a1\u901a\u8fc7\u57df\u540d\u53d1\u5e03\u5230\u96c6\u7fa4\u5916\u4f9b\u7528\u6237\u8bbf\u95ee\u3002<\/pre>\n\n\n\n<p><strong>\u5e94\u7528\u6784\u5efa\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u57fa\u4e8e\u4e0a\u8ff0\u65b0\u589e\u529f\u80fd\uff0cOpenShift \u652f\u6301\u5982\u4e0b\u56fe\u6240\u793a\u7684\u5e94\u7528\u4ece\u6784\u5efa\u5230\u53d1\u5e03\u7684\u5168\u81ea\u52a8\u5316\u7684\u8fc7\u7a0b\uff1a<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1018\" height=\"416\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39.png\" alt=\"\" class=\"wp-image-14397\" style=\"width:502px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39.png 1018w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39-300x123.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39-768x314.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39-830x339.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39-230x94.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39-350x143.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-39-480x196.png 480w\" sizes=\"(max-width: 1018px) 100vw, 1018px\" \/><\/figure><\/div>\n\n\n<pre class=\"wp-block-preformatted\">\u521b\u5efa\u5e94\u7528\uff1aOpenShift \u7528\u6237\u901a\u8fc7 Web \u63a7\u5236\u53f0\u6216\u547d\u4ee4\u884c oc new-app \u6765\u521b\u5efa\u5e94\u7528\uff0c\u6839\u636e\u7528\u6237\u63d0\u4f9b\u7684\u6e90\u4ee3\u7801\u4ed3\u5e93\u5730\u5740\u53ca Builder \u955c\u50cf\uff0c\u5e73\u53f0\u5c06\u751f\u6210\u6784\u5efa\u914d\u7f6e\uff08Build Config\uff09\u3001\u90e8\u7f72\u914d\u7f6e\uff08Deployment Config\uff09\u3001\u955c\u50cf\u6d41\uff08Image Stream\uff09\u3001\u670d\u52a1\uff08Service\uff09\u548c\u8def\u7531\u5668\uff08Router\uff09\u7b49\u5bf9\u8c61\u3002<br><br>\u89e6\u53d1\u6784\u5efa\uff1a\u5e73\u53f0\u5b9e\u4f8b\u5316 BuildConfig \u7684\u4e00\u6b21\u6784\u5efa\uff0c\u751f\u6210\u4e00\u4e2a Build \u5bf9\u8c61\u3002Build \u5bf9\u8c61\u751f\u6210\u540e\uff0c\u5e73\u53f0\u5c06\u6267\u884c\u5177\u4f53\u7684 S2I \u6784\u5efa\u64cd\u4f5c\uff0c\u5305\u62ec\u4e0b\u8f7d\u6e90\u4ee3\u7801\u3001\u5b9e\u4f8b\u5316 Builder \u955c\u50cf\u3001\u6267\u884c\u7f16\u8bd1\u548c\u6784\u5efa\u811a\u672c\u7b49\u3002<br><br>\u751f\u6210\u955c\u50cf\uff1a\u6784\u5efa\u6210\u529f\u540e\u5c06\u751f\u6210\u4e00\u4e2a\u53ef\u90e8\u7f72\u7684\u5e94\u7528\u5bb9\u5668\u955c\u50cf\uff0c\u5e73\u53f0\u5c06\u628a\u6b64\u955c\u50cf\u63a8\u9001\u5230\u5185\u90e8\u7684\u955c\u50cf\u4ed3\u5e93\u4e2d\u3002<br><br>\u66f4\u65b0\u955c\u50cf\u6d41\uff08ImageStream\uff09\uff1a\u955c\u50cf\u63a8\u9001\u81f3\u5185\u90e8\u7684\u955c\u50cf\u4ed3\u5e93\u540e\uff0c\u5e73\u53f0\u5c06\u66f4\u65b0\u5e94\u7528\u7684 ImageStream \u4e2d\u7684\u955c\u50cf\u6d41\u6807\u7b7e\uff0c\u4f7f\u4e4b\u6307\u5411\u6700\u65b0\u7684\u955c\u50cf\u3002<\/pre>\n\n\n\n<p><strong>\u5e94\u7528\u90e8\u7f72\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u89e6\u53d1\u90e8\u7f72\uff1a\u5f53 ImageStream \u7684\u955c\u50cf\u4fe1\u606f\u66f4\u65b0\u540e\uff0c\u5c06\u89e6\u53d1 DeploymentConfig \u5bf9\u8c61\u8fdb\u884c\u4e00\u6b21\u90e8\u7f72\u64cd\u4f5c\u3002<\/p>\n\n\n\n<p>\u5b9e\u4f8b\u5316\u955c\u50cf\u90e8\u7f72\uff1aDeployment Config \u5bf9\u8c61\u8bb0\u5f55\u4e86\u5bf9\u8c61\u90e8\u7f72\u7684\u5b9a\u4e49\uff0c\u5e73\u53f0\u4f9d\u636e\u6b64\u914d\u7f6e\u5b9e\u4f8b\u5316\u4e00\u6b21\u90e8\u7f72\uff0c\u751f\u6210\u4e00\u4e2a Deploy \u5bf9\u8c61\u6765\u63a7\u5236\u548c\u8ddf\u8e2a\u6240\u9700\u90e8\u7f72\u7684 Pod \u7684\u72b6\u6001\u3002<\/p>\n\n\n\n<p>\u90e8\u7f72\u5bb9\u5668\uff1a\u5e73\u53f0\u90e8\u7f72\u5c06\u5b9e\u4f8b\u5316\u4e00\u4e2aReplication Controller\uff0c\u7528\u4ee5\u8c03\u5ea6\u5e94\u7528\u5bb9\u5668\u7684\u90e8\u7f72\u3002\u90e8\u7f72\u64cd\u4f5c\u751f\u6210\u7684 ReplicationController \u5bf9\u8c61\u4f1a\u8d1f\u8d23\u8c03\u5ea6\u5e94\u7528\u5bb9\u5668\u7684\u90e8\u7f72\uff0c\u5c06 Pod \u53ca\u5e94\u7528\u5bb9\u5668\u90e8\u7f72\u5230\u96c6\u7fa4\u7684\u8ba1\u7b97\u8282\u70b9\u4e2d\u3002<\/p>\n\n\n\n<p><strong>\u53d1\u5e03\/\u66f4\u65b0\u5e94\u7528\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p>\u53d1\u5e03\u5e94\u7528\uff1a\u8fd0\u884c oc expose svc\/mywebapp4 \u547d\u4ee4\uff0c\u751f\u6210\u7528\u6237\u901a\u8fc7\u6d4f\u89c8\u5668\u53ef\u8bbf\u95ee\u7684\u5e94\u7528\u57df\u540d\u3002\u4e4b\u540e\u7528\u6237\u5373\u53ef\u901a\u8fc7\u8be5\u57df\u540d\u8bbf\u95ee\u5e94\u7528\u3002 \u8bf7\u6c42\u5904\u7406\u5e76\u8fd4\u56de\uff1a\u5ba2\u6237\u7aef\u8bf7\u6c42\u5230 Router \u7ec4\u4ef6\u540e\uff0cRouter \u6839\u636e Route \u5b9a\u4e49\u7684\u89c4\u5219\uff0c\u627e\u5230\u8bf7\u6c42\u6240\u542b\u57df\u540d\u76f8\u5173\u8054\u7684 Service \u7684\u5bb9\u5668\uff0c\u5e76\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u5e94\u7528\u5bb9\u5668\u3002\u5bb9\u5668\u5b9e\u4f8b\u9664\u4e86\u8bf7\u6c42\u540e\u8fd4\u56de\u6570\u636e\uff0c\u8fd8\u4f1a\u901a\u8fc7 Router \u5c06\u6570\u636e\u8fd4\u56de\u7ed9\u8c03\u7528\u7684\u5ba2\u6237\u7aef<\/p>\n\n\n\n<p>\u8bf7\u6c42\u5904\u7406\u5e76\u8fd4\u56de\uff1a\u5ba2\u6237\u7aef\u8bf7\u6c42\u5230 Router \u7ec4\u4ef6\u540e\uff0cRouter \u6839\u636e Route \u5b9a\u4e49\u7684\u89c4\u5219\uff0c\u627e\u5230\u8bf7\u6c42\u6240\u542b\u57df\u540d\u76f8\u5173\u8054\u7684 Service \u7684\u5bb9\u5668\uff0c\u5e76\u5c06\u8bf7\u6c42\u8f6c\u53d1\u7ed9\u5e94\u7528\u5bb9\u5668\u3002\u5bb9\u5668\u5b9e\u4f8b\u9664\u4e86\u8bf7\u6c42\u540e\u8fd4\u56de\u6570\u636e\uff0c\u8fd8\u4f1a\u901a\u8fc7 Router \u5c06\u6570\u636e\u8fd4\u56de\u7ed9\u8c03\u7528\u7684\u5ba2\u6237\u7aef\u3002<\/p>\n\n\n\n<p>\u5e94\u7528\u66f4\u65b0\uff1a\u5f53\u66f4\u65b0\u5e94\u7528\u65f6\uff0c\u5e73\u53f0\u5c06\u91cd\u590d\u4e0a\u8ff0\u6b65\u9aa4\u3002\u5e73\u53f0\u5c06\u7528\u4e0b\u8f7d\u66f4\u65b0\u540e\u7684\u4ee3\u7801\u6784\u5efa\u5e94\u7528\uff0c\u751f\u6210\u65b0\u7684\u955c\u50cf\uff0c\u5e76\u5c06\u955c\u50cf\u90e8\u7f72\u81f3\u96c6\u7fa4\u4e2d\u3002OpenShit \u652f\u6301\u6eda\u52a8\u66f4\u65b0\uff0c\u4ee5\u4fdd\u8bc1\u5728\u8fdb\u884c\u65b0\u65e7\u5b9e\u4f8b\u4ea4\u66ff\u65f6\u5e94\u7528\u670d\u52a1\u4e0d\u4f1a\u95f4\u65ad\u3002<\/p>\n\n\n\n<p><strong>Pod \u542f\u52a8\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"677\" src=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-1024x677.png\" alt=\"\" class=\"wp-image-14398\" style=\"width:544px;height:auto\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-1024x677.png 1024w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-300x198.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-768x508.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-830x548.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-230x152.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-350x231.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40-480x317.png 480w, https:\/\/92it.top\/wp-content\/uploads\/2024\/04\/\u56fe\u7247-40.png 1026w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure><\/div>\n\n\n<p>\u5ba2\u6237\u7aef\u4f7f\u7528 HTTP\/HTTPS \u901a\u8fc7 API Server \u53d1\u9001\uff08POST\uff09YAML \u683c\u5f0f\u7684Pod Spec\u3002<\/p>\n\n\n\n<p>API Server \u5728 etcd \u4e2d\u521b\u5efa Pod Object \u5e76\u5c06 Spec \u4fdd\u5b58\u5230\u5176\u4e2d\u3002\u7136\u540e\uff0cAPI Server \u5411\u5ba2\u6237\u7aef\u8fd4\u56de\u521b\u5efa\u7ed3\u679c\u3002 Scheduler \u76d1\u63a7\u5230\u8fd9\u4e2a Pod Object \u7684\u521b\u5efa\u4e8b\u4ef6\uff0c\u5b83\u6839\u636e\u8c03\u5ea6\u7b97\u6cd5<\/p>\n\n\n\n<p>Scheduler \u76d1\u63a7\u5230\u8fd9\u4e2a Pod Object \u7684\u521b\u5efa\u4e8b\u4ef6\uff0c\u5b83\u6839\u636e\u8c03\u5ea6\u7b97\u6cd5\u51b3\u5b9a\u628a\u8fd9\u4e2a Pod \u7ed1\u5b9a\u5230 Node1\uff0c\u7136\u540e\u8c03\u7528 API Server \u5728 etcd \u4e2d\u5199\u5165\u8be5 Pod Object \u4e0e Node1 \u7684\u7ed1\u5b9a\u5173\u7cfb\u3002<\/p>\n\n\n\n<p>Node1 \u4e0a\u7684 kubelet \u76d1\u63a7\u5230\u6709\u4e00\u4e2a Pod \u88ab\u5206\u914d\u5230\u5b83\u6240\u5728\u7684\u8282\u70b9\u4e0a\uff0c\u4e8e\u662f\u8c03\u7528 Docker \u521b\u5efa\u5e76\u8fd0\u884c\u4e00\u4e2a Pod \u5b9e\u4f8b\uff0c\u7136\u540e\u8c03\u7528 API \u66f4\u65b0 etcd \u4e2d Pod Object \u7684\u72b6\u6001\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bb9\u5668\uff08Container\uff09 Container \u7684\u5b9e\u73b0\u57fa\u4e8e Linux Kernel \u7684 chroot\u3001nam [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10310"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=10310"}],"version-history":[{"count":10,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10310\/revisions"}],"predecessor-version":[{"id":14416,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/10310\/revisions\/14416"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=10310"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=10310"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=10310"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}