Deploying Cloud Foundry

Page last updated:

This topic describes how to deploy Cloud Foundry using cf-deployment. Before performing this procedure, ensure you have prepared your environment and deployed a BOSH Director. For more information, see the Prepare Your Environment section of the Deploying Cloud Foundry with cf-deployment topic.

Step 1: Clone cf-deployment

Clone the cf-deployment repository:

$ git clone https://github.com/cloudfoundry/cf-deployment.git

This repository contains the canonical manifest for deploying Cloud Foundry, along with various ops files that specify operations to perform on the Cloud Foundry deployment manifest.

Step 2: Select Your Ops Files

Every IaaS except Google Cloud Platform (GCP) requires using IaaS-specific ops files to deploy Cloud Foundry. Ops files can also add additional functionality to your deployment.

All ops files are located in the operations directory of the cf-deployment repository.

See the Ops Files section of the cf-deployment repository README for a description of all available ops files.

Step 3: Determine Variables

cf-deployment requires additional information to provide environment-specific or sensitive configuration.

The BOSH CLI stores this information in a variables store file, which is provided by the operator with the --vars-store flag when deploying Cloud Foundry. This flag takes the name of a YAML file that the BOSH CLI will read and write to. If the file does not exist, the BOSH CLI will create it. If necessary credential values are not present, the BOSH CLI will generate new values based on the type information stored in cf-deployment.yml.

There are certain variables that BOSH cannot generate. By default, this is only the system domain. But depending on the ops files you have selected, you may need to provide variables in addition to the system domain.

Perform the following steps to determine your required variables and prepare them for the deploy:

  1. Review the information in the Step 2: Select Your Ops Files section and create a list of the variables required by the ops files you have selected.
  2. Determine the values for each of the variables. For example, the aws_region variable required by the use-s3-blobstore.yml ops file may have the value of us-west-2.
  3. Choose one of the following methods for providing the variables when you deploy Cloud Foundry below:
    • Provide the variables in a YAML file specified with the --vars-file flag during the deploy. This is the recommended method for configuring external persistence services.
    • Provide the variables by passing individual -v arguments for each variable. The syntax is -v VAR-NAME=VAR-VALUE.

      Note: Variables passed with either -v or --vars-file will override those already in the var store, but will not be stored there.

    • Insert the variables directly in the variables store file alongside BOSH-managed variables.

Step 4: Upload Stemcell

  1. Ensure you are logged in to your BOSH Director:
    $ bosh -e YOUR-ENV log-in
  2. Open the Cloud Foundry deployment manifest, cf-deployment.yml. In the final lines of the deployment manifest, locate the top-level property stemcells and retrieve the values for os and version. The following example specifies an Ubuntu Trusty 3312.12 stemcell.

    stemcells:
    - alias: default
      os: ubuntu-trusty
      version: "3421.11"
    
  3. Visit the stemcells section of bosh.io.

  4. Locate the Ubuntu Trusty stemcell that corresponds to your IaaS and to the version specified above, and copy the URL to the stemcell.

  5. Upload the stemcell:

    $ bosh upload-stemcell YOUR-STEMCELL-URL

    Note: If you applied the windows-cell.yml ops file to deploy a Windows Diego cell, you must also upload a Windows stemcell. Examine the cf-deployment manifest for the version number and locate the URL for the appropriate stemcell at bosh.io.

Step 5: Deploy

  1. Deploy cf-deployment:
    $ bosh -e YOUR-ENV -d cf deploy cf-deployment/cf-deployment.yml \
    --vars-store env-repository/deployment-vars.yml \
    -v system_domain=YOUR-SYSTEM-DOMAIN \
    -o cf-deployment/operations/YOUR-OPS-FILE-1
    -o cf-deployment/operations/YOUR-OPS-FILE-2
    [...]
    
    Depending on your choices in the Step 3: Determine Variables section, provide additional variables with -v or --vars-file.

    If your variables store file does not exist, BOSH creates one at the path you specify with --vars-store. Store your variables store file in a safe and secure place. You will need it for all subsequent deploys.

    When prompted to review the deployment manifest, enter y to continue.

    The deploy may take several minutes. When the command completes, run bosh vms to check that the Cloud Foundry VMs are running.
Create a pull request or raise an issue on the source for this page in GitHub