Manifests are ways to describe and deploy application seamlessly to cloud foundry environment. Basically, using Manifest.yml file we can describe how to push our application. In this process, we need to define application name, how much memory that our application required and services that we need to bind and environment variables..etc in manifest file. There is a huge list of alternatives and benefits for any cloud application that uses manifest.
When we try to push our application by using CF PUSH command, it will try to identify manifest.yml file in same directory, that we are trying to push the application. Once it identifies, that process the properties defined and uses to start the application. If CF PUSH doesn’t find the manifest file, CF push tries to identify what application it’s trying to push. In this process, since it doesn’t find any yml manifest properties, Cloud Foundry applies default values for all required fields like name, memory & services etc.
We can even provide external Manifest.yml file to CF PUSH by using -F argument. This argument simply tell to Cloud Foundry, go and find wherever it is exists manifest.yml. Once it is located, then it follows the processing as mentioned previously.
If we are going in the way of manifest, there are few mandatory fields which we need to provide,
- application name
- application memory
- buildpack
Manifest.yml files are really helpful for CI/CD. Using a standard way with Manifest.yml, we can make our application run anywhere. Even if we changes or migrate the Cloud environment, we have already have configuration in the Manifest.yml that we need to run our application. So, no need to worry about changes after the environment migration.
Manifest.yml files are designed in a way that we can define more than one application inside it. So, assume that we have group of applications in a space. Then defining these applications configuration and pushing into Cloud Foundry is very simple. We can add all manifest properties inside a file and we can push into Cloud Foundry and it is only one time creation and we can use wherever we need. If we need to new service, just we can configure the service in Manifest.yml and redeploy.
Summary:
- Describe Application Deployment
- CF tried to find Manifest.yml in same directory
- External manifest can be provided
- There are required and optional fileds
- Very useful for CI/CD process
- Define more than one application in single Manigest.yml
- Simplest way to deal with CF Application
How to create manifest.yml?
cf create-app-manifest -p
Below is the sample manifest file look like,
applications: - name: cfcloudgreet path: target/CFGreet-0.0.1-SNAPSHOT.jar buildpack: https://github.com/cloudfoundry/java-buildpack.git memory: 1G
While pushing the application into cloud foundry we need to provide the path of the manifest file. So, we no need to pass all the properties in command line.
Previous: Create Service Instance in PCF
Next: Internal Process of Application Deployment in Cloud Foundry