### Install the YAML package Source: https://github.com/cloudfoundry/cf-deployment/blob/main/units/vendor/gopkg.in/yaml.v3/README.md Use the go get command to install the package into your Go environment. ```bash go get gopkg.in/yaml.v3 ``` -------------------------------- ### Example output Source: https://github.com/cloudfoundry/cf-deployment/blob/main/units/vendor/gopkg.in/yaml.v3/README.md The expected output generated by running the provided Go example code. ```text --- t: {Easy! {2 [3 4]}} --- t dump: a: Easy! b: c: 2 d: [3, 4] --- m: map[a:Easy! b:map[c:2 d:[3 4]]] --- m dump: a: Easy! b: c: 2 d: - 3 - 4 ``` -------------------------------- ### Configure External Database Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Example configuration for external database credentials. ```yaml # external_bbs_database_address: bbs-db.xxxxx.us-west-2.rds.amazonaws.com # external_bbs_database_username: bbsadmin # external_bbs_database_password: secretpassword # ... (additional database configs for routing, policy, silk, locket, credhub) ``` -------------------------------- ### Set BOSH Environment Variables Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Configure BOSH connection details using environment variables for manual setup. ```bash export BOSH_ENVIRONMENT= export BOSH_CLIENT= export BOSH_CLIENT_SECRET= export BOSH_CA_CERT= ``` -------------------------------- ### Apply Ops Files for Feature Customization Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt This example demonstrates how to apply multiple ops files to customize a Cloud Foundry deployment. It shows how to integrate external S3 blobstore and AWS-specific optimizations. A sample vars file for S3 configuration is provided. ```bash # Deploy with external S3 blobstore and AWS optimizations bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/aws.yml \ -o operations/use-external-blobstore.yml \ -o operations/use-s3-blobstore.yml \ -l vars-use-s3-blobstore.yml ``` ```yaml # Example vars file for S3 (vars-use-s3-blobstore.yml): # buildpack_directory_key: my-cf-buildpacks # droplet_directory_key: my-cf-droplets # app_package_directory_key: my-cf-packages # resource_directory_key: my-cf-resources # blobstore_access_key_id: AKIAIOSFODNN7EXAMPLE # blobstore_secret_access_key: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY # aws_region: us-west-2 ``` -------------------------------- ### Deploy Cloud Foundry with Swift Blobstore Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/openstack/README.md Deploys Cloud Foundry using Swift as the blobstore. Requires Swift container setup and a Temporary URL Key. Fill in all `<...>` placeholders with your Swift credentials and container names. ```bash bosh -d cf deploy cf-deployment/cf-deployment.yml \ -o cf-deployment/operations/use-compiled-releases.yml \ -o cf-deployment/operations/openstack.yml \ -o cf-deployment/operations/use-swift-blobstore.yml \ -v system_domain="" \ -v auth_url="" \ -v openstack_project="" \ -v openstack_domain="" \ -v openstack_username="" \ -v openstack_password="" \ -v openstack_temp_url_key="" \ -v app_package_directory_key="" \ -v buildpack_directory_key="" \ -v droplet_directory_key="" \ -v resource_directory_key="" ``` -------------------------------- ### Configure External Database Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt This example shows how to deploy Cloud Foundry with an external database service, such as Amazon RDS or Google Cloud SQL, replacing the default MySQL. It requires applying specific ops files and providing a vars file with external database connection details. ```bash # Deploy with external database bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/use-external-dbs.yml \ -l vars-external-dbs.yml ``` ```yaml # Example vars file (vars-external-dbs.yml): # external_database_type: mysql # external_database_port: 3306 # external_cc_database_name: ccdb # external_cc_database_address: cc-db.xxxxx.us-west-2.rds.amazonaws.com # external_cc_database_username: ccadmin # external_cc_database_password: secretpassword # external_uaa_database_name: uaadb # external_uaa_database_address: uaa-db.xxxxx.us-west-2.rds.amazonaws.com # external_uaa_database_username: uaaadmin # external_uaa_database_password: secretpassword # external_bbs_database_name: bbsdb ``` -------------------------------- ### Standardize Database Link Properties Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/issues-and-features-for-bosh.md Example of how to standardize properties for a 'database' link type to ensure consistent consumption of link data, such as ports and credentials. ```yaml - name: mysql-database type: database properties: - name: port source: cf_mysql.mysql.port ``` -------------------------------- ### Run Semantic Unit Tests Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Run semantic tests for CF Deployment manifests. Requires `jq` and `yq` to be installed. Set the `RUN_SEMANTIC` environment variable to `true`. ```bash export RUN_SEMANTIC=true ./units/test ``` -------------------------------- ### Deploy CF with HAProxy Load Balancer Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Deploy CF Deployment with HAProxy as a built-in load balancer, suitable when IaaS load balancers are unavailable. This example configures HAProxy on a public network. ```bash bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/use-haproxy.yml \ -o operations/use-haproxy-public-network.yml ``` -------------------------------- ### Initialize BOSH-Lite environment with bbl Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/bosh-lite/README.md Creates the environment directory, initializes the bbl plan, applies a plan patch, and provisions the infrastructure. ```bash mkdir -p my-env/bbl-state && cd my-env/bbl-state bbl plan --name my-env cp -r /path/to/patch-dir/. . bbl up ``` -------------------------------- ### Use PostgreSQL Instead of MySQL Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Switching the default database to PostgreSQL. ```bash # Deploy with PostgreSQL bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/use-postgres.yml ``` -------------------------------- ### Create Load Balancers and Bootstrap BOSH Director Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Run this command after planning to create your load balancers and bootstrap the BOSH director using bbl. ```bash bbl --state-dir up ``` -------------------------------- ### Set Cloud Foundry Domain Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/alicloud/README.md Exports the user-facing domain name for your Cloud Foundry installation to the CF_DOMAIN environment variable. Replace '...' with your actual domain. ```bash export CF_DOMAIN=... ``` -------------------------------- ### Deploy Cloud Foundry with BBL Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt This sequence of commands uses BOSH Bootloader (BBL) to set up infrastructure on AWS, GCP, or Azure, and then deploys Cloud Foundry. It includes steps for generating SSL certificates, planning the infrastructure with load balancers, creating the infrastructure, and finally deploying CF. ```bash # Create state directory and plan deployment mkdir -p my-env/bbl-state && cd my-env/bbl-state # Generate SSL certificate for load balancer (if needed) openssl req -x509 -newkey rsa:2048 -keyout key.pem -out cert.pem -nodes -days 365 # Plan infrastructure with load balancers bbl plan --lb-type cf --lb-domain system.example.com --lb-cert cert.pem --lb-key key.pem # Create infrastructure and bootstrap BOSH director bbl up # Target the BOSH director eval "$(bbl print-env)" # Deploy Cloud Foundry bosh -d cf deploy cf-deployment.yml \ -v system_domain=system.example.com ``` -------------------------------- ### Get CF Admin Password (Combined Command) Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md A combined command to find and retrieve the CF Admin password from CredHub, parsing the output to extract the value. ```bash credhub get -n $(credhub find -n admin | grep cf_admin | cut -d: -f2) | grep value | cut -d: -f2 ``` -------------------------------- ### Get CF Admin Password from CredHub Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Retrieve the CF Admin password from CredHub using its full path. Replace with the actual path found. ```bash credhub get -n ``` -------------------------------- ### Deploy CF to bosh-lite Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Deploy Cloud Foundry to a local bosh-lite environment using the specified IP address and the bosh-lite operation file. The system domain is set to 'bosh-lite.com'. ```bash bosh -e 192.168.50.6 -d cf deploy \ cf-deployment.yml \ -o operations/bosh-lite.yml \ -v system_domain=bosh-lite.com ``` -------------------------------- ### Scale Down for Development Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Deploying with operations files to reduce resource usage in non-production environments. ```bash # Deploy scaled down to single AZ with compiled releases for faster deployment bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/scale-to-one-az.yml \ -o operations/use-compiled-releases.yml \ -o operations/experimental/fast-deploy-with-downtime-and-danger.yml ``` -------------------------------- ### Retrieve CF Admin Password using CredHub Source: https://github.com/cloudfoundry/cf-deployment/wiki/Acceptance-Process Use `credhub get` to retrieve the password for the `cf_admin` user. This command requires the full credential name obtained from the `credhub find` command. The retrieved password should be stored securely. ```bash $ credhub get -n /bosh-relint-acceptance/cf/cf_admin_password # <---- URL copied from previous command id: 9efb9523-3e63-480f-a088-4911e42902c6 name: /bosh-relint-acceptance/cf/cf_admin_password type: password value: # <------ copy this password and store in a secure place. We will use the password in the next command version_created_at: "2019-10-17T20:58:26Z" ``` -------------------------------- ### Enable SMB Volume Service Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Enables volume support and deploys an SMB broker and volume driver. After `bosh deploy` completes, use the `smbbrokerpush` errand to `cf push` the SMB broker. ```yml enable-smb-volume-service.yml ``` -------------------------------- ### Run Basic Unit Tests Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Execute basic interpolation tests for CF Deployment manifests. This is a quick way to validate manifest changes. ```bash ./units/test ``` -------------------------------- ### Enable Backup and Restore with BBR Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Commands for deploying with BBR support and executing backup/restore operations. ```bash # Deploy with backup-restore enabled for S3 versioned blobstore bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/use-external-blobstore.yml \ -o operations/use-s3-blobstore.yml \ -o operations/backup-and-restore/enable-backup-restore.yml \ -o operations/backup-and-restore/enable-backup-restore-s3-versioned.yml \ -l vars-s3-blobstore.yml # Run backup with BBR bbr deployment \ --target $BOSH_ENVIRONMENT \ --username $BOSH_CLIENT \ --password $BOSH_CLIENT_SECRET \ --deployment cf \ --ca-cert $BOSH_CA_CERT \ backup # Restore from backup bbr deployment \ --target $BOSH_ENVIRONMENT \ --username $BOSH_CLIENT \ --password $BOSH_CLIENT_SECRET \ --deployment cf \ --ca-cert $BOSH_CA_CERT \ restore --artifact-path /path/to/backup ``` -------------------------------- ### Deploy CF with Optimization Ops-Files Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Deploy Cloud Foundry using specific operation files for faster deployment and optimized resource usage. This includes scaling to one AZ and using compiled releases. ```bash bosh -e my-env -d cf deploy cf-deployment/cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/scale-to-one-az.yml \ -o operations/use-compiled-releases.yml -o operations/experimental/fast-deploy-with-downtime-and-danger.yml ``` -------------------------------- ### Promote experimental ops file via inline option Source: https://github.com/cloudfoundry/cf-deployment/blob/main/ops-file-promotion-workflow.md Visual workflow for inlining experimental features into the base manifest or operations folder. ```text +------------------------+ +-------------------------+ +----------------------------+ | | | Inline changes in | | Empty content from | | Experimental feature | ---------> | base manifest file or | ---------> | the experimental ops file | | is validated. | | in Ops-files under | | & add a deprecation notice | | | | operations folder. | | to readme. | +------------------------+ +-------------------------+ +----------------------------+ | | +---------------------------------------+ | | | v +------------------------+ | | | RelInt cuts a minor | | release. | | (•‿•) | +------------------------+ ``` -------------------------------- ### Promote experimental ops file via symlink option Source: https://github.com/cloudfoundry/cf-deployment/blob/main/ops-file-promotion-workflow.md Visual workflow for moving an experimental ops file to the operations folder and creating a symlink. ```text +------------------------+ +-------------------------+ +----------------------------+ | | | Move the experimental | | Add symlink file to the | | Experimental feature | ---------> | Ops-file from | ---------> | promoted Ops-file in the | | is validated. | | experimental folder to | | operations folder to | | | | the operations folder. | | the experimental folder. | +------------------------+ +-------------------------+ +----------------------------+ | | +---------------------------------------+ | | | v +------------------------+ | | | RelInt cuts a minor | | release. | | (•‿•) | +------------------------+ ``` -------------------------------- ### Create Custom Ops File for Instance Scaling Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Defining a custom operations file for scaling and update behavior, followed by the deployment command. ```yaml # custom-scale-up.yml # Scale Diego cells to 10 instances - type: replace path: /instance_groups/name=diego-cell/instances value: 10 # Scale routers to 4 instances - type: replace path: /instance_groups/name=router/instances value: 4 # Configure update behavior for zero-downtime deployments - type: replace path: /instance_groups/name=diego-cell/update?/canaries value: 2 - type: replace path: /instance_groups/name=diego-cell/update?/max_in_flight value: 4 - type: replace path: /instance_groups/name=diego-cell/update?/canary_watch_time value: 60000-150000 - type: replace path: /instance_groups/name=diego-cell/update?/update_watch_time value: 60000-150000 ``` ```bash # Apply custom ops file bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o custom-scale-up.yml ``` -------------------------------- ### Deploy Cloud Foundry to Production Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Use this script to deploy a full Cloud Foundry environment to production. Ensure all required environment variables are set, including BOSH credentials and system domain. Upload the correct stemcell for your IaaS and update the runtime config with BOSH DNS before deployment. ```bash # Set environment variables export BOSH_ENVIRONMENT= export BOSH_CLIENT= export BOSH_CLIENT_SECRET= export BOSH_CA_CERT= export SYSTEM_DOMAIN=example.com # Upload required stemcell export IAAS_INFO=google-kvm # or aws-xen-hvm for AWS export STEMCELL_VERSION=$(bosh interpolate cf-deployment.yml --path=/stemcells/alias=default/version) bosh upload-stemcell https://bosh.io/d/stemcells/bosh-${IAAS_INFO}-ubuntu-jammy-go_agent?v=${STEMCELL_VERSION} # Update runtime config with BOSH DNS bosh update-runtime-config bosh-deployment/runtime-configs/dns.yml --name dns # Deploy Cloud Foundry bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN ``` -------------------------------- ### Deploy CF with BOSH CLI Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Use this command to deploy Cloud Foundry to a configured BOSH director. Ensure SYSTEM_DOMAIN is exported and specify any necessary operation files. ```bash export SYSTEM_DOMAIN=some-domain.that.you.have bosh -e my-env -d cf deploy cf-deployment/cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ [ -o operations/CUSTOMIZATION1 ] \ [ -o operations/CUSTOMIZATION2 (etc.) ] ``` -------------------------------- ### Deploy Cloud Foundry Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/bosh-lite/README.md Deploys Cloud Foundry to the BOSH-Lite environment using the specified operations file and system domain. ```bash bosh \ -d cf \ deploy \ cf-deployment/cf-deployment.yml \ -o cf-deployment/operations/bosh-lite.yml \ -v system_domain= ``` -------------------------------- ### Deploy Cloud Foundry to BOSH-Lite Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt This script deploys Cloud Foundry to a local BOSH-Lite environment for development and testing. It requires setting up BOSH credentials from a local creds file and updating the cloud config for BOSH-Lite. A specific ops file for BOSH-Lite is used during deployment. ```bash # Set environment for local bosh-lite export BOSH_CLIENT=admin export BOSH_CLIENT_SECRET="$(bosh int /creds.yml --path /admin_password)" export BOSH_CA_CERT="$(bosh interpolate /creds.yml --path /director_ssl/ca)" # Update cloud config for bosh-lite bosh -e 192.168.50.6 update-cloud-config iaas-support/bosh-lite/cloud-config.yml # Deploy with bosh-lite ops file bosh -e 192.168.50.6 -d cf deploy cf-deployment.yml \ -o operations/bosh-lite.yml \ -v system_domain=bosh-lite.com ``` -------------------------------- ### Configure GCS Blobstore Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Deploying with Google Cloud Storage as an external blobstore. ```bash # Deploy with GCS blobstore using service account bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/use-external-blobstore.yml \ -o operations/use-gcs-blobstore-service-account.yml \ -l vars-gcs.yml # Example vars file (vars-gcs.yml): # buildpack_directory_key: my-cf-buildpacks # droplet_directory_key: my-cf-droplets # app_package_directory_key: my-cf-packages # resource_directory_key: my-cf-resources # gcp_service_account_json_key: | # { # "type": "service_account", # "project_id": "my-project", # "private_key_id": "...", # ... # } ``` -------------------------------- ### Deploy Cloud Foundry Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/alicloud/README.md Deploys Cloud Foundry using the BOSH CLI. This command requires the region ID and the system domain to be set. ```bash bosh -d cf deploy cf-deployment/cf-deployment.yml \ -o cf-deployment/iaas-support/alicloud/stemcells.yml \ -v region="" \ -v system_domain=$CF_DOMAIN ``` -------------------------------- ### Deploy Cloud Foundry with Custom System Domain Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/softlayer/README.md Use this command to deploy Cloud Foundry when using a custom system domain. Ensure your custom domain points to the director VM and that a Bosh DNS alias is configured for it. ```bash bosh -e deploy -d cf cf-deployment/cf-deployment.yml \ -o cf-deployment/operations/bosh-lite.yml \ -o cf-deployment/iaas-support/softlayer/add-system-domain-dns-alias.yml \ -v system_domain= ``` -------------------------------- ### Upload Downloaded Releases Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/alicloud/README.md Uploads the pre-downloaded Cloud Foundry releases to the 'cf-deployment/releases' directory. This is a preparatory step for deploying in China regions. ```bash cf-deployment/iaas-support/alicloud/upload-releases.sh cf-deployment/releases ``` -------------------------------- ### Plan BBL Load Balancer Configuration Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Execute this command to plan the load balancer configuration using bbl. Ensure you replace placeholders with your specific values. ```bash bbl --state-dir plan --lb-type cf --lb-domain --lb-cert --lb-key ``` -------------------------------- ### Deploy Cloud Foundry Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/openstack/README.md Deploys Cloud Foundry to the OpenStack environment. Replace `` with your Cloud Foundry's user-facing domain name. ```bash bosh -d cf deploy cf-deployment/cf-deployment.yml \ -o cf-deployment/operations/use-compiled-releases.yml \ -o cf-deployment/operations/openstack.yml \ -v system_domain="" ``` -------------------------------- ### Unmarshal and Marshal YAML data Source: https://github.com/cloudfoundry/cf-deployment/blob/main/units/vendor/gopkg.in/yaml.v3/README.md Demonstrates how to unmarshal YAML into a struct or a map, and how to marshal data back into YAML format. Struct fields must be exported for the unmarshaler to populate them. ```go package main import ( "fmt" "log" "gopkg.in/yaml.v3" ) var data = ` a: Easy! b: c: 2 d: [3, 4] ` // Note: struct fields must be public in order for unmarshal to // correctly populate the data. type T struct { A string B struct { RenamedC int `yaml:"c"` D []int `yaml:",flow"` } } func main() { t := T{} err := yaml.Unmarshal([]byte(data), &t) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- t:\n%v\n\n", t) d, err := yaml.Marshal(&t) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- t dump:\n%s\n\n", string(d)) m := make(map[interface{}]interface{}) err = yaml.Unmarshal([]byte(data), &m) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- m:\n%v\n\n", m) d, err = yaml.Marshal(&m) if err != nil { log.Fatalf("error: %v", err) } fmt.Printf("--- m dump:\n%s\n\n", string(d)) } ``` -------------------------------- ### Create BOSH Director Environment Alias Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Create an alias for your BOSH director to simplify targeting it for deployments. ```bash bosh -e alias-env my-env --ca-cert DIRECTOR_CA_CERT_FILE ``` -------------------------------- ### Login to BOSH Director Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Log in to your BOSH director using the environment alias you created. ```bash bosh -e my-env login ``` -------------------------------- ### Deploy CF with TLS Validation Enabled Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Deploy CF Deployment with TLS validation enabled using a specific operations file. Recommended for production environments with valid certificates. ```bash bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/stop-skipping-tls-validation.yml ``` -------------------------------- ### Fetch BOSH Environment via bbl Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Use bbl to automatically retrieve and set BOSH environment variables. ```bash eval "$(bbl print-env)" ``` ```bash export BOSH_ENVIRONMENT=$(bbl director-address) export BOSH_CLIENT=$(bbl director-username) export BOSH_CLIENT_SECRET=$(bbl director-password) export BOSH_CA_CERT="$(bbl director-ca-cert)" ``` -------------------------------- ### Upload BOSH Stemcell Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Configure IaaS information, extract the required stemcell version, and upload the stemcell to the BOSH director. ```bash export IAAS_INFO=google-kvm ``` ```bash export STEMCELL_VERSION=$(bosh interpolate cf-deployment.yml --path=/stemcells/alias=default/version) ``` ```bash bosh upload-stemcell https://bosh.io/d/stemcells/bosh-${IAAS_INFO}-ubuntu-jammy-go_agent?v=${STEMCELL_VERSION} ``` -------------------------------- ### Update BOSH Cloud Config Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Upload the cloud-config for bosh-lite environments. ```bash bosh -e MY_ENV update-cloud-config iaas-support/bosh-lite/cloud-config.yml ``` -------------------------------- ### Scale Instance Group Up Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Provide a custom ops-file to scale instance groups beyond the default two instances. Specify the desired number of instances for a given job. ```yaml - type: replace path: /instance_groups/name=/instances value: 10 ``` -------------------------------- ### Add Isolation Segments Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Deploying with isolation segments for workload separation. ```bash # Deploy with isolation segment bosh -d cf deploy cf-deployment.yml \ -v system_domain=$SYSTEM_DOMAIN \ -o operations/add-persistent-isolation-segment-diego-cell.yml \ -o operations/add-persistent-isolation-segment-router.yml ``` -------------------------------- ### Create symlink for ops file Source: https://github.com/cloudfoundry/cf-deployment/blob/main/ops-file-promotion-workflow.md Command to create a symlink in the experimental folder pointing to the moved ops file in the operations folder. ```bash ln -s ../use-noble-stemcell.yml use-noble-stemcell.yml ``` -------------------------------- ### Update BOSH Runtime Config for DNS Source: https://github.com/cloudfoundry/cf-deployment/blob/main/README.md Use this command to update the BOSH runtime configuration with the recommended DNS settings from the bosh-deployment repository. Ensure you have the bosh-deployment repository cloned or accessible. ```bash bosh update-runtime-config bosh-deployment/runtime-configs/dns.yml --name dns ``` -------------------------------- ### Upload Cloud Foundry Cloud Config Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/openstack/README.md Uploads the cloud configuration to the BOSH director. Ensure availability zones and network IDs are correctly substituted. ```bash bosh update-cloud-config \ -v availability_zone1="" \ -v availability_zone2="" \ -v availability_zone3="" \ -v network_id1="" \ -v network_id2="" \ -v network_id3="" \ cf-deployment/iaas-support/openstack/cloud-config.yml ``` -------------------------------- ### Test Backup and Restore Ops Files Source: https://context7.com/cloudfoundry/cf-deployment/llms.txt Execute tests for the backup and restore operations files within CF Deployment. This script helps validate the BBR integration. ```bash ./scripts/test ``` -------------------------------- ### Login to Cloud Foundry Source: https://github.com/cloudfoundry/cf-deployment/wiki/Acceptance-Process Log in to the Cloud Foundry environment using the `cf login` command. You will be prompted for the API endpoint, username (admin), and password. The password will not be displayed as you type it. ```bash $ cf login API endpoint: https://api.relint-acceptance.cf-app.com Email> admin # <--- though it says email, just type in `admin` Password> # <--- paste the password here and then press enter. Though it will not show anything, it does paste the password # after you press enter, you should see this Authenticating... OK Targeted org system API endpoint: https://api.relint-acceptance.cf-app.com (API version: 2.142.0) User: admin Org: system Space: No space targeted, use 'cf target -s SPACE' ``` -------------------------------- ### Replace Instance Group Update Settings Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Use this ops-file to reconfigure the update strategy for specific instance groups. Adjust canaries, watch times, and serial updates as needed. ```yaml - type: replace path: /instance_groups/name=/update?/canaries value: 2 - type: replace path: /instance_groups/name=/update?/canary_watch_time value: 60000-150000 - type: replace path: /instance_groups/name=/update?/max_in_flight value: 10 - type: replace path: /instance_groups/name=/update?/serial value: true - type: replace path: /instance_groups/name=/update?/update_watch_time value: 60000-150000 ``` -------------------------------- ### Set CPU Weight Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Configures CPU shares for each garden container to be proportional to its memory limits. ```yml set-cpu-weight.yml ``` -------------------------------- ### Enable Privileged Container Support Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Enables Diego privileged container support. ```yml enable-privileged-container-support.yml ``` -------------------------------- ### Update Cloud Foundry Cloud Config Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/alicloud/README.md Uploads the cloud configuration for Cloud Foundry on Alibaba Cloud. Ensure all variables are replaced with your specific environment details. ```bash bosh update-cloud-config \ cf-deployment/iaas-support/alicloud/cloud-config.yml \ -v az1_zone="" \ -v az2_zone="" \ -v az3_zone="" \ -v az1_vswitch_id="" \ -v az2_vswitch_id="" \ -v az3_vswitch_id="" \ -v az1_vswitch_range="" \ -v az2_vswitch_range="" \ -v az3_vswitch_range="" \ -v az1_vswitch_gateway="" \ -v az2_vswitch_gateway="" \ -v az3_vswitch_gateway="" \ -v security_group_id_1="" \ -v security_group_id_2="" \ -v security_group_id_3="" \ -v tcp_slb_id_array=[""] \ -v http_slb_id_array=[""] ``` -------------------------------- ### Use Absolute CPU Entitlement Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Switches Diego to emit deprecated absolute CPU entitlement metrics. ```yml use-absolute-cpu-entitlement.yml ``` -------------------------------- ### Enable Service Discovery Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Enables application service discovery within the Cloud Foundry deployment. ```yml enable-service-discovery.yml ``` -------------------------------- ### Use External Blobstore Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Removes the singleton-blobstore instance group and adds `fog_connection` properties for components using the blobstore. Warning: This does not migrate data and will delete existing singleton-blobstore groups. Requires an external data store and introduces new variables for connection details. ```yml use-external-blobstore.yml ``` -------------------------------- ### Define Disk Types for cf-deployment Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/on-cloud-configs.md Required disk type configurations for BOSH manifests used with cf-deployment. ```yaml disk_types: - disk_size: 5120 name: 5GB - disk_size: 10240 name: 10GB - disk_size: 102400 name: 100GB ``` -------------------------------- ### Scale to One AZ Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Scales cf-deployment down to a single instance per instance group, placing them all into a single AZ, effectively halving the deployment's footprint. Should be applied before other ops files. ```yml scale-to-one-az.yml ``` -------------------------------- ### Set BOSH and CredHub Environment Variables for bosh-lite Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Configure environment variables for BOSH and CredHub when deploying to a local bosh-lite environment. This involves setting client secrets, CA certificates, and server details. ```bash export BOSH_CLIENT=admin export BOSH_CLIENT_SECRET="$(bosh int /creds.yml --path /admin_password)" export BOSH_CA_CERT="$(bosh interpolate /creds.yml --path /director_ssl/ca)" export CREDHUB_SERVER=https://192.168.50.6:8844 export CREDHUB_CLIENT=credhub-admin export CREDHUB_SECRET=$(bosh interpolate /creds.yml --path=/credhub_admin_client_secret) export CREDHUB_CA_CERT="$(bosh interpolate /creds.yml --path=/credhub_tls/ca )"$'\n'"$( bosh interpolate /creds.yml --path=/uaa_ssl/ca)" ``` -------------------------------- ### Use Blobstore CDN Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md Adds support for accessing `droplets` and `resource_pool` blobstore buckets via signed URLs over a CDN. Assumes the same keypair is used for both buckets. Introduces new variables. ```yml use-blobstore-cdn.yml ``` -------------------------------- ### Login to CF Source: https://github.com/cloudfoundry/cf-deployment/blob/main/texts/deployment-guide.md Log in to the Cloud Foundry API using 'admin' username and the password retrieved from CredHub. ```bash cf login ``` -------------------------------- ### Download Cloud Foundry Releases for China Region Source: https://github.com/cloudfoundry/cf-deployment/blob/main/iaas-support/alicloud/README.md Downloads necessary Cloud Foundry releases locally for deployment in China regions. Specify the deployment manifest and a directory to store the releases. ```bash sh cf-deployment/iaas-support/alicloud/download-releases.sh cf-deployment/cf-deployment.yml "" ``` -------------------------------- ### Enable TLS on File Server Source: https://github.com/cloudfoundry/cf-deployment/blob/main/operations/README.md This ops file is a no-op as file-server mTLS is enabled by default since cf-d v54.11.0. ```yml enable-tls-on-file-server.yml ```