背景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。