This repo is still a work in progress for certain use cases. Take a look at this table to see if it's recommended that you use it.
- Purpose
- Is
cf-deploymentready to use? - Deploying CF
- Contributing
- Setup and Prerequisites
- Ops Files
- CI
This repo contains a canonical manifest
for deploying Cloud Foundry without the use of cf-release,
relying instead on individual component releases.
It will replace the manifest generation scripts in cf-release
when cf-release is deprecated.
It uses several newer features
of the BOSH director and CLI.
Older directors may need to be upgraded
and have their configurations extended
in order to support cf-deployment.
cf-deployment embodies several opinions
about Cloud Foundry deployment.
It:
- prioritizes readability and meaning to a human operator. For instance, only necessary configuration is included.
- emphasizes security and production-readiness by default.
- bosh's
--vars-storefeature is used to generate strong passwords, certs, and keys. There are no default credentials, even in bosh-lite. - TLS/SSL features are enabled on every job which supports TLS.
- bosh's
- uses three AZs, of which two are used to provide redundancy for most instance groups. The third is used only for instance groups that should not have even instance counts, such as consul.
- uses Diego natively, does not support DEAs, and enables diego-specific features such as ssh access to apps by default.
- deploys jobs to handle platform data persistence using the cf-mysql release for databases and the CAPI release's WebDAV job for blob storage.
- assumes load-balancing will be handled by the IaaS or an external deployment.
| Use Case | Is cf-deployment ready? | Blocked On |
|---|---|---|
| Test and development | Yes | |
| New production deployments | No | Downtime testing |
| Existing production deployments using cf-release | No | Migration tools |
We've been testing cf-deployment for some time, and many of the development teams in the Cloud Foundry organization are using it for development and testing. If that describes your use case, you can use cf-deployment as your manifest.
If you're hoping to use cf-deployment for a new production deployment, we still wouldn't suggest using cf-deployment. We still need to be able to make some guarantees about app availability during rolling deploys. When we think cf-deployment is ready, we'll update this section and make announcements on the cf-dev mailing list.
A migration will be possible. It will be easier for some configurations than others.
The Release Integration team
is working on a transition path from cf-release.
We don't advise anybody attempt the migration yet.
Our in-progress tooling and documentation can be found at
https://github.com/cloudfoundry/cf-deployment-transition
Deployment instructions have become verbose, so we've moved them into a dedicated deployment guide here.
There's a small section in that doc that tries to help operators reason about choices they can make in their deployments. Take a look at Notes for operators.
See the rest of this document for more on the new CLI, deployment vars, and configuring your BOSH director.
Although the default branch for the repository is master,
we ask that all pull requests be made against
the develop branch.
Please also take a look at the "style guide",
which lays out some guidelines for adding properties or jobs
to the deployment manifest.
Before submitting a pull request
or pushing to develop,
please run ./scripts/test
which interpolates all of our ops files
with the bosh cli.
Note: it is necessary to run the tests from the root of the repo.
If you add an Ops-file,
you will need to document it in its corresponding README
and add it to the ops file tests in scripts/test.
We ask that pull requests and other changes be successfully deployed, and tested with the latest sha of CATs.
cf-deployment relies on newer BOSH features,
and requires a bosh director with a valid cloud-config that has been configured with a certificate authority.
It also requires the new bosh CLI,
which it relies on to generate and fill-in needed variables.
cf-deployment requires the new BOSH CLI.
cf-deployment assumes that
you've uploaded a compatible cloud-config to the BOSH director.
The cloud-config produced by bbl is compatible by default,
which covers GCP and AWS.
For bosh-lite, you can use the cloud-config in the bosh-lite directory of this repo.
We have not yet tested cf-deployment against other IaaSes,
so you may need to do some engineering work to figure out the right cloud config (and possibly ops files)
to get it working for cf-deployment.
cf-deployment.yml requires additional information
to provide environment-specific or sensitive configuration
such as the system domain and various credentials.
To do this in the default configuration,
we use the --vars-store flag in the new BOSH CLI.
This flag takes the name of a yml file that it will read and write to.
Where necessary credential values are not present,
it will generate new values
based on the type information stored in cf-deployment.yml.
Necessary variables that BOSH can't generate need to be supplied as well. Though in the default case this is just the system domain, some ops files introduce additional variables. See the summary for the particular ops files you're using for any additional necessary variables.
There are three ways to supply such additional variables.
- They can be provided by passing individual
-varguments. The syntax for-varguments is-v <variable-name>=<variable-value>. This is the recommended method for supplying the system domain. - They can be provided in a yaml file
accessed from the command line with the
-lor--vars-fileflag. This is the recommended method for configuring external persistence services. - They can be inserted directly in
--vars-storefile alongside BOSH-managed variables. This can confuse things, but you may find the simplicity worth it.
Variables passed with -v or -l
will override those already in the var store,
but will not be stored there.
The configuration of CF represented by cf-deployment.yml is intended to be a workable, secure, fully-featured default.
When the need arises to make different configuration choices,
we accomplish this with the -o/--ops-file flags.
These flags read a single .yml file that details operations to be performed on the manifest
before variables are generated and filled.
We've supplied some common manifest modifications in the operations directory.
More details can be found in the Ops-file README.
The operations directory includes subdirectories
for "community", "experimental", and "test" ops-files.
"Community" ops-files are contributed by the Cloud Foundry community. They are not maintained or supported by the Release Integration team. For details, see the Community Ops-file README
"Experimental" ops-files represent configurations that we expect to promote to blessed configuration eventually, meaning that, once the configurations have been sufficiently validated, they will become part of cf-deployment.yml and the ops-files will be removed. For details, see the Experimental Ops-file README.
"Test" ops-files are configurations that we run in our testing pipeline to enable certain features. We include them in the public repository (rather than in our private CI repositories) for a few reasons, depending on the particular ops-file.
Some files are included
because we suspect that the configurations will be commonly needed
but not easily generalized.
For example,
add-persistent-isolation-segment.yml shows how a deployer can add an isolated Diego cell,
but the ops-file is hard to apply repeatably.
In this case, the ops-file is an example.
The ci for cf-deployment
automatically bumps to the latest versions of its component releases on the develop branch.
These bumps, along with any other changes made to develop, are deployed to a single long-running environment
and tested with CATs before being merged to master if CATs goes green.
There is not presently any versioning scheme,
or way to correlate which version of CATs is associated with which sha of cf-deployment,
other than the history in CI.
As cf-deployment matures, we'll address versioning.
The configuration for our pipeline can be found here.