Google Cloud Platform

This document shows how to initialize new environment on Google Cloud Platform.

  1. Install CLI v2.

  2. Use bosh create-env command to deploy the Director.

    # Create directory to keep state
    mkdir bosh-1 && cd bosh-1
    
    # Clone Director templates
    git clone https://github.com/cloudfoundry/bosh-deployment
    
    # Fill below variables (replace example values) and deploy the Director
    bosh create-env bosh-deployment/bosh.yml \
        --state=state.json \
        --vars-store=creds.yml \
        -o bosh-deployment/gcp/cpi.yml \
        -v director_name=bosh-1 \
        -v internal_cidr=10.0.0.0/24 \
        -v internal_gw=10.0.0.1 \
        -v internal_ip=10.0.0.6 \
        --var-file gcp_credentials_json=~/Downloads/gcp-23r82r3y2.json \
        -v project_id=moonlight-2389ry3 \
        -v zone=us-east1-c \
        -v tags=[internal] \
        -v network=default \
        -v subnetwork=default
    

    If running above commands outside of a connected Google network, refer to Exposing environment on a public IP for additional CLI flags.

  3. Connect to the Director.

    # Configure local alias
    bosh alias-env bosh-1 -e 10.0.0.6 --ca-cert <(bosh int ./creds.yml --path /director_ssl/ca)
    
    # Log in to the Director
    export BOSH_CLIENT=admin
    export BOSH_CLIENT_SECRET=`bosh int ./creds.yml --path /admin_password`
    
    # Query the Director for more info
    bosh -e bosh-1 env
    
  4. Save the deployment state files left in your deployment directory bosh-1 so you can later update/delete your Director. See Deployment state for details.