{"id":5719,"date":"2022-05-09T11:02:53","date_gmt":"2022-05-09T03:02:53","guid":{"rendered":"http:\/\/123.57.164.21\/?p=5719"},"modified":"2022-05-09T11:02:53","modified_gmt":"2022-05-09T03:02:53","slug":"openshift%e9%83%a8%e7%bd%b2%e6%b5%81%e7%a8%8b%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=5719","title":{"rendered":"Openshift\u90e8\u7f72\u6d41\u7a0b\u4ecb\u7ecd"},"content":{"rendered":"\n<p><strong>\u80cc\u666f<\/strong><\/p>\n\n\n\n<p>Openshift\u662f\u4e00\u4e2a\u5f00\u6e90\u5bb9\u5668\u4e91\u5e73\u53f0\uff0c\u662f\u4e00\u4e2a\u57fa\u4e8e\u4e3b\u6d41\u7684\u5bb9\u5668\u6280\u672fDocker\u548cKubernetes\u6784\u5efa\u7684\u4e91\u5e73\u53f0\u3002Openshift\u5e95\u5c42\u4ee5Docker\u4f5c\u4e3a\u5bb9\u5668\u5f15\u64ce\u9a71\u52a8\uff0c\u4ee5Kubernetes \u4f5c\u4e3a\u5bb9\u5668\u7f16\u6392\u5f15\u64ce\u7ec4\u4ef6\uff0c\u5e76\u63d0\u4f9b\u4e86\u5f00\u53d1\u8bed\u8a00\uff0c\u4e2d\u95f4\u4ef6\uff0cDevOps\u81ea\u52a8\u5316\u6d41\u7a0b\u5de5\u5177\u548cweb console\u7528\u6237\u754c\u9762\u7b49\u5143\u7d20\uff0c\u63d0\u4f9b\u4e86\u4e00\u5957\u5b8c\u6574\u7684\u57fa\u4e8e\u5bb9\u5668\u7684\u5e94\u7528\u4e91\u5e73\u53f0\u3002OpenShift \u751f\u6001\u7cfb\u7edf\u6210\u4e86 Kubernetes \u751f\u6001\u7cfb\u7edf\u3002\u5176\u6838\u5fc3\u6280\u672f\u4f7f\u751f\u6001\u7cfb\u7edf\u53ef\u4ee5\u975e\u5e38\u5730\u7075\u6d3b\uff0c\u793e\u533a\u5df2\u7ecf\u5728 API \u548c\u63a5\u53e3\u4e0a\u505a\u4e86\u6807\u51c6\u5316\uff0c\u8fd9\u4e3a\u7edf\u4e00\u96c6\u6210\u7684\u65b0\u601d\u60f3\u6210\u4e3a\u4e86\u53ef\u80fd\u3002\u5b83\u8fd8\u4f7f\u6211\u4eec\u53ef\u4ee5\u5728\u4efb\u4f55\u4e91\u5e73\u53f0\u4e0a\u90e8\u7f72 OpenShift\uff0c\u6bd4\u5982 AWS\u3001 Azure\u3001 GCP\u3001 OpenStack\u3001 VMware\u3001 RHV\uff0c\u4ee5\u53ca bare meta\u3002<\/p>\n\n\n\n<p><strong>Openshift\u90e8\u7f72\u6d41\u7a0b<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188.png\" alt=\"\" class=\"wp-image-5720\" width=\"639\" height=\"481\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188.png 923w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188-300x226.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188-768x579.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188-830x626.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188-230x173.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188-350x264.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105205293-312625188-480x362.png 480w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u793a\u4f8b\u8fc7\u7a0b\u5982\u4e0b<\/strong><\/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=\"\">$ oc new-project project1\nNow using project \"project1\" on server https:\/\/127.0.0.1:8443.\n<\/pre>\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=\"\">$ oc new-app centos\/ruby-22-centos7~https:\/\/github.com\/openshift\/ruby-ex.git\n--> Found Docker image 1f02469 (8 days old) from Docker Hub for \"centos\/ruby-22-centos7\"\n...\n&lt;output omitted>\n...\n * An image stream will be created as \"ruby-22-centos7:latest\" that will track the source image\n * A source build using source code from https:\/\/github.com\/openshift\/ruby-ex.git will be created\n * The resulting image will be pushed to image stream \"ruby-ex:latest\"\n * Every time \"ruby-22-centos7:latest\" changes a new build will be triggered\n * This image will be deployed in deployment config \"ruby-ex\"\n * Port 8080\/tcp will be load balanced by service \"ruby-ex\"\n * Other containers can access this service through the hostname \"ruby-ex\"\n...\n&lt;output omitted>\n...\n Run 'oc status' to view your app.<\/pre>\n\n\n\n<p><strong>\u4e0a\u9762\u7684\u8fc7\u7a0b\u53d1\u751f\u4e86\u4ec0\u4e48\uff1a<\/strong><\/p>\n\n\n\n<ul><li>OpenShift pulls Docker image <kbd>centos\/ruby-22-centos7<\/kbd><\/li><li>OpenShift \u4ece GitHub \u4e0b\u8f7d\u4e86\u6e90\u4ee3\u7801<\/li><li>OpenShift applies GitHub \u6e90\u4ee3\u7801\u8f6c\u6362\u4e3aimage, \u547d\u540d\u4e3a<kbd>ruby-ex\u5b58\u50a8\u4e8e\u5185\u90e8\u4ed3\u5e93\u4e2d<\/kbd><\/li><li><kbd>ruby-ex<\/kbd> \u7528\u6765\u521b\u5efabuild and deployment configurations<\/li><li>The <kbd>ruby-ex<\/kbd> service \u4e3a\u4e86pod\u8d1f\u8f7d\u5747\u8861\uff0c\u4f7f\u7528&nbsp; <kbd>ruby-ex<\/kbd> \u8fd9\u4e2a\u540d\u79f0<\/li><\/ul>\n\n\n\n<p><strong>\u518d\u770b\u4e0b\u5e94\u7528\u6784\u5efa\u8fc7\u7a0b<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202.png\" alt=\"\" class=\"wp-image-5723\" width=\"593\" height=\"680\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202.png 798w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202-262x300.png 262w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202-768x881.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202-230x264.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202-350x401.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105206645-420676202-480x550.png 480w\" sizes=\"(max-width: 593px) 100vw, 593px\" \/><\/figure><\/div>\n\n\n\n<p><strong>\u90e8\u7f72\u8fc7\u7a0b<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358.png\" alt=\"\" class=\"wp-image-5724\" width=\"639\" height=\"630\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358.png 868w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358-300x296.png 300w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358-768x757.png 768w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358-830x819.png 830w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358-230x227.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358-350x345.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208039-1615436358-480x473.png 480w\" sizes=\"(max-width: 639px) 100vw, 639px\" \/><\/figure><\/div>\n\n\n\n<p><strong>POD\u7ba1\u7406<\/strong><\/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=\"\">$ oc get pods\nNAME            READY  STATUS    RESTARTS      AGE\nruby-ex-1-build  0\/1   Completed   0           1h\nruby-ex-1-zzhrc  1\/1   Running     0           56m\n<\/pre>\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=\"\">\u4e5f\u53ef\u4ee5\u4f7f\u7528-o wide\u7684\u8f93\u51fa\uff0c\u6211\u4eec\u53ef\u4ee5\u770b\u5230pod\u6240\u5728\u7ed3\u70b9\u4e0eIP\n\n$ oc get pod -o wide\nNAME                       READY     STATUS    RESTARTS   AGE       IP              NODE\ndocker-registry-11-vcqzz   1\/1       Running   0          36d       10.128.0.244    openshift-node-01.hsh.io\nhawkular-apm-1-8c2s8       1\/1       Running   0          19h       10.131.8.186    openshift-node-17.hsh.io\nhawkular-apm-es-1-ddrqt    1\/1       Running   0          38d       10.130.1.53     openshift-master-03.hsh.io\nregistry-console-3-wptmh   1\/1       Running   1          63d       10.128.8.11     openshift-node-14.hsh.io\nrouter-32-bpzcx            1\/1       Running   0          7d        10.108.78.134   openshift-master-02.hsh.io\nrouter-32-cp9sj            1\/1       Running   0          7d        10.108.78.136   openshift-node-01.hsh.io\nrouter-32-dbd0g            1\/1       Running   0          7d        10.108.78.138   openshift-node-03.hsh.io\nrouter-32-f4b46            1\/1       Running   0          7d        10.108.78.140   openshift-node-05.hsh.io\nrouter-32-k8mpx            1\/1       Running   0          7d        10.108.78.139   openshift-node-04.hsh.io\nrouter-32-lhbrl            1\/1       Running   0          7d        10.108.78.145   openshift-lb-02.hsh.io\nrouter-32-psnbh            1\/1       Running   0          7d        10.108.78.133   openshift-master-01.hsh.io\nrouter-32-zqc7k            1\/1       Running   0          7d        10.108.78.135   openshift-master-03.hsh.io\nrouter-32-zv1kx            1\/1       Running   0          7d        10.108.78.137   openshift-node-02.hsh.io<\/pre>\n\n\n\n<p><strong>Openshift\u90e8\u7f72\u5bb9\u5668\u8fc7\u7a0b<\/strong><\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/123.57.164.21\/wp-content\/uploads\/2022\/05\/15172-20200104105208686-1852225282.png\" alt=\"\" class=\"wp-image-5725\" width=\"506\" height=\"620\" srcset=\"https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208686-1852225282.png 627w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208686-1852225282-245x300.png 245w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208686-1852225282-230x282.png 230w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208686-1852225282-350x429.png 350w, https:\/\/92it.top\/wp-content\/uploads\/2022\/05\/15172-20200104105208686-1852225282-480x588.png 480w\" sizes=\"(max-width: 506px) 100vw, 506px\" \/><\/figure><\/div>\n\n\n\n<p>\u5bb9\u5668\u548c Kubernetes \u63d0\u4f9b\u4e86\u8bb8\u591a\u6709\u4ef7\u503c\u7684\u6982\u5ff5\uff0c\u9002\u7528\u4e8e\u4efb\u4f55\u5e94\u7528\u3002\u5bb9\u5668\u53ef\u4ee5\u63d0\u4f9b\u4e00\u79cd\u7edf\u4e00\u7684\u5e94\u7528\u6253\u5305\u65b9\u5f0f\uff0c\u8ba9\u5176\u5728\u5f00\u53d1\u3001\u6d4b\u8bd5\u3001\u8d28\u4fdd\u3001\u51c6\u751f\u4ea7\u548c\u751f\u4ea7\u73af\u5883\u4e2d\u8fd0\u884c\u3002\u5b83\u4eec\u5e26\u6765\u4e86\u4e0d\u53d8\u6027\uff0c\u53ef\u7b80\u5316\u8fd0\u7ef4\u56e2\u961f\u5904\u7406\u5b89\u5168\u66f4\u65b0\u7684\u65b9\u5f0f\u3002\u5b83\u4eec\u8fd8\u80fd\u8ba9\u4f60\u5728\u4e91\u73af\u5883\u95f4\u8fdb\u884c\u79fb\u690d\u3002Kubernetes \u548c OpenShift \u4e4b\u7c7b\u7684\u5e73\u53f0\u53ef\u4ee5\u8de8\u4efb\u610f\u4e91\u73af\u5883\u63d0\u4f9b\u7edf\u4e00\u7684\u3001\u81ea\u52a8\u5316\u7684\u3001\u53ef\u4f38\u7f29\u7684\u73af\u5883\uff08\u6bd4\u5982\uff0c\u591a\u4e2a\u4e91\u73af\u5883\uff09\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u80cc\u666f Openshift\u662f\u4e00\u4e2a\u5f00\u6e90\u5bb9\u5668\u4e91\u5e73\u53f0\uff0c\u662f\u4e00\u4e2a\u57fa\u4e8e\u4e3b\u6d41\u7684\u5bb9\u5668\u6280\u672fDocker\u548cKubernetes\u6784\u5efa\u7684 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5719"}],"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=5719"}],"version-history":[{"count":5,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5719\/revisions"}],"predecessor-version":[{"id":5728,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/5719\/revisions\/5728"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5719"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5719"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5719"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}