Cloud Foundry explained

后端 未结 4 1197
广开言路
广开言路 2021-01-30 01:34

So I\'ve been reading up on Cloud Foundry and yet I\'m still confused as to what it is. Here is my take anyway on PaaS on CF, and hopefully you guys could tell me if I\'m wrong

4条回答
  •  無奈伤痛
    2021-01-30 02:20

    would like to add this as a comment regarding API to Andy's answer but unfortunately do not have enough reputation to do it. As far as I understand Cloud Foundry really has no specific API, but it provides a lot of useful information via environment variables (e.g. VCAP_SERVICES, VCAP_APPLICATION, VCAP_CONSOLE_IP, VCAP_APP_PORT), that can be accessed from any language or framework. While a lot of info from such variables are internal to Cloud Foundry, some of them might be quite useful. The main one is VCAP_SERVICES that provides information about services, that are bound to your app.

    For example, if I would like to gather information about Azure Cloud Service instance (say, its ID), on which my app is currently running, I would use this class from Azure Management Library.

    In its turn Cloud Foundry provides VCAP_APPLICATION env. variable, which will contain following fields:

    {"application_users": [],
    "instance_id":"97467a9cf508cb75273284b948b6319b",
    "instance_index":1,
    "application_version":"330b7caf-50e5-48f4-8792-1c80a90b06f1",
    "application_name":"helloworld",
    "application_uris":["helloworld.vcap.me"],
    "started_at":"2013-07-22 10:58:16 +0300",
    "started_at_timestamp":1374479896,
    "host":"0.0.0.0",
    "port":61014,
    "limits":{"mem":256,"disk":1024,"fds":16384},
    "version":"330b7caf-50e5-48f4-8792-1c80a90b06f1",
    "name":"helloworld",
    "uris":["helloworld.vcap.me"],
    "users":[],
    "start":"2013-07-22 10:58:16 +0300",
    "state_timestamp":1374479896}
    

    And, finally, a few words about logs, monitoring and diagnostic. This is currently not implemented on CF PaaS level, however I hope this will be implemented (as it is a really useful feature) and maybe some new env. variables (say VCAP_LOGS, VCAP_PERFORMANCE_COUNTERS) will be exposed to our apps.

提交回复
热议问题