背景html
Openshift是一個開源容器雲平臺,是一個基於主流的容器技術Docker和Kubernetes構建的雲平臺。Openshift底層以Docker做爲容器引擎驅動,以Kubernetes 做爲容器編排引擎組件,並提供了開發語言,中間件,DevOps自動化流程工具和web console用戶界面等元素,提供了一套完整的基於容器的應用雲平臺。OpenShift 生態系統成了 Kubernetes 生態系統。其核心技術使生態系統能夠很是地靈活,社區已經在 API 和接口上作了標準化,這爲統一集成的新思想成爲了可能。它還使咱們能夠在任何雲平臺上部署 OpenShift,好比 AWS、 Azure、 GCP、 OpenStack、 VMware、 RHV,以及 bare meta。node
Openshift部署流程git
示例過程以下github
$ oc new-project project1
Now using project "project1" on server https://127.0.0.1:8443.
$ oc new-app centos/ruby-22-centos7~https://github.com/openshift/ruby-ex.git
--> Found Docker image 1f02469 (8 days old) from Docker Hub for "centos/ruby-22-centos7"
...
<output omitted>
...
* An image stream will be created as "ruby-22-centos7:latest" that will track the source image
* A source build using source code from https://github.com/openshift/ruby-ex.git will be created
* The resulting image will be pushed to image stream "ruby-ex:latest"
* Every time "ruby-22-centos7:latest" changes a new build will be triggered
* This image will be deployed in deployment config "ruby-ex"
* Port 8080/tcp will be load balanced by service "ruby-ex"
* Other containers can access this service through the hostname "ruby-ex"
...
<output omitted>
...
Run 'oc status' to view your app.
上面的過程發生了什麼:
再看下應用構建過程web
部署過程docker
POD管理數據庫
$ oc get pods
NAME READY STATUS RESTARTS AGE
ruby-ex-1-build 0/1 Completed 0 1h
ruby-ex-1-zzhrc 1/1 Running 0 56m
也能夠使用-o wide的輸出,咱們能夠看到pod所在結點與IP
$ oc get pod -o wide
NAME READY STATUS RESTARTS AGE IP NODE
docker-registry-11-vcqzz 1/1 Running 0 36d 10.128.0.244 openshift-node-01.hsh.io
hawkular-apm-1-8c2s8 1/1 Running 0 19h 10.131.8.186 openshift-node-17.hsh.io
hawkular-apm-es-1-ddrqt 1/1 Running 0 38d 10.130.1.53 openshift-master-03.hsh.io
registry-console-3-wptmh 1/1 Running 1 63d 10.128.8.11 openshift-node-14.hsh.io
router-32-bpzcx 1/1 Running 0 7d 10.108.78.134 openshift-master-02.hsh.io
router-32-cp9sj 1/1 Running 0 7d 10.108.78.136 openshift-node-01.hsh.io
router-32-dbd0g 1/1 Running 0 7d 10.108.78.138 openshift-node-03.hsh.io
router-32-f4b46 1/1 Running 0 7d 10.108.78.140 openshift-node-05.hsh.io
router-32-k8mpx 1/1 Running 0 7d 10.108.78.139 openshift-node-04.hsh.io
router-32-lhbrl 1/1 Running 0 7d 10.108.78.145 openshift-lb-02.hsh.io
router-32-psnbh 1/1 Running 0 7d 10.108.78.133 openshift-master-01.hsh.io
router-32-zqc7k 1/1 Running 0 7d 10.108.78.135 openshift-master-03.hsh.io
router-32-zv1kx 1/1 Running 0 7d 10.108.78.137 openshift-node-02.hsh.io
centos
Openshift部署容器過程安全
容器和 Kubernetes 提供了許多有價值的概念,適用於任何應用。容器能夠提供一種統一的應用打包方式,讓其在開發、測試、質保、準生產和生產環境中運行。它們帶來了不變性,可簡化運維團隊處理安全更新的方式。它們還能讓你在雲環境間進行移植。Kubernetes 和 OpenShift 之類的平臺能夠跨任意雲環境提供統一的、自動化的、可伸縮的環境(好比,多個雲環境)。ruby
若有想了解更多軟件設計與架構, 系統IT,企業信息化, 團隊管理 資訊,請關注個人微信訂閱號:
做者:Petter Liu
出處:http://www.cnblogs.com/wintersun/ 本文版權歸做者和博客園共有,歡迎轉載,但未經做者贊成必須保留此段聲明,且在文章頁面明顯位置給出原文鏈接,不然保留追究法律責任的權利。 該文章也同時發佈在個人獨立博客中-Petter Liu Blog。