CloudFoundry-如何了解应用程序的操作系统(OS)环境? [英] CloudFoundry - How to understand the operating system(OS) environment of an app?

查看:124
本文介绍了CloudFoundry-如何了解应用程序的操作系统(OS)环境?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用带有以下清单文件的cf push将Java应用程序推送到Cloud Foundry上

We push a java app on cloud foundry using cf push with below manifest file

    applications: 
       - name: xyz-api 
         instances: 1 
         memory: 1G 
         buildpack: java_buildpack_offline 
         path: target/xyz-api-0.1-SNAPSHOT.jar


我了解到,PAAS(例如:Cloud Foundry)是IAAS(例如,托管Linux和Windows VM的vcenter)之上的一层.


I understand that, PAAS (ex: cloud foundry) is a layer on top of IAAS(ex:vcenter hosting linux and windows VM's).

在清单文件中,buildpack仅讨论运行应用程序所需的用户空间运行时库.

In manifest file, buildpack just talks about userspace runtime libraries required to run an app.

来自非云背景,并且阅读了此清单文件,我想了解...

Coming from non-cloud background, and reading this manifest file, I would like to understand...

1)如何了解应用程序正在运行的操作系统(OS)环境?在哪个操作系统上...

1) How to understand the operating system(OS) environment, that an app is running? On which operating system...

2)在bosh实例上运行的应用程序与docker容器有何不同?

2) How app running on bosh instance different from docker container?

推荐答案

1)如何了解应用程序正在运行的操作系统(OS)环境?在哪个操作系统上...

1) How to understand the operating system(OS) environment, that an app is running? On which operating system...

堆栈确定您的应用程序将在其上运行的操作系统.清单中有一个stack属性,或者您可以使用cf push -s指示堆栈.

The stack determines the operating system on which your app will run. There is a stack attribute in the manifest or you can use cf push -s to indicate the stack.

您可以运行cf stacks来查看所有可用的堆栈.

You can run cf stacks to see all available stacks.

在撰写本文时,在大多数环境中,您将拥有cflinuxfs2.这是Ubuntu Trusty 14.04.它会被cflinuxfs3所取代,后者是Ubuntu Bionic 18.04,因为Trusty仅支持到2019年4月.尽管您始终会有一些cflinuxfs*堆栈,但数量会根据阅读本文的时间而有所不同.

In most environments at the time of writing, you will have cflinuxfs2. This is Ubuntu Trusty 14.04. It will be replaced by cflinuxfs3 which is Ubuntu Bionic 18.04, because Trusty is only supported through April of 2019. You will always have some cflinuxfs* stack though, the number will just vary depending on when you read this.

在某些环境中,您可能还具有基于Windows的堆栈.原始的基于Windows的堆栈是windows2012r2.在我撰写本文时,这已经很老了,所以您可能再也看不到它了.您可能会看到的是windows2016或更新的内容,具体取决于您何时阅读.

In some environments you might also have a Windows based stack. The original Windows based stack is windows2012r2. This is quite old as I write this so you probably won't see it any more. What you're likely to see is windows2016 or possibly something even newer depending on when you read this.

如果您需要更多控制权,可以随时推送Docker容器.这样一来,您就可以为应用选择完整的操作系统映像.

If you need more control than that, you can always push a docker container. That would let you pick the full OS image for your app.

2)在bosh实例上运行的应用程序与docker容器有何不同?

2) How app running on bosh instance different from docker container?

运行在Cloud Foundry上的应用程序不是由BOSH直接部署的.该应用程序在容器中运行.该容器是由迭戈安排和运行的. Diego是BOSH部署的VM.因此,其中还有一个额外的层.

Apps running on Cloud Foundry aren't deployed by BOSH directly. The app runs in a container. The container is scheduled and run by Diego. Diego is a BOSH deployed VM. So there's an extra layer in there.

从根本上讲,在Cloud Foundry上运行应用程序与在Docker容器中运行应用程序之间的差异很小.它们都在Linux容器"中运行,内核名称空间&限制了Linux的容器". cgroups.

At the core, the difference between running your app on Cloud Foundry and running an app in a docker container is minimal. They both run in a Linux "container" which has limitations put on it by kernel namespaces & cgroups.

区别在于a.)如何构建容器和b.)容器的部署方式.

The difference comes in a.) how you build the container and b.) how the container is deployed.

使用Cloud Foundry,您无需构建容器.您将您的应用程序提供给CF& CF基于所选堆栈和buildpacks添加的其他软件来构建容器映像. CF术语中的输出称为液滴",但它基本上是OCI映像(对于buildpacks v3来说更是如此).当您需要升级或添加新代码时,只需重复该过程并再次推送即可.堆栈和buildpack(由平台自动更新)将依次为您提供修补后的&最新的应用图片.

With Cloud Foundry, you don't build the container. You provide your app to CF & CF builds the container image based on the selected stack and the additional software added by buildpacks. The output in CF terminology is called a "droplet", but it basically an OCI image (this will be even more so with buildpacks v3). When you need to upgrade or add new code, you just repeat the process and push again. The stack and buildpacks, which are automatically updated by the platform, will in turn provide you with a patched & up-to-date app image.

使用Docker,您可以手动创建映像,从头开始或从某些受信任的基本映像建立它.您添加自己的运行时&应用程序代码.当您需要升级时,就可以从基本映像中提取更新了.运行时或更糟糕的是更新从头开始的映像.

With Docker, you manually create your image building it up from scratch or from some trusted base image. You add you own runtimes & application code. When you need to upgrade, that's on you to pull in updates from the base image & runtimes or worse to update your from-scratch image.

在部署时,CF会自动为您处理所有这一切.它可以运行您想要的&应用程序的任意数量的实例.它将自动放置这些内容,以便您的应用程序能够抵抗基础架构和应用程序的故障.在CF中.

When it comes to deployment, CF handles this all for you automatically. It can run any number of instance of your app that you'd like & it will automatically place those so that your app is resilient to failures in the infrastructure & in CF.

有了Docker,您就可以使用它,或者越来越多地使用Kubernetes之类的其他工具.

With Docker, that's on you or increasingly often on some other tool like Kubernetes.

希望有帮助!

这篇关于CloudFoundry-如何了解应用程序的操作系统(OS)环境?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