Cloud Foundry

Configuration

Adding PCF Cloud From Infrastructure -> Clouds

  1. Navigate to Infrastructure -> Clouds

  2. Select + ADD

  3. Select CLOUD FOUNDRY from the Clouds list

  4. Select NEXT

  5. Populate the following:

    Name

    Name of the Cloud in Morpheus

    Location

    Description field for adding notes on the cloud, such as location.

    Visibility

    For setting cloud permissions in a multi-tenant environment. Not applicable in single tenant environments.

    API URL

    Cloud Foundry API Url

    CLIENT ID

    Typically cf

    CLIENT SECRET

    Typically blank

    USERNAME

    Enter Username. If using an API Key, enter apikey for username, and the API Key as the password.

    PASSWORD

    Enter Password. If using an API Key, the API Key as the password.

    ORGANIZATION

    Select Organization. Dropdown populates upon successful authorization.

  6. Select NEXT .. include:: /integration_guides/Clouds/advanced_options.rst

  7. Select NEXT

  8. Select an existing or create a new Group to add the Cloud to. The Cloud can be added to additional Groups in a Groups Clouds tab.

  9. Select NEXT

  10. Review and then Select COMPLETE

Adding PCF Cloud From Infrastructure -> Groups

  1. Navigate to Infrastructure -> Groups

  2. Select a Group

  3. Select the CLOUDS tab

  4. Scroll down to CLOUD FOUNDRY and select + ADD

  5. Populate the following:

    Name

    Name of the Cloud in Morpheus

    Location

    Description field for adding notes on the cloud, such as location.

    Visibility

    For setting cloud permissions in a multi-tenant environment. Not applicable in single tenant environments.

    TENANT

    Select a Tenant if Visibility is set to Private to assign to Cloud to that Tenant. Multiple Tenants can be added by editing the cloud after creation.

    API URL

    Cloud Foundry API Url. Example https://api.cf.morpheusdata.com

    CLIENT ID

    Typically cf

    CLIENT SECRET

    Typically blank

    USERNAME

    Enter Username. If using an API Key, enter apikey for username, and the API Key as the password.

    PASSWORD

    Enter Password. If using an API Key, the API Key as the password.

    ORGANIZATION

    Select Organization. Dropdown populates upon successful authorization.

    DOMAIN

    Specify a default domain for instances provisioned to this Cloud.

    SCALE PRIORITY

    Specifies the priority with which an instance will scale into the cloud. A lower priority number means this cloud integration will take scale precedence over other cloud integrations in the group.

    APPLIANCE URL

    Alternate Appliance url for scenarios when the default Appliance URL (configured in admin -> settings) is not reachable or resolvable for Instances provisioned in this cloud. The Appliance URL is used for Agent install and reporting.

    TIME ZONE

    Configures the time zone on provisioned VM’s if necessary.

    DATACENTER ID

    Used for differentiating pricing among multiple datacenters. Leave blank unless prices are properly configured.

    NETWORK MODE

    Unmanaged or Managed

    SECURITY MODE

    Defines if Morpheus will control local firewall of provisioned servers and hosts.

    Important

    When local firewall management is enabled, Morpheus will automatically set an IP table rule to allow incoming connections on tcp port 22 from the Morpheus Appliance.

    STORAGE MODE

    Single Disk, LVM or Clustered

    GUIDANCE

    Enable Guidance recommendations on cloud resources.

    DNS INTEGRATION

    Records for instances provisioned in this cloud will be added to selected DNS integration.

    SERVICE REGISTRY

    Services for instances provisioned in this cloud will be added to selected Service Registry integration.

    CONFIG MANAGEMENT

    Select a Chef, Salt, Ansible or Puppet integration to be used with this Cloud.

    CMDB

    Select CMDB Integraiton to automatically update selected CMDB.

    AGENT INSTALL MODE
    • SSH / WINRM: Morpheus will use SSH or WINRM for Agent install.
    • Cloud-Init (when available): Morpheus will utilize Cloud-Init or Cloudbase-Init for agent install when provisioning images with Cloud-Init/Cloudbase-Init installed. Morpheus will fall back on SSH or WINRM if cloud-init is not installed on the provisioned image.
    API PROXY

    Required when a Proxy Server blocks communication between the Morpheus Appliance and the Cloud. Proxies can be added in the Infrastructure -> Networks -> Proxies tab.

    PROXY

    Required when a Proxy Server blocks communication between an Instance and the Morpheus Appliance. Proxies can be added in the Infrastructure -> Networks -> Proxies tab.

    Bypass Proxy for Appliance URL

    Enable to bypass proxy settings (if added) for Instance Agent communication to the Appliance URL.

    USER DATA (LINUX)

    Add cloud-init user data or scripts. Assumes bash syntax.

  6. Select NEXT

  7. Review and then Select COMPLETE

Adding Spaces

Cloud Foundry Spaces are referred to as Resource Pools in Morpheus. You can add a new Space by:

  1. Navigating to the Cloud and selecting the Resources tab.
  2. Then, click :guilabel:‘+ Add Resource’.
  3. Give the Resource a Name
  4. Expand the Managers, Developers, and Auditors section to add specific Cloud Foundry users to the roles. When adding a user to these sections, use their Cloud Foundry email addresses.

Provisioning

Morpheus automatically seeds MySQL, Redis and RabbitMQ PCF Instance Types, as well as a generic Cloud Foundry Instance Type that will create a shell app used in conjunction with deployments. PCF Marketplace items can also be added to the Provisioning Library in the Cloud detail view Marketplace tab. The Marketplace item will be added to the selected Instance Type and available when selecting the Cloud Foundry Cloud during Instance or App Template creation.

