请选择 进入手机版 | 继续访问电脑版

技术控

    今日:10| 主题:54680
收藏本版 (1)
最新软件应用技术尽在掌握

[其他] That app you love, part 5: Upping our (cloud) game

[复制链接]
挑逗女人的心 发表于 2016-10-11 22:28:30
319 9

立即注册CoLaBug.com会员,免费获得投稿人的专业资料,享用更多功能,玩转个人品牌!

您需要 登录 才可以下载或查看,没有帐号?立即注册

x

That app you love, part 5: Upping our (cloud) game

That app you love, part 5: Upping our (cloud) game-1-技术控-containers,beginning,previous,security,Welcome
  That app you love, part 5: Upping our (cloud) game

   Posted byN. Harrison Ripps on October 11, 2016 October 11, 2016
   Welcome to the fifth installment of That App You Love , a blog series in which I show you how to you can make almost any app into a first-class cloud citizen. If you want to start from the beginning, jump back and check out Part 1: Making a Connection .
   The previous posts of this series have focused on how to package ZNC in a way that exposes run-time configurability into the immutable world of containers. But forget about ZNC – we’re really talking about That App You Love, and what it takes to make that app a secure , stateful and robust cloud resident.
  By introducing configurability to our app container image, we are priming the pump for security and statefulness. But what about robustness? Well, we really can’t go much further without a cloud to play around in, so…
  It’s Time To Get Our Cluster On

   For the rest of this blog series, we’re going to use the OpenShift Container Platform to go through the process of cloud-ifying our app. Why OpenShift? Well, I’m part of the OpenShift team, and it would be weird if I launched into directions on how to do this with cgroups, SSH, and Bash scripts. But also, I’m pretty sure OpenShift is the only full-lifecycle container platform that is a) built on the amazing power of Kubernetes orchestration and b) deployable with a single command.
  So without further ado:
  
       
  • If you don’t have docker installed, you’ll need that first. Shortcut for Fedora users:
    1. sudo dnf install docker
    复制代码
      
  • Even if you do have docker installed, you may need to change a line in the docker config file. OpenShift runs a docker registry internally on the 172.30.x.y subnet, and we need to let docker know that this registry is okay to use. Shortcut for Fedora users:
           
    • Open /etc/sysconfig/docker with root permissions in an editor:
      1. sudo gedit /etc/sysconfig/docker
      复制代码
         
    • Uncomment the INSECURE_REGISTRY line and change it to:
      1. INSECURE_REGISTRY='--insecure-registry 172.30.0.0/16'
      复制代码
         
    • Save file; start or restart docker:
      1. sudo systemctl restart docker
      复制代码
         
       
  • Download the latest OpenShift client. (If you’ve already installed the Red Hat Container Development Kit (CDK) , then you can skip this installation — OpenShift is already installed in your VM.) As of the time I wrote this, I was using v1.3.0-alpha.3, but any release after that will work as well:
    https://github.com/openshift/origin/releases/   (Click on a release title and scroll to the bottom of the page for binary downloads.)   
  • Unpack and move the oc binary to somewhere into your $PATH   
  • Run the magic command as root (required because this does docker operations):
    1. sudo <path_to>/oc cluster up
    复制代码
      
  • In the output from the “cluster up” command, look for an IP address / port number combination ending in port 8443. This is your OpenShift server. As your regular non-root user, log in with the “oc” utility:
    1. oc login -u developer -p developer --server=<server_IP>:8443
    复制代码
    You will need to accept the server’s self-signed certificate, and then you are all set!
      
   For a lot more detail on “oc cluster up”, check out these notes .
  What Have We Here?

  Assuming everything worked correctly, the following things are now true:
  
       
  • Running `oc whoami` should reveal that you are the ‘developer’ user   
  • In a web browser, navigating to the URL listed in the output of “oc cluster up” (the one ending in port 8443) should put you face to face with the OpenShift web console (after you accept the self-signed SSL certificate)  
  Let’s take a quick tour of the web console. After you log in with user: ‘developer’ and password ‘developer’, you should see a list of your “Projects”:
   

That app you love, part 5: Upping our (cloud) game

That app you love, part 5: Upping our (cloud) game-2-技术控-containers,beginning,previous,security,Welcome

  Projects are namespaces that can contain a number of related application components. When we deploy That App You Love, it will live in a Project along with all of the components that make it secure, stateful and robust.
   If you click into “My Project”, which is the project that the oc cluster up command creates for you, you’ll see that there isn’t much going on right now:
   

That app you love, part 5: Upping our (cloud) game

That app you love, part 5: Upping our (cloud) game-3-技术控-containers,beginning,previous,security,Welcome

   On the command line front, we can do a lot of the same things with the oc tool directly:
  
       
  • oc get projects – Tells us what projects are available to our current user account   
  • oc status – Tells us what is going on in our currently selected project.  
   We’ll learn more oc commands and their web console companion actions in the next part of our blog series.
  Leaving the Party

  When you are done experimenting with your portable cloud, you can take it down very easily with:
  1. sudo <path_to>/oc cluster down
复制代码
Alas, once again, the spectre of statelessness looms large! Because this whole experimental cloud environment lives entirely in containers, any work that we do there will be lost when we shut it all down. But no matter! Anything that works for us on our portable cloud will work equally well in any full-scale production OpenShift system.
   In the next post, we’ll get back to That App You Love, and learn about what we’ll need to get it up and running in our mini-cloud. See you in Part 6: Container, Meet Cloud !
  Thanks for reading!
  About the Author

   Hi there! My name is N. Harrison Ripps , and I am an engineer and people manager on the Containers team atRed Hat. Together with the greater open source community, our team has taken the combination of the docker container format and Google’s Kubernetes orchestration system, and then extended this framework with a number of administrator- and developer-friendly features that we call the  OpenShift Container Platform .
      JoinRed Hat Developers, a developer program for you to learn, share, and code faster – and get access to Red Hat software for your development.  The developer program and software are both free!



上一篇:The LLVM+SDCC toolchain
下一篇:开始使用运行在 Linux 上的的 MongoDB on IBM Power Systems
rondofu203 发表于 2016-10-12 01:36:06
有谁会在时过境迁之后还在那里等你。
回复 支持 反对

使用道具 举报

lywbill 发表于 2016-10-12 03:16:53
是爷们的娘们的都帮顶!大力支持
回复 支持 反对

使用道具 举报

63956706 发表于 2016-10-12 06:28:14
你女儿在我手上,我不是你女婿。
回复 支持 反对

使用道具 举报

程凤 发表于 2016-10-14 02:09:53
我们走得太快,灵魂都跟不上了……
回复 支持 反对

使用道具 举报

岚笑 发表于 2016-10-23 04:20:53
女为悦己者容男为悦己者穷!
回复 支持 反对

使用道具 举报

梁佳伟 发表于 2016-11-1 18:18:40
我擦!我要沙发!
回复 支持 反对

使用道具 举报

惜文 发表于 2016-11-15 11:48:13
画面太美我不敢看
回复 支持 反对

使用道具 举报

,,,。 发表于 2016-11-16 08:46:03
在乎的人不明白,明白的人不在乎。
回复 支持 反对

使用道具 举报

428586 发表于 2016-11-17 06:43:17
也许似乎大概是,然而未必不见得。
回复 支持 反对

使用道具 举报

*滑动验证:
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

我要投稿

推荐阅读


回页顶回复上一篇下一篇回列表
手机版/CoLaBug.com ( 粤ICP备05003221号 | 文网文[2010]257号 )

© 2001-2017 Comsenz Inc. Design: Dean. DiscuzFans.

返回顶部 返回列表