Cloud Foundry¶
Configuration¶
Adding PCF Cloud From Infrastructure -> Clouds¶
Navigate to
Infrastructure -> CloudsSelect + ADD
Select CLOUD FOUNDRY from the Clouds list
Select NEXT
Populate the following:
- Name
Name of the Cloud in Conduit
- 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
apikeyfor 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.
Select NEXT .. include:: /integration_guides/Clouds/advanced_options.rst
Select NEXT
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.
Select NEXT
Review and then Select COMPLETE
Adding PCF Cloud From Infrastructure -> Groups¶
Navigate to
Infrastructure -> GroupsSelect a Group
Select the CLOUDS tab
Scroll down to CLOUD FOUNDRY and select + ADD
Populate the following:
- Name
Name of the Cloud in Conduit
- 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.conduitdata.com- CLIENT ID
Typically
cf- CLIENT SECRET
Typically blank
- USERNAME
Enter Username. If using an API Key, enter
apikeyfor 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 Conduit will control local firewall of provisioned servers and hosts.
Important
When local firewall management is enabled, Conduit will automatically set an IP table rule to allow incoming connections on tcp port 22 from the Conduit 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 Integration to automatically update selected CMDB.
- AGENT INSTALL MODE
- SSH / WINRM: Conduit will use SSH or WINRM for Agent install.
- Cloud-Init (when available): Conduit will utilize Cloud-Init or Cloudbase-Init for agent install when provisioning images with Cloud-Init/Cloudbase-Init installed. Conduit 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 Conduit 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 Conduit 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.
Select NEXT
Review and then Select COMPLETE
Adding Spaces¶
Cloud Foundry Spaces are referred to as Resource Pools in Conduit. You can add a new Space by:
- Navigating to the Cloud and selecting the Resources tab.
- Then, click :guilabel:‘+ Add Resource’.
- Give the Resource a Name
- 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¶
Conduit 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 Conduit 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, Conduit will gather up the files required. Therefore, if the deployment points to a git hub repository, Conduit will fetch the files from git hub. Once the files are obtained, Conduit 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. Conduit 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), Conduit is ready to update or create the App in Cloud Foundry.
After the App is configured, the artifacts references in the Conduit 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. Conduit App templates can be utilized to wire up Cloud Foundry services created by Conduit. In this case, Conduit 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 Conduit.”
Example¶
To better understand how Conduit 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
-nameparameter defines the name that will be given to the application in Cloud Foundry. Conduit will overwrite this value with the name given to the Instance being created in Conduit. - The
-memoryparameter (as well as the disk_quota parameter if specified) will be overwritten by Conduit based on the plan specified for the Instance. - The
-pathparameter 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¶
- Navigate to
Infrastructure -> Cloudsand select your Cloud Foundry Cloud - Select the MARKETPLACE tab
- Select + ADD MARKETPLACE ITEM
- Select the Conduit Instance Type to add the Marketplace Item to.
- Enter version
- Search for and select Marketplace Item
- 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¶
Conduit 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.
- Navigate to
`Provisioning -> Instancesand select an Instance Type with a Cloud Foundry layout (MySQL, Redis and RabbitMQ plus Marketplace additions) - Select NEXT
- Select a Group and PCF Cloud
- Add an Instance Name
- Optionally select and Environment Tag and/or add a custom Tag
- Select NEXT
- Select Version and Instance Configuration for a Cloud Foundry layout, ex: Cloud Foundry MySQL
- Select a Plan and available options for the Plan, or use the custom Plan
- Select a Space to add the Instance to
- Optionally configure advanced options
- Select NEXT
- Optionally configure Automation options
- Select NEXT
- 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.
Navigate to
`Provisioning -> Instancesand select the Cloud Foundry App Instance TypeSelect NEXT
Select a Group and PCF Cloud
Add an Instance Name
Optionally select and Environment Tag and/or add a custom Tag
Select NEXT
Select a Plan and available options for the Plan, or use the custom Plan
Select a Space to add the Instance to
Select NEXT
In the Deployments section, select a Deployment and Version to be deployed. These can be git repos or files added in
Provisioning -> DeploymentsImportant
If services are specified in a git repo manifest, Conduit assumes they are already exist in the PCF cloud with matching names.
Select NEXT
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.