Deployments

The Cloud Foundry App Instance Type is used in conjunction with deployments. Users do not have to pick deployment when creating a Cloud Foundry App Instance Type, but then Instance will only be a shell of a Cloud Foundry Application.

A deployment in Morpheus can either point to a git hub repository or contain the actual manifest.yml and associated artifacts required for a Cloud Foundry deployment. During the deployment, Morpheus will gather up the files required. Therefore, if the deployment points to a git hub repository, Morpheus will fetch the files from git hub. Once the files are obtained, Morpheus will deploy the artifacts in a similar fashion to the Cloud Foundry cli. This includes parsing the manifest to obtain the parameters to create or update the Cloud Foundry application. Morpheus will ignore certain fields such as memory and disk size because they are dictated by the selected plan. Other fields are utilized such as routes. After parsing the manifest.yml file (including overwriting certain fields), Morpheus is ready to update or create the App in Cloud Foundry.

After the App is configured, the artifacts references in the Morpheus deployment are uploaded to Cloud Foundry for the App. Note that when paths are referenced in the manifest.yml file, the paths continue to be relative to the manifest. So, a jar file under build/libs would need to be found under the build/libs directory.

If Cloud Foundry services are specified in the manifest, they must already exist within Cloud Foundry. Morpheus App templates can be utilized to wire up Cloud Foundry services created by Morpheus. In this case, Morpheus will add all of the included service names defined in the App template to the manifest.yml services section. Therefore, multiple services can be used and wired up by Morpheus.”

Example

To better understand how Morpheus parses the manifest.yml file, lets take a closer look at the Cloud Foundry ‘spring-music’ project. The project can be found here (https://github.com/cloudfoundry-samples/spring-music).

The project contains the required manifest.yml file as well as the source code and build.gradle file to define how the project is to be built. After downloading the project to your local machine, build the project to generate the jar.

Now, let’s take a look at the manifest.yml file:

---
applications:
- name: spring-music
  memory: 1G
  random-route: true
  path: build/libs/spring-music.jar

Using the Cloud Foundry docs (https://docs.cloudfoundry.org/devguide/deploy-apps/manifest.html), we can gain a better understanding of how this file is utilized by Cloud Foundry.

  • The -name parameter defines the name that will be given to the application in Cloud Foundry. Morpheus will overwrite this value with the name given to the Instance being created in Morpheus.
  • The -memory parameter (as well as the disk_quota parameter if specified) will be overwritten by Morpheus based on the plan specified for the Instance.
  • The -path parameter defines, where relative to the manifest.yml file, your Cloud Foundry application can be found.
  • The -random-route parameter, as well as all other parameters described in the Cloud Foundry documentation will simply be passed through to Cloud Foundry.

Adding Marketplace Items

  1. Navigate to Infrastructure -> Clouds and select your Cloud Foundry Cloud
  2. Select the MARKETPLACE tab
  3. Select + ADD MARKETPLACE ITEM
  4. Select the Morpheus Instance Type to add the Marketplace Item to.
  5. Enter version
  6. Search for and select Marketplace Item
  7. Select SAVE CHANGES

A Node Type and layout will be created in the Provisioning -> Library section and the layout will be automatically added to the Instance Type selected when adding the Marketplace Item.

Provisioning Instances

Morpheus automatically seeds MySQL, Redis and RabbitMQ PCF Instance Types, and PCF Marketplace items can also be easily added to the Provisioning Library in the Cloud detail view Marketplace tab. The Marketplace item will be added to the selected Instance Type and available when selecting the Cloud Foundry Cloud during Instance or App Template creation.

  1. Navigate to `Provisioning -> Instances and select an Instance Type with a Cloud Foundry layout (MySQL, Redis and RabbitMQ plus Marketplace additions)
  2. Select NEXT
  3. Select a Group and PCF Cloud
  4. Add an Instance Name
  5. Optionally select and Environment Tag and/or add a custom Tag
  6. Select NEXT
  7. Select Version and Instance Configuration for a Cloud Foundry layout, ex: Cloud Foundry MySQL
  8. Select a Plan and available options for the Plan, or use the custom Plan
  9. Select a Space to add the Instance to
  10. Optionally configure advanced options
  11. Select NEXT
  12. Optionally configure Automation options
  13. Select NEXT
  14. Select COMPLETE

Note

Compute, Memory, and CPU stats will be pulled, and a Cloud Foundry monitoring health check will be automatically configured for the instance.

Important

Add Deployments in Provisioning -> Deployments to be used when provisioning a Cloud Foundry App Instance Type.

Note

Minimal options are outlined below.

  1. Navigate to `Provisioning -> Instances and select the Cloud Foundry App Instance Type

  2. Select NEXT

  3. Select a Group and PCF Cloud

  4. Add an Instance Name

  5. Optionally select and Environment Tag and/or add a custom Tag

  6. Select NEXT

  7. Select a Plan and available options for the Plan, or use the custom Plan

  8. Select a Space to add the Instance to

  9. Select NEXT

  10. In the Deployments section, select a Deployment and Version to be deployed. These can be git repos or files added in Provisioning -> Deployments

    Important

    If services are specified in a git repo manifest, Morpheus assumes they are already exist in the PCF cloud with matching names.

  11. Select NEXT

  12. Select COMPLETE

This will quickly create the Cloud Foundry Application, and then the deployment will follow which may take longer depending on the app configuration. The location will be updated with the route once it is configured.

Note

Compute, Memory, and CPU stats will be pulled, and a Cloud Foundry monitoring health check will be automatically configured for the instance.