diff --git a/.gitignore b/.gitignore index 969d4ad4..f2e804b0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,18 +1,13 @@ -# See http://help.github.com/ignore-files/ for more about ignoring files. -# -# If you find yourself ignoring temporary files generated by your text editor -# or operating system, you probably want to add a global ignore instead: -# git config --global core.excludesfile ~/.gitignore_global - -# Ignore bundler config +output +final_app .bundle - -# Ignore the build directory -build - -# Ignore Sass' cache -.sass-cache - -.idea +Gemfile.lock +final_app/* +cached_shas.yml +**/.sass-cache/* +bin vendor -.DS_Store \ No newline at end of file +[#]*[#] +.DS_Store +.ruby-version +.vscode/ \ No newline at end of file diff --git a/capi/client-libraries.html.md.erb b/capi/client-libraries.html.md.erb index 21d2454a..a0622456 100644 --- a/capi/client-libraries.html.md.erb +++ b/capi/client-libraries.html.md.erb @@ -26,7 +26,7 @@ While you can develop apps that use CAPI by calling it directly as in the API do <%= vars.app_runtime_abbr %> supports the following clients for CAPI: * [Java](https://github.com/cloudfoundry/cf-java-client) -* [Scripting](http://cli.cloudfoundry.org/en-US/cf/curl.html) with the Cloud Foundry Command Line Interface (cf CLI) +* Scripting: enter `cf help curl` ### Experimental diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb new file mode 100644 index 00000000..706878b0 --- /dev/null +++ b/custom-per-route-options.html.md.erb @@ -0,0 +1,139 @@ +--- +title: Configuring per-route options +owner: CF for VMs Networking +--- + +By default, communication between Gorouter and backends is configured through the general settings at the platform level. + +This topic describes how to specify per-route Gorouter options scoped at the application level. +This greater granularity lets developers tailor optimal routing behavior for applications' unique load profiles or other requirements. + +Gorouter supports the following per-route option, described in the section below: + +- `loadbalancing`: Configures the load balancing algorithm used by Gorouter for this particular route. <%= vars.per_route_lb_version %> + - Settings: `round-robin`, `least-connection`. + +## Configure Gorouter's Load Balancing Algorithm + +<%= vars.per_route_lb_version %> + +The per-route option `loadbalancing` allows configuring the load balancing algorithm, which defines how the load is distributed between Gorouters and backends. + +This option supports two settings for load balancing: + +- `round-robin` distributes the load evenly across all available backends +- `least-connection` directs traffic to the backend with the fewest active connections at any given time, optimizing resource utilization + + +### Configure Load Balancing in an App Manifest + +To configure per-route load balancing for an application that has not yet been pushed: + +1. In the application manifest, include a `route` definition with an `options: loadbalancing` attribute set to `round-robin` or `least-connection`. For example: + + ```yaml + --- + applications: + - name: MY-APP + routes: + - route: MY-HOST.EXAMPLE.COM + options: + loadbalancing: least-connection + ``` + + Where `MY-APP` is the name of your app and `MY-HOST.EXAMPLE.COM` is the route you want to map to your app. + +1. Push the app with the manifest: + + ```console + cf push -f manifest.yml + ``` + +### Change Load Balancing Algorithm of an Existing Route + +To change the per-route `loadbalancing` option of an existing route, you can use the cli command, `update-route`. + +For example, to change an app route's algorithm from `least-connection` to `round-robin`, you can run the `update-route` command: + +```console +cf update-route EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin +``` + +Alternatively, it is also possible to update the per-route load balancing option via the `/v3/routes` API. + +Run the `PATCH` request to the targeted API endpoint: + +```console +cf curl /v3/routes/GUID -X PATCH -H "Content-type: application/json" \ + -d '{ + "options": { + "loadbalancing": "round-robin" + } + }' +``` +Where `GUID` is the unique identifier for the route. + +### Create a Route with a specific Load Balancing Algorithm + +To create a route with a per-route `loadbalancing` option, you can use the cli command `create-route`. +For example: + +```console +cf create-route EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin +``` + +Alternatively, it is also possible to create a route with a per-route load balancing option via the `/v3/routes` API: + +```console +cf curl /v3/routes -X POST -H "Content-type: application/json" \ + -d '{ + "host": "MY-HOST", + "path": "MY-PATH", + ... + "options": { + "loadbalancing": "round-robin" + } + }' +``` + +### Map a Route to an Existing App with specific Load Balancing Algorithm + +To create and map a new route to an existing application with the per-route `loadbalancing` option, you can use the cli command `map-route`. + +For example: + +```console +cf map-route MY-APP EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin +``` + +

+The command map-route supports the --option flag only for new routes. +To update an existing route, the command update-route must be used as described before.

+ +### Retrieve Route Options + +To read route options, you can query the route using the `route` command: + +```console +cf route EXAMPLE.COM --hostname MY-HOST +``` + + The response lists the chosen `loadbalancing` algorithm option, e.g. `least-connection`: + +```console +options: {loadbalancing=least-connection} +``` + + Alternatively, you can query the `routes` API endpoint for a route: + +```console +cf curl /v3/routes/?hosts=MY-HOST +``` + +Where `MY-HOST` is the host attribute of the route. The response lists the chosen `loadbalancing` algorithm option as well: + +```console + "options": {"loadbalancing": "least-connection"} +``` + +To retrieve all the routes with the corresponding options in a space of an organization, you can use the `routes` command. diff --git a/custom-ports.html.md.erb b/custom-ports.html.md.erb index b546250d..c69cbd93 100644 --- a/custom-ports.html.md.erb +++ b/custom-ports.html.md.erb @@ -122,7 +122,6 @@ To configure your app to receive HTTP or TCP requests on custom ports:

- Caution This API call removes all destinations for a route and replaces them with the destinations you provide in the API request.

## Additional resources diff --git a/deploy-apps/_c2c_oss_overlay.html.md.erb b/deploy-apps/_c2c_oss_overlay.html.md.erb index fa644abf..aa61e26c 100644 --- a/deploy-apps/_c2c_oss_overlay.html.md.erb +++ b/deploy-apps/_c2c_oss_overlay.html.md.erb @@ -1,68 +1,180 @@ ## Configure the overlay network -Container-to-container networking uses an overlay network to manage communication between app instances. -By default, each Diego Cell in the overlay network is allocated a /24 range that supports 254 containers per cell, one container for each of the usable IP addresses, `.1` through `.254`. +Container-to-container networking uses an overlay network to manage +communication between app instances. By default, each Diego Cell in the overlay +network is allocated a /24 range that supports 254 containers per cell, one +container for each of the usable IP addresses, `.1` through `.254`. -For more information about the overlay network, see [Overlay network](../../concepts/understand-cf-networking.html#overlay-network) in _Container-to-container networking_. +For more information about the overlay network, see [Overlay +network](../../concepts/understand-cf-networking.html#overlay-network) in +_Container-to-container networking_. -### Configure the number of Diego Cells +### Understanding the Overlay Network Properties using a Pie Metaphor -To change the number of Diego Cells supported by the overlay network in your Cloud Foundry deployment, edit the `cf_networking.network` property in your `cf-networking-release` manifest, and then re-deploy Cloud Foundry. See the following examples: +There are two <%= vars.app_runtime_abbr %> properties concerning the overlay +network. Before going into the details of the actual <%= vars.app_runtime_abbr +%> properties, let's talk about them metaphorically. - - - - - - +Imagine the entire overlay network is a group of pies. One <%= vars.app_runtime_abbr %> +property defines these pies and their sizes. + +The purpose of these pies are to serve the hungry, hungry Diego Cells. Each Diego +Cell is hungry and needs a slice of pie. Without a slice of pie the Diego Cell +cannot start because it has no energy. This is an egalitarian kitchen, so each +Diego Cell must get the same size pie slice. + +The second <%= vars.app_runtime_abbr %> property determines the size of the pie +slice that each Diego Cell is given. The smaller the slice of pie that each Diego +Cell gets, the less “energy” each Diego Cell has, and thus fewer apps can run on each +Diego Cell. The larger the slice of pie is that each Diego Cell gets, the more +“energy” the Diego Cell has, and thus more apps can run on each Diego Cell. + +If the pies and their sizes stay constant, smaller slices of pie means there can be +more Diego Cells (which are fed less each) and larger slices means there is a +smaller number of possible Diego Cells (which are fed more each). + +
Overlay subnet maskNumber of cellsContainers per cell
+ - - - - + + + + + - - - + + + + - - - + + +
/2015254
Pie Metaphor PropertyActual Bosh PropertyDescriptionDefault
/16255254Group of pies and their sizesnetwork on the silk-controller jobAn list of CIDR address blocks for the overlay network provided as an + array of strings. Subnets for each Diego Cell are allocated out of this + network. The subnet_prefix_length property must be smaller than the + smallest CIDR address block. + ["10.255.0.0/16"]
/124,095254Slice size for each Diego Cell"subnet_prefix_length" on the silk-controller jobThe CIDR mask for each Diego Cell's individual overlay network subnet. + For a /24 subnet for each Diego Cell, enter 24 This subnet must be + smaller than all individual IP ranges provided in the network property. + 24
-

-Caution -The overlay network IP address range must not conflict with any other IP addresses in the network. If a conflict exists, Diego Cells cannot reach any endpoint that has a conflicting IP address.

-### Configure the number of containers per cell +### Configuring Overlay Networking Properties + +Changing the two overlay network properties "network" and +"subnet_prefix_length" affect how many Diego Cells can run in one deployment +and how many apps can be run on each Diego Cell. + +Use the following algorithm to determine how many Diego Cells can run with a +given configuration. + +``` +A = the total number of IPs in the "network" +B = number of IPs per Diego Cell as defined by the "subnet_prefix_length" +C = number of CIDRs in the "network" + +Max supported number of Diego Cells = (A/B) - C +``` -To change the number of containers per Diego Cell in your Cloud Foundry deployment, edit the `cf_networking.subnet_prefix_length` property in your `cf-networking-release` manifest, and then re-deploy Cloud Foundry. See the following examples: +Here is an example using the default values: + +``` +network = ["10.255.0.0/16"] +subnet_prefix_length = 24 + +A = /16 CIDR = 65,536 IPs +B = /24 CIDR = 256 IPs +C = 1 + +Max supported number of Diego Cells = (65,536/256) - 1 = 255 +``` + +Here is an example using other values: + +``` +network = ["10.255.0.0/20", "10.255.96.0/21"] +subnet_prefix_length = 24 + +A = /20 CIDR + /21 CIDR = 4,096 IPs + 2,048 IPs = 6,144 IPs +B = /24 CIDR = 256 IPs +C = 2 + +Max supported number of Diego Cells = (6,144/256) - 2 = 22 +``` + +All CIDRs provided in the "network" must have a larger prefix length +than the "subnet_prefix_length." + +Here are some examples of invalid combinations of properties: + + + + + + + + + + + + + + + + + + +
PropertyValue
network["10.255.0.0/20", "10.255.96.0/21", "10.255.200.0/23", "10.255.220.0/24"]
subnet_prefix_length24
Invalid reasonsubnet_prefix_length must be smaller than all CIDRs in the network. In this case it is the same size as 10.255.220.0/24.
- +
+ + + + - - - - + + - - - - + + - - - - + + + + +
PropertyValue
Overlay subnet maskNumber of cellsCell prefix lengthContainers per cell network["10.255.0.0/20", "10.255.96.0/21", "10.255.200.0/23", "10.255.220.0/32"]
/16255/24254subnet_prefix_length24
/16255/2662Invalid reasonsubnet_prefix_length must be smaller than all CIDRs in the network. In this case it is larger than 10.255.220.0/32.
+ + + + + + + + + + + + + - - - - + + +
PropertyValue
network["10.255.0.0/20", "10.255.0.0/16"]
subnet_prefix_length24
/16255/2814Invalid reasonnetwork must not have any overlapping IP ranges. In this case 10.255.0.0/20 is a subset of 10.255.0.0/16.
+ +### Changing the Overlay Network + +Updating the "network" and "subnet_prefix_length" property is supported. However it will cause +container-to-container networking downtime during the deploy while the network +update is rolling out across Diego Cells. + +

The overlay network IP address ranges must not conflict with any other IP +addresses in the network. If a conflict exists, Diego Cells cannot reach any +endpoint that has a conflicting IP address.

diff --git a/deploy-apps/_v3-note.html.md.erb b/deploy-apps/_v3-note.html.md.erb index 3cfe8b8d..f63163ec 100644 --- a/deploy-apps/_v3-note.html.md.erb +++ b/deploy-apps/_v3-note.html.md.erb @@ -1,11 +1,10 @@
-Important This attribute is available with CAPI V3 only. To push a manifest that uses this attribute, do one of the following:

diff --git a/deploy-apps/app-lifecycle.html.md.erb b/deploy-apps/app-lifecycle.html.md.erb index 81d43fae..6f7ce99f 100644 --- a/deploy-apps/app-lifecycle.html.md.erb +++ b/deploy-apps/app-lifecycle.html.md.erb @@ -53,5 +53,4 @@ This might increase the time it takes to drain Diego Cells, which causes increas <%= vars.app_graceful_shutdown_config %>

-Note An exception to the cases previously mentioned is when monit restarts a Diego Cell replacement or Garden server that has failed. In this case, <%= vars.app_runtime_abbr %> immediately stops the apps that are still running using SIGKILL.

diff --git a/deploy-apps/app-ssh-overview.html.md.erb b/deploy-apps/app-ssh-overview.html.md.erb index b25a2b25..f322ceec 100644 --- a/deploy-apps/app-ssh-overview.html.md.erb +++ b/deploy-apps/app-ssh-overview.html.md.erb @@ -32,11 +32,11 @@ for spaces, and for apps as described in the table: Space manager Space - cf CLI allow-space-ssh and disallow-space-ssh commands + cf CLI cf allow-space-ssh and cf disallow-space-ssh commands Space developer App - cf CLI enable-ssh and disable-ssh commands + cf CLI enable-ssh and disable-ssh commands diff --git a/deploy-apps/blue-green.html.md.erb b/deploy-apps/blue-green.html.md.erb index f109a36f..b911ead3 100644 --- a/deploy-apps/blue-green.html.md.erb +++ b/deploy-apps/blue-green.html.md.erb @@ -25,7 +25,6 @@ version by switching back to Blue. You can adjust the route mapping pattern to display a static maintenance page during a maintenance window for time-consuming tasks such as migrating a database. In this scenario, the router switches all incoming requests from Blue to Maintenance to Green.

-Important If your app uses a relational database, blue-green deployment can lead to discrepancies between your green and glue databases during an update. To maximize data integrity, configure a single database for backward and forward compatibility.

@@ -77,7 +76,7 @@ The router now also sends any traffic for `demo-time-temp.example.com` to Green. Now that both apps are up and running, switch the router so all incoming requests go to both the Green app and the Blue app. -Use the [cf map-route](http://cli.cloudfoundry.org/en-US/cf/map-route.html) command to map the original URL route (`demo-time.example.com`) to the Green app. +Use the `cf map-route` command to map the original URL route (`demo-time.example.com`) to the Green app.
 $ cf map-route Green example.com -n demo-time
@@ -94,7 +93,7 @@ After the `cf map-route` command :
 ### Step 4: Unmap route to Blue
 
 After you verify that Green is running as expected, stop routing requests to Blue
-using the [cf unmap-route](http://cli.cloudfoundry.org/en-US/cf/unmap-route.html) command:
+using the `cf unmap-route` command:
 
 
 $ cf unmap-route Blue example.com -n demo-time
diff --git a/deploy-apps/canary-deploy.html.md.erb b/deploy-apps/canary-deploy.html.md.erb
deleted file mode 100644
index 8f30973b..00000000
--- a/deploy-apps/canary-deploy.html.md.erb
+++ /dev/null
@@ -1,387 +0,0 @@
----
-title: Configuring canary app deployments
-owner: CAPI
----
-
-You can use Cloud Foundry Command Line Interface (cf CLI) commands
-or the Cloud Foundry API (CAPI) to push your apps to <%= vars.app_runtime_first %> using a canary deployment.
-
-For information about the traditional method for addressing app downtime while pushing app updates,
-see [Using blue-green deployment to reduce downtime and risk](./blue-green.html).
-
-For more information about CAPI, see the
-[Cloud Foundry API (CAPI) documentation](https://v3-apidocs.cloudfoundry.org/).
-
-Canary deployments will allow users to deploy a single instance of a new version of an application and check if it is running as expected,
-before continuing the rolling deployment of the rest of the instances. If the new version of the application is not running as expected, the canary deployment can be cancelled.
-
-The expected workflow for this feature is:
-1. Deploy a single canary instance with the changed code
-1. Manually verify that canary instance with new code runs as expected
-1. Continue the rolling deployment for the remaining instances.
-
-
-##  Prerequisites
-
-The procedures in this topic require one of the following:
-
-* **cf CLI v8 or later**
-
-* **CAPI V3.173.0 or later:** If you use CAPI V3, you must install the cf CLI version 8+.
-
-
-##  Commands
-
-This section describes the commands for working with canary app deployments.
-
-###  Deploy an app
-
-To deploy a canary version of an app:
-
-

-Caution -Review the limitations of this feature before running the command. For more information, see -Limitations.

- -* **For CF CLI v8:** - ``` - cf push APP-NAME --strategy canary - ``` - Where `APP-NAME` is the name that you want to give your app. - -

- Note - cf CLI will exit when the canary instance is healthy. - It also includes a --no-wait flag on push for users who don't want to wait - for the operation to complete. -

- - To cancel, see [Cancel a canary deployment](#cancel). - -* **For CAPI V3:** - 1. Log in to the cf CLI. - - ``` - cf login - ``` - 2. Create an empty app by running the following `curl` command with `POST /v3/apps`. Record the - app GUID from the output. - - ``` - cf curl /v3/apps \ - -X POST \ - -H "Content-type: application/json" \ - -d '{ - "name": "APP-NAME", - "relationships": { - "space": { - "data": { - "guid": "SPACE-GUID" - } - } - } - }' - ``` - - Where: - - 3. Create a package with the following `curl` command with `POST /v3/packages`. Record the package - GUID from the output. - - ``` - cf curl /v3/packages \ - -X POST \ - -H "Content-type: application/json" \ - -d '{ - "type": "bits", - "relationships": { - "app": { - "data": { - "guid": "APP-GUID" - } - } - } - }' - ``` - Where `APP-GUID` is the app GUID that you recorded in an earlier step. This app GUID is a - unique identifier for your app. - 4. Upload the package bits by running the following `curl` command with - `POST /v3/packages/PACKAGE-GUID/upload`. - - ``` - cf curl /v3/packages/PACKAGE-GUID/upload \ - -X POST \ - -F bits=@"PACKAGED-APP" \ - ``` - - Where: - - 5. Create the build by running the following `curl` command with `POST /v3/builds`. Record the - droplet GUID from the output. - - ``` - cf curl /v3/builds \ - -X POST \ - -H "Content-type: application/json" \ - -d '{ - "package": { - "guid": PACKAGE-GUID" - } - }' - ``` - Where `PACKAGE-GUID` is the package GUID that you recorded in an earlier step. - 6. Deploy your app by running the following `curl` command with `POST /v3/deployments`. To verify - the status of the deployment or take action on the deployment, record the deployment GUID from the - output. - - ``` - cf curl /v3/deployments \ - -X POST \ - -H "Content-type: application/json" \ - -d '{ - "droplet": { - "guid": "DROPLET-GUID" - }, - "strategy": "canary", - "relationships": { - "app": { - "data": { - "guid": "APP-GUID" - } - } - } - }' - ``` - Where `DROPLET-GUID` and `APP-GUID` are the GUIDs that you recorded in earlier steps. - -For more information about this command, see [How it works](#how-it-works). - -### Continue the canary deployment - -To finish the deployment after validating the canary: - -* **For cf CLI v8+, run:** - - ``` - cf continue-deployment APP-NAME - ``` - Where `APP-NAME` is the name of the app. - -* **For CAPI V3, run:** - - ``` - cf curl /v3/deployments/DEPLOYMENT-GUID/actions/continue" -X POST - ``` - Where `DEPLOYMENT-GUID` is the GUID of the deployment that you recorded after following the - CAPI procedure in [Deploy an app](#deploy). - -This continues the rolling deployment of the app. - -## Cancel a canary deployment - -To stop the deployment of an app that you pushed: - -* **For cf CLI v8+, run:** - - ``` - cf cancel-deployment APP-NAME - ``` - Where `APP-NAME` is the name of the app. - -* **For CAPI V3, run:** - - ``` - cf curl /v3/deployments/DEPLOYMENT-GUID/actions/cancel" -X POST - ``` - Where `DEPLOYMENT-GUID` is the GUID of the deployment that you recorded after following the - CAPI procedure in [Deploy an app](#deploy). - -This reverts the app to its state from before the deployment started by: -* Removing any deployment artifacts -* Resetting the `current_droplet` on the app - -

-Note -The cancel command is designed to remove the canary instance of the app.

-If this command is used after continue-deployment it will behave like a cancelation of a rolling deployment. - -## How it works - -This section describes the canary deployments and their limitations. - -### Canary deployment - -This section describes pushing an app with a canary deployment strategy. - -1. The `cf push APP-NAME --strategy canary` command: - 1. Stages the updated app package. - 2. Creates a droplet with the updated app package. - 3. Creates a deployment with the new droplet and any new configuration. - * This starts a new process with one instance that shares the route with the old process. - * Now, if you run `cf app` on your app, you see multiple `web` processes. -
- For more information about the deployment object, see the [Deployments](http://v3-apidocs.cloudfoundry.org/index.html#deployments) section of the CAPI V3 documentation. - -2. After the command creates the deployment, the `cc_deployment_updater` BOSH job runs in the -background, updating deployments as follows: - 1. Adds another instance of the new web process and removes an instance from the old web process. This step repeats until the new web process reaches the required number of instances. -

- Important - This happens only if all instances of the new web process are running.

- 2. Removes the old web process. The new web process now fully replaces the old web process. - 3. Restarts all non-web processes of the app. - 4. Sets the deployment to `PAUSED`. - -3. After validating that the canary instance is running as expected execute the command `cf continue-deployment APP-NAME`: - 1. Changes the deployment reason to `DEPLOYING` and starts doing a rolling deployment - -4. After the command changes the status of the deployment, the `cc_deployment_updater` BOSH job runs in the -background, updating deployments as follows: - 1. Adds MaxInFlight number of instances (**by default it is 1**) of the new web process and removes MaxInFlight number of instance from the old web process. This step repeats until the new web process reaches the required number of instances. -

- Important - This happens only if all instances of the new web process are running.

- 2. Removes the old web process. The new web process now fully replaces the old web process. - 3. Restarts all non-web processes of the app. - 4. Sets the deployment to `DEPLOYED`. - -### Limitations - -The following table describes the limitations of when using canary deployments. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
LimitationDescription
Multiple app versionsDuring a deployment, <%= vars.app_runtime_abbr %> serves both the old and new version of your app at the - same route. This can lead to user issues if you push backwards-incompatible API changes.
Database migrationsDeployments do not handle database migrations. Migrating an app database when the existing - app is not compatible with the migration can result in downtime.
Non-web processesCanary deployment will only create an instance of the web process.
QuotasPushing updates to your app using a canary deployment strategy creates an extra instance - of your app. If you lack sufficient quota, the deployment fails. Administrators might need to increase - quotas to accommodate canary deployments.
Simultaneous apps when interrupting a pushIf you push app before your previous push command for the same app has completed, your - first push gets interrupted. Until the last deployment completes, there might be many versions - of the app running at the same time. Eventually, the app runs the code from your most recent - push.
Evaluating the Canary Instance - Given that the current processes share the same route the best way to validate that traffic is reaching the canary instance by looking at the logs. - The logs for all instance will be tagged with "process_id", and "revision_version". - - Using CF CLI the logs can be retrieved using "cf logs APP_NAME" and search for "revision version" -
- - -## View the status of canary deployments - -You can use CAPI to view the status of canary deployment. - -To view the status of a canary deployment: - -1. Log in to the cf CLI: - - ``` - cf login - ``` - -1. Find the GUID of your app by running: - - ``` - cf app APP-NAME --guid - ``` - Where `APP-NAME` is the name of the app. - -1. Find the deployment for that app by running: - - ``` - cf curl GET /v3/deployments?app_guids=APP-GUID&status_values=ACTIVE - ``` - Where `APP-GUID` is the GUID of the app. Deployments are listed in chronological order, with - the latest deployment displayed as the last in a list. - -1. Run: - - ``` - cf curl GET /v3/deployments/DEPLOYMENT-GUID - ``` - Where `DEPLOYMENT-GUID` is the GUID of the canary deployment. - -`cf curl GET /v3/deployments/DEPLOYMENT-GUID` returns these status properties for canary deployments: - -* `status.value`: Indicates if the deployment is `ACTIVE` or `FINALIZED`. - -* `status.reason`: Provides detail about the deployment status. - -* `status.details`: Provides the timestamp for the most recent successful health check. - The value of the `status.details` property can be `nil` with no successful health check - for the deployment. For example, there might be no successful health check if the deployment was - cancelled. - -The following table describes the possible values for the `status.value` and `status.reason` -properties: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
status.valuestatus.reasonDescription
ACTIVEDEPLOYINGThe deployment is deploying.
ACTIVEPAUSEDThe deployment is paused waiting for the user to continue with the deployment.
ACTIVECANCELLINGThe deployment is cancelling.
FINALIZEDDEPLOYEDThe deployment was deployed.
FINALIZEDCANCELLEDThe deployment was cancelled.
FINALIZEDSUPERSEDEDThe deployment was stopped and did not finish deploying because there was another - deployment created for the app. -
diff --git a/deploy-apps/cf-networking.html.md.erb b/deploy-apps/cf-networking.html.md.erb index eb0a1471..35104328 100644 --- a/deploy-apps/cf-networking.html.md.erb +++ b/deploy-apps/cf-networking.html.md.erb @@ -7,7 +7,6 @@ owner: CF for VMs Networking The container-to-container networking feature, also known as CF Networking, allows direct network traffic between apps. For an overview of how container-to-container networking works, see [Container-to-container networking](../../concepts/understand-cf-networking.html).

-Important Container-to-container networking is not available for apps hosted on Microsoft Windows.

<%= vars.app_traffic_logging %> diff --git a/deploy-apps/cf-scale.html.md.erb b/deploy-apps/cf-scale.html.md.erb index 17517652..66f2311e 100644 --- a/deploy-apps/cf-scale.html.md.erb +++ b/deploy-apps/cf-scale.html.md.erb @@ -11,7 +11,7 @@ For many apps, increasing the available disk space or memory can improve overall Similarly, running additional instances of an app can allow the app to handle increases in user load and concurrent requests. These adjustments are called "scaling" an app. -Use [cf scale](http://cli.cloudfoundry.org/en-US/cf/scale.html) to scale your app up or down to meet changes in traffic +Use `cf scale` to scale your app up or down to meet changes in traffic or demand. <%=vars.autoscaler_note_dev_guide%> @@ -34,7 +34,6 @@ $ cf scale myApp -i 5

-Note In cf CLI v7+, you can also use --process with cf scale to scale specific processes of your app.

## Scaling vertically diff --git a/deploy-apps/deploy-app.html.md.erb b/deploy-apps/deploy-app.html.md.erb index ad453c46..520fe880 100644 --- a/deploy-apps/deploy-app.html.md.erb +++ b/deploy-apps/deploy-app.html.md.erb @@ -188,14 +188,8 @@ You can configure the `cf push` command to run custom initialization tasks for These tasks run after <%= vars.app_runtime_abbr %> loads the app droplet but before it starts the app to allow the initialization script to access the app language runtime environment. For example, your script can map values from `$VCAP_SERVICES` into other environment variables or a config file that the app uses.
-Important -The following notes include important information about configuring app initialization when you use certain buildpacks: +See the following important information about configuring app initialization when you use certain buildpacks:
-For more information about the `cf ssh` command, see the [Cloud Foundry CLI reference guide](https://cli.cloudfoundry.org/en-US/cf/ssh.html). +For more information about the `cf ssh` command, enter `cf ssh --help`. ### CELL @@ -152,7 +164,7 @@ debugging because it might affect app performance. ## Viewing Logs -To view logs, run the `cf logs` command. You can tail, dump, or filter log output. For more information about the `cf logs` command, see the [Cloud Foundry CLI reference guide](https://cli.cloudfoundry.org/en-US/cf/logs.html). +To view logs, run the `cf logs` command. You can tail, dump, or filter log output. For more information about the `cf logs` command, enter `cf logs --help`. ### Tailing logs diff --git a/deploy-apps/troubleshoot-app-health.html.md.erb b/deploy-apps/troubleshoot-app-health.html.md.erb index cf524594..e251be78 100644 --- a/deploy-apps/troubleshoot-app-health.html.md.erb +++ b/deploy-apps/troubleshoot-app-health.html.md.erb @@ -211,7 +211,6 @@ To view app logs streamed in real time, run `cf logs APP-NAME`. To aggregate your app logs to view log history, bind your app to a syslog drain service. For more information, see [Streaming app logs to log management services](./../services/log-management.html).

-Important The Diego architecture does not support the cf files command, and cf files was removed as of cf CLI v7.

### Trace Cloud Controller REST API calls @@ -240,7 +239,6 @@ export CF_TRACE=PATH-TO-TRACE.LOG ```

-Caution CF_TRACE is a local environment variable that modifies the behavior of the cf CLI. Do not confuse CF_TRACE with the variables in the container environment where your apps run. For more information about these container variables, see Examine environment variables.

### Analyze Zipkin trace IDs @@ -261,7 +259,6 @@ Some cf CLI commands return connection credentials. Remove credentials and other * `cf app APP-NAME`: Returns information about the processes in the current space. Apps are listed alphabetically.

- Important CPU values returned by cf app show the total usage of each app instance on all CPU cores on a host VM, where each core contributes 100%. For example, the CPU of a single-threaded app instance on a Diego Cell with one core cannot exceed 100%, and four instances sharing the Diego Cell cannot exceed an average CPU of 25%. A multi-threaded app instance running alone on a Diego Cell with eight cores can draw up to 800% CPU.

* `cf env APP-NAME`: Returns environment variables set using `cf set-env` and variables existing in the container environment. @@ -275,7 +272,6 @@ Logging in <%= vars.app_runtime_abbr %>_. * `cf logs APP-NAME`: Returns a real-time stream of the app stdout and stderr. Press **Ctrl+C** or **Command+C** on your keyboard to exit the real-time stream.

-Important Your app must direct its logs to stdout and stderr. The cf logs command also returns messages from any Log4j facility that you configure to send logs to STDOUT. For more information, see the Log4j website.

diff --git a/deploy-apps/windows-stacks.html.md.erb b/deploy-apps/windows-stacks.html.md.erb index f75d1784..eed02d9d 100644 --- a/deploy-apps/windows-stacks.html.md.erb +++ b/deploy-apps/windows-stacks.html.md.erb @@ -20,13 +20,12 @@ You can also use the Stack Auditor plug-in for the Cloud Foundry Command Line In A stack is a prebuilt root file system (rootfs) that supports a specific operating system. For example, Linux-based systems need `/usr` and `/bin` directories at their root and Windows needs `/windows`. The stack works in tandem with a buildpack to support apps running in compartments. Under Diego architecture, cell VMs can support multiple stacks.

-Note Docker apps do not use stacks.

## Available stacks -If you push your <%= vars.windows_runtime_abbr %> <%= vars.current_major_version ? "v#{vars.current_major_version}" : "" %> app to a Windows stack, you must use `windows`. -The `windows2016` stack is not supported on <%= vars.windows_runtime_abbr %>. +If you push your Cloud Foundry app to a Windows stack, you must use `windows`. +The `windows2016` stack is not supported on Cloud Foundry. ## Restaging apps on a new stack diff --git a/http2-protocol.html.md.erb b/http2-protocol.html.md.erb index f50a25ed..fc34263e 100644 --- a/http2-protocol.html.md.erb +++ b/http2-protocol.html.md.erb @@ -91,8 +91,8 @@ To push an HTTP/1.1 app that can serve HTTP/2 traffic: ``` Where `MY-APP.EXAMPLE.COM` is the route mapped to your app.

The request and response are both issued over HTTP/2. +

- Important To issue this request, you must use a version of curl that supports HTTP/2.

1. Review the app logs by running: @@ -144,8 +144,7 @@ For example, you can use the HTTP/2 test app from [Cloud Foundry Acceptance Test The recommended way to do this is using the `routes` attribute in the manifest YAML file.

-Important -The following procedure is supported only for cf CLI v6. The `--hostname` flag is deprecated in cf CLI v7, and must be specified in the manifest.

+The following procedure is supported only for cf CLI v6. The --hostname flag is deprecated in cf CLI v7, and must be specified in the manifest.

To push an app that serves HTTP/2 traffic using the cf CLI (v6 only): diff --git a/index.html.md.erb b/index.html.md.erb index 9677d668..6dd3d23e 100644 --- a/index.html.md.erb +++ b/index.html.md.erb @@ -33,14 +33,14 @@ If you do these things, you are a <%= vars.app_runtime_abbr %> **developer**, a * [Starting, restarting, and restaging apps](deploy-apps/start-restart-restage.html) * [Pushing an app with multiple processes](multiple-processes.html) * [Running cf push sub-step commands](push-sub-commands.html) - * [Canary app deployments](deploy-apps/canary-deploy.html) - * [Rolling app deployments](deploy-apps/rolling-deploy.html) + * [Configuring app deployments](deploy-apps/rolling-deploy.html) * [Pushing apps with sidecar processes](sidecars.html) * [Using blue-green deployment to reduce downtime and risk](deploy-apps/blue-green.html) * [Troubleshooting app deployment and health](deploy-apps/troubleshoot-app-health.html) * **Routes and Domains:** How to configure routes and domains. * [Configuring routes and domains](deploy-apps/routes-domains.html) + * [Configuring per-route options](custom-per-route-options.html) * [Configuring <%= vars.app_runtime_abbr %> to route traffic to apps on custom ports](custom-ports.html) * [Routing HTTP/2 and gRPC traffic to apps](http2-protocol.html) diff --git a/multiple-processes.html.md.erb b/multiple-processes.html.md.erb index f1ed829b..b5ac0b93 100644 --- a/multiple-processes.html.md.erb +++ b/multiple-processes.html.md.erb @@ -124,5 +124,4 @@ To view the processes running as part of an app:

- Important To avoid security exposure, ensure that you migrated your apps and custom buildpacks to use the cflinuxfs4 stack based on Ubuntu 22.04 LTS (Jammy Jellyfish). The cflinuxfs3 stack is based on Ubuntu 18.04 (Bionic Beaver), which reaches end of standard support in April 2023.

diff --git a/push-sub-commands.html.md.erb b/push-sub-commands.html.md.erb index 39010adc..bb7ce7a7 100644 --- a/push-sub-commands.html.md.erb +++ b/push-sub-commands.html.md.erb @@ -13,6 +13,7 @@ Here are some example use cases for the sub-step commands: * Calling external services to report audit data during push * Scanning a droplet before deploy * Integrating with a change request system +* Running droplets built on a different Cloud Foundry deployment To support these custom push workflows, Cloud Foundry divides apps into smaller building blocks. @@ -20,15 +21,11 @@ The following table describes the building blocks as resources and lists the com For information about using these commands, see [Example workflows](#example-workflows). -

-Important -The cf CLI v6 commands described in this topic are experimental and unsupported, but are supported in cf CLI v7. The latest supported cf CLI release is cf CLI v8. To upgrade to cf CLI v7, see Upgrading to cf CLI v7. To upgrade to cf CLI v8, see Upgrading to cf CLI v8.

- - + @@ -36,6 +33,8 @@ The cf CLI v6 commands described in this topic are experimental and unsupported, For more information, see Apps in the CAPI documentation. @@ -47,12 +46,13 @@ The cf CLI v6 commands described in this topic are experimental and unsupported, - @@ -76,7 +78,8 @@ The cf CLI v6 commands described in this topic are experimental and unsupported, For more information, see Space Manifest in the CAPI documentation. @@ -105,7 +108,7 @@ This example workflow describes how to push an app using sub-step commands inste ``` Where `APP-NAME` is the name of your app. -1. Locate and copy the `package guid` from the output of an earlier step. See the following example output: +1. Locate and copy the `package guid` from the output of an earlier step or by using the `cf packages` command. See the following example output:
     Uploading and creating bits package for app APP-NAME in org test / space test as admin...
@@ -124,7 +127,7 @@ This example workflow describes how to push an app using sub-step commands inste
         
  • PACKAGE-GUID is the package GUID you recorded in an earlier step.
  • -3. Locate and copy the `droplet guid` from the output of an earlier step. See the following example output: +3. Locate and copy the `droplet guid` from the output of an earlier step or by using the `cf droplets` command. See the following example output:
         Staging package for APP-NAME in org test / space test as admin...
    @@ -138,7 +141,7 @@ This example workflow describes how to push an app using sub-step commands inste
     4. Assign the droplet to your app:
     
         ```
    -    cf set-droplet APP-NAME -d DROPLET-GUID
    +    cf set-droplet APP-NAME DROPLET-GUID
         ```
         Where:
         
    @@ -454,7 +447,7 @@ To create an SMB volume service:
           
  • SERVICE-INSTANCE-NAME is a name you provide for this SMB volume service instance.
  • //SERVER/SHARE is the SMB address of your server and share.
  • - (Optional) SMB-VERSION is the SMB protocol version you want to use. For example, to use SMB 2.1, set the version to 2.1. Valid values are 1.0, 2.0, 2.1, or 3.0. If you do not specify a version, the client and server negotiate a protocol version at mount time. The client and server usually select the latest available version. + (Optional) SMB-VERSION is the SMB protocol version you want to use. For example, to use SMB 2.1, set the version to 2.1. Valid values are 1.0, 2.0, 2.1, or 3.0, 3.1.1. If you do not specify a version, the client and server negotiate a protocol version at mount time. The client and server usually select the latest available version. 3.1.1 is supported as of [v3.2.0 smb-volume-release](https://github.com/cloudfoundry/smb-volume-release/releases/tag/v3.2.0).
  • @@ -476,13 +469,13 @@ To deploy and bind a sample app: cd ~/workspace ``` ```console - git clone https://github.com/cloudfoundry/persi-acceptance-tests.git + git clone https://github.com/cloudfoundry/cf-acceptance-tests.git ``` -1. Change into the `persi-acceptance-tests/assets/pora/` directory: +1. Change into the `cf-acceptance-tests/assets/pora/` directory: ```console - cd ~/workspace/persi-acceptance-tests/assets/pora + cd ~/workspace/cf-acceptance-tests/assets/pora ``` 1. Push the `pora` test app. Run: diff --git a/services/application-binding.html.md.erb b/services/application-binding.html.md.erb index 362f1556..182b4bfc 100644 --- a/services/application-binding.html.md.erb +++ b/services/application-binding.html.md.erb @@ -9,7 +9,9 @@ You can bind your apps to service instances for the purpose of generating creden ## Bind a service instance -Binding a service instance to your app triggers credentials to be provisioned for the service instance and delivered to the app runtime in the [VCAP_SERVICES](../deploy-apps/environment-variable.html) environment variable. For details about consuming these credentials with your app, see [Using bound service instances](#use). +Binding a service instance to your app triggers credentials to be provisioned for the service instance and delivered to the app runtime. CloudFoundry offers 3 different methods to deliver those credentials to the app. + +For details about the different delivery methods and consumption of these credentials with your app, see [Credential Delivery Methods](#credential-delivery-methods). Not all services support binding, as some services deliver value to users directly without integration with an app. In many cases, binding credentials are unique to an app, and another app bound to the same service instance receives different credentials, but this depends on the service. @@ -23,9 +25,147 @@ $ cf restart my-app

    -Important You must restart or in some cases re-push your app for changes to be applied to the VCAP_SERVICES environment variable and for the app to recognize these changes.

    +### Credential Delivery Methods + +After your service instance is created and bound to your app, the credentials, along with some metadata, are available in the app container and can be consumed by your app. +There are three delivery methods, which are mutually exclusive. The developer can choose which one to use and then must adjust the consumption in the app accordingly. +For details about consuming credentials specific to your development framework, see the Service Binding section in the documentation for your framework's [buildpack](../../buildpacks/index.html). + +

    +If the application is unable to consume the credentials through the selected delivery method, it may cause downtime for the application. This is because the application won't be able to connect to the services it is bound to. +

    + + +#### Default VCAP_SERVICES environment variable + +By default, credentials and additional metadata for all bound service instances are stored in the VCAP_SERVICES environment variable. + +There are two methods developers can use to have their apps consume binding credentials. + +* **Parse the JSON yourself:** See the documentation for [VCAP_SERVICES](../deploy-apps/environment-variable.html#VCAP-SERVICES). Helper libraries are available for some frameworks. +* **Auto-configuration:** Some buildpacks create a service connection for you by creating additional environment variables, updating config files, or passing system parameters to the JVM. + +For checking the binding data manually app developers can use `cf env`. See [View Env](../deploy-apps/environment-variable.html#view-env). + +

    +The maximum size of content of the VCAP_SERVICES environment variable is 130 KB. If you want to bind more services to the app or the services you want to bind provide lots of data, you can use one of the other methods.

    + +#### File-based VCAP services (experimental) + +This delivery method is used when the app feature [file-based-vcap-services](https://v3-apidocs.cloudfoundry.org/index.html#app-features) is enabled. +The environment variable [VCAP_SERVICES_FILE_PATH](../deploy-apps/environment-variable.html#VCAP-SERVICES-FILE-PATH) will be made available in the app container and contains the path to a file containing the same content as the VCAP_SERVICES environment variable above. + +The binding data can be viewed like this: + +``` +cf ssh -c 'cat $VCAP_SERVICES_FILE_PATH' +``` + +

    +The vcap_services file content cannot exceed 1 MB, otherwise an IncompatibleBindings error is raised.

    + +#### Service Binding K8s (experimental) + +This delivery method is used when the app feature [service-binding-k8s](https://v3-apidocs.cloudfoundry.org/index.html#app-features) is enabled. +The environment variable [SERVICE_BINDING_ROOT](../deploy-apps/environment-variable.html#SERVICE-BINDING-ROOT) is made available in the app container. It contains the path to the root folder of a file structure containing binding information. +This method is fully compatible with the specification on [servicebinding.io](https://servicebinding.io/), which is used by Kubernetes as well. + +The binding data can be viewed like this: + +``` +cf ssh -c 'find $SERVICE_BINDING_ROOT -type f -exec bash -c "echo {}: \$(cat {})" \;' +``` + +

    +The bytesize of all files and their content combined cannot exceed 1 MB, otherwise an IncompatibleBindings error is raised.

    + +Here are some examples outlining the transformation of VCAP_SERVICES to the file structure: + +Nested structures inside their value will be serialized as JSON objects. The same applies if the value is a list. + +``` +VCAP_SERVICES= { + "foo": [ + { + "name": "foo", + "credentials": { + "simple": "value", + "deeply": { + "nested": "value" + }, + "list": ["v", "a", "l", "u", "e"] + } + } + ] +} + +Service Binding Files: + foo/name: foo + foo/simple: value + foo/deeply: {"nested":"value"} + foo/list: ["v","a","l","u","e"] +``` + +Existing credential keys can be overwritten by other attributes -- [VCAP_SERVICES](../deploy-apps/environment-variable.html#VCAP-SERVICES) attributes plus type and provider. The full list of reserved file names is: binding-guid, binding-name, instance-guid, instance-name, name, label, tags, plan, syslog-drain-url, volume-mounts, type, and provider. Overwriting an existing key does not result in an error. + +``` +VCAP_SERVICES= { + "foo": [ + { + "name": "foo", + "credentials": { + "name": "user", + "secret": "password" + } + } + ] +} + +Service Binding Files: + foo/name: foo + foo/secret: password +``` + +Empty lists or null values are omitted; that is, no file will be created. + +``` +VCAP_SERVICES= { + "foo": [ + { + "name": "foo", + "binding_guid": "45436ca8-0a7c-45e3-9439-ca1b44db7a2b", + "syslog_drain_url": null, + "volume_mounts": [] + } + ] +} + +Service Binding Files: + foo/name: foo + foo/binding-guid: 45436ca8-0a7c-45e3-9439-ca1b44db7a2b +``` + +Binding names and keys resulting in filenames must match [a-z0-9\-.]{1,253}. Invalid binding names and keys result in IncompatibleBindings error. VCAP_SERVICES attributes are transformed to comply with this schema; that is, underscores are replaced by hyphens, so that, for example, `VCAP_SERVICES attribute binding_guid` becomes file name `binding-guid`. + +``` +VCAP_SERVICES= { + "foo": [ + { + "name": "foo", + "binding_guid": "45436ca8-0a7c-45e3-9439-ca1b44db7a2b", + "instance_guid": "83745ca8-0a7c-45e3-9439-ca1b44db7a2b" + } + ] +} + +Service Binding Files: + foo/name: foo + foo/binding-guid: 45436ca8-0a7c-45e3-9439-ca1b44db7a2b + foo/instance-guid: 83745ca8-0a7c-45e3-9439-ca1b44db7a2b +``` + ### Arbitrary parameters Some services support additional configuration parameters with the bind request. These parameters are passed in a valid JSON object containing service-specific configuration parameters, provided either in-line or in a file. For a list of supported configuration parameters, see documentation for the particular service offering. @@ -91,7 +231,7 @@ OK The provided name is available in the `name` and `binding_name` properties in the [VCAP_SERVICES](../deploy-apps/environment-variable.html) environment variable: -~~~ +``` "VCAP_SERVICES": { "service-name": [ { @@ -101,16 +241,7 @@ The provided name is available in the `name` and `binding_name` properties in th } ] } -~~~ - -### Using bound service instances - -After your service instance is created and bound to your app, you must configure the app to dynamically fetch the credentials for your service instance. The [VCAP_SERVICES](../deploy-apps/environment-variable.html#VCAP-SERVICES) environment variable contains credentials and additional metadata for all bound service instances. There are two methods developers can use to have their apps consume binding credentials. - -* **Parse the JSON yourself:** See the documentation for [VCAP_SERVICES](../deploy-apps/environment-variable.html#VCAP-SERVICES). Helper libraries are available for some frameworks. -* **Auto-configuration:** Some buildpacks create a service connection for you by creating additional environment variables, updating config files, or passing system parameters to the JVM. - -For details about consuming credentials specific to your development framework, see the Service Binding section in the documentation for your framework's [buildpack](../../buildpacks/index.html). +``` ## Update service credentials @@ -177,5 +308,4 @@ OK

    -Important You must restart or in some cases re-push your app for changes to be applied to the VCAP_SERVICES environment variable and for the app to recognize these changes.

    diff --git a/services/fluentd.html.md.erb b/services/fluentd.html.md.erb index a76a5b64..4be4faf1 100644 --- a/services/fluentd.html.md.erb +++ b/services/fluentd.html.md.erb @@ -58,7 +58,6 @@ To set up Fluentd for Cloud Foundry, configure the syslog input of Fluentd as fo 2. Restart the Fluentd service.

    -Important The Fluentd syslog input plug-in supports tls and tcp options. You must use the same transport that Cloud Foundry is using.

    Fluentd starts listening for syslog message on port 8080 and tagging the messages with `cf.app`, which can be used later for data routing. For more details about the full setup for the service, see [Config File](https://docs.fluentd.org/configuration/config-file). diff --git a/services/index.html.md.erb b/services/index.html.md.erb index e49f9f24..78802800 100644 --- a/services/index.html.md.erb +++ b/services/index.html.md.erb @@ -13,7 +13,6 @@ Cloud Foundry offers a Marketplace of services, from which users can provision r For more information about provisioning service instances and other life cycle operations, see [Managing service instances](./managing-services.html).

    -Note For a service to be available in the Marketplace, it must be integrated with Cloud Foundry by way of APIs. <%= vars.custom_services %>

    ### User-provided service instances @@ -38,7 +37,6 @@ Credentials managed manually are known as service keys. Use service keys when yo For more information about creating a user-provided service instance with service keys, see [User-provided service instances](./user-provided.html). For more information about service keys, see [Managing service keys](./service-keys.html).

    -Important Not all services support service keys. Some services support credentials through app binding only.

    @@ -71,7 +69,6 @@ If your app relies on a relational database, you must apply schema changes perio For more information about running cf CLI tasks, see [Running tasks in your apps](../using-tasks.html).

    -Important To run tasks with the cf CLI, you must install cf CLI v6.23.0 or later. The current supported version is cf CLI v8. For information about downloading, installing, and uninstalling the cf CLI, see the Installing the cf CLI.

    To do a database schema migration with cf CLI: @@ -82,7 +79,6 @@ To do a database schema migration with cf CLI: Where `APP-NAME` is the name of the app.

    - Note To run a task without starting the app, push the app with cf push -i 0 and then run the task. You can run the app later by scaling up its instance count.

    1. Do a database schema migration as a task on the app: diff --git a/services/log-management.html.md.erb b/services/log-management.html.md.erb index 4232e6a7..451b3b8e 100644 --- a/services/log-management.html.md.erb +++ b/services/log-management.html.md.erb @@ -68,7 +68,7 @@ You can create a syslog drain service and bind apps to it using Cloud Foundry Co
  • SYSLOG-DRAIN-URL is the syslog URL from Step 1: Configure the Log Management Service.
  • - By default, the syslog agent forwards only application logs to a syslog server. To have the application [container metrics](../../loggregator/container-metrics.html) like CPU, memory, or disk usage forwarded as well, use the `drain-data` parameter to specify if only logs (default), only container metrics, only traces ([timers](https://github.com/cloudfoundry/loggregator-api/blob/master/README.md#timer) from the Loggregator v2 API specification), or all of them are forwarded by the syslog drain. Add the `drain-data` parameter to the `SYSLOG-DRAIN-URL`. + By default, the Syslog Agent forwards only application logs to a syslog server. To have the application [container metrics](../../loggregator/container-metrics.html) like CPU, memory, or disk usage forwarded as well, use the `drain-data` parameter to specify if only logs (default), only container metrics, only traces ([timers](https://github.com/cloudfoundry/loggregator-api/blob/master/README.md#timer) from the Loggregator v2 API specification), or all of them are forwarded by the syslog drain. Add the `drain-data` parameter to the `SYSLOG-DRAIN-URL`.
         $ cf create-user-provided-service DRAIN-NAME -l SYSLOG-URL?drain-data=DRAIN-DATA-VALUE
    @@ -101,7 +101,7 @@ You can create a syslog drain service and bind apps to it using Cloud Foundry Co
         If you are using the mTLS feature delivered in [CAPI release 1.143.0](https://github.com/cloudfoundry/capi-release/releases/tag/1.143.0), you can use the `-p` flag to define the client certificate and key as credentials, filling in values as follows.
    -    $ cf create-user-provided-service DRAIN-NAME -l SYSLOG-URL -p '{"cert":"-----BEGIN CERTIFICATE-----\nMIIH...-----END CERTIFICATE-----","key":"-----BEGIN PRIVATE KEY-----\nMIIE...-----END PRIVATE KEY-----"}
    +    $ cf create-user-provided-service DRAIN-NAME -l SYSLOG-URL -p '{"cert":"-----BEGIN CERTIFICATE-----\nMIIH...-----END CERTIFICATE-----","key":"-----BEGIN PRIVATE KEY-----\nMIIE...-----END PRIVATE KEY-----"}'
         
    If your certs include the V3 extension `X509v3 Extended Key Usage`, ensure that you are using the right key policies. For TLS, you need server authentication, and for mTLS, you also need client authentication. For example, TLS Web Server Authentication for TLS with TLS Web Client Authentication for mTLS is defined as follows: @@ -121,12 +121,29 @@ You can create a syslog drain service and bind apps to it using Cloud Foundry Co A combination of the approaches described earlier uses a certificate authority for a server certificate signed by your private ca and a client certificate and key.
    -    $ cf create-user-provided-service DRAIN-NAME -l SYSLOG-URL -p '{"ca":"-----BEGIN CERTIFICATE-----\nMIIH...-----END CERTIFICATE-----", "cert":"-----BEGIN CERTIFICATE-----\nMIIH...-----END CERTIFICATE-----","key":"-----BEGIN PRIVATE KEY-----\nMIIE...-----END PRIVATE KEY-----"}
    +    $ cf create-user-provided-service DRAIN-NAME -l SYSLOG-URL -p '{"ca":"-----BEGIN CERTIFICATE-----\nMIIH...-----END CERTIFICATE-----", "cert":"-----BEGIN CERTIFICATE-----\nMIIH...-----END CERTIFICATE-----","key":"-----BEGIN PRIVATE KEY-----\nMIIE...-----END PRIVATE KEY-----"}'
         
    + When setting up your syslog drain, it is important to choose the correct scheme for your SYSLOG-URL: + + + If you need to use TLS or mTLS, ensure that you provide the necessary CA certificate. Additionally to the CA certificate for mTLS configuration, both the client certificate and the key must be provided. + + Ensure that certificates and keys are PEM-encoded as specified in RFC-1422. They should be provided as string values, with new lines represented by the `\n` character, and must not have trailing new lines. You can convert a PEM-encoded certificate string to a processable format using the following command: + +
    +    $ awk 'NF {sub(/\r/, ""); printf "%s\\n",$0;}' cert.pem | sed 's/\\n$//' | tr -d '\n'
    +    
    + + The `cf create-user-provided-service` command accepts any JSON payload without validating the certificates or credentials while creating the syslog drain. There is no error message for wrong certificates or credentials in the cf CLI; you can only validate in your target log service if your syslog drain was configured correctly. To troubleshoot your certificates, you can use the openssl command line tool. + For more information, see [User-provided service instances](./user-provided.html). -2. To bind an app to the service instance, do one of these: +1. To bind an app to the service instance, do one of these: * Run `cf push` with a manifest. The services block in the manifest must specify the service instance that you want to bind. * Run `cf bind-service`: diff --git a/services/managing-services.html.md.erb b/services/managing-services.html.md.erb index 765c5c9c..83b01300 100644 --- a/services/managing-services.html.md.erb +++ b/services/managing-services.html.md.erb @@ -82,7 +82,7 @@ OK ### Instance tags _Instance tags require cf CLI v6.12.1+_ -Some services provide a list of tags that Cloud Foundry delivers in the [VCAP_SERVICES environment variable](../deploy-apps/environment-variable.html#VCAP-SERVICES). These tags provide developers with a more generic way for apps to parse `VCAP_SERVICES` for credentials. Developers might provide their own tags when creating a service instance by including the `-t` flag followed by a comma-separated list of tags. +Some services provide a list of tags that Cloud Foundry delivers to the app when the service is bound. These are included in the [VCAP_SERVICES environment variable](../deploy-apps/environment-variable.html#VCAP-SERVICES) or the file system, depending on the chosen [Credential Delivery Method](./application-binding.html#credential-delivery-methods). These tags provide developers with a more generic way for apps to parse the service binding data for credentials. Developers might provide their own tags when creating a service instance by including the `-t` flag followed by a comma-separated list of tags. Example providing a comma-separated list of tags: @@ -151,7 +151,7 @@ Not all services support binding, as some services deliver value to users direct Depending on the service, binding a service instance to your app might deliver credentials for the service instance to the app. See [Delivering service credentials to an app](application-binding.html) for more information. Binding a service instance to an app can trigger app logs to be streamed to the service instance. See [Streaming app logs to log management services](log-management.html). -You must restart, or in some cases, re-push your app for changes to be applied to the VCAP_SERVICES environment variable and for the app to recognize these changes. +You must restart, or in some cases re-push, your app so that new or changed binding data is delivered in the VCAP_SERVICES environment variable or the file system, depending on the chosen [Credential Delivery Method](./application-binding.html#credential-delivery-methods).
     $ cf bind-service my-app mydb
    @@ -222,9 +222,9 @@ Binding service my-db to app rails-sample in org console / space development as
     
     ### Unbind a service instance from an app
     
    -Unbinding a service instance from an app removes the credentials created for your app from the [VCAP_SERVICES](../deploy-apps/environment-variable.html) environment variable.
    +Unbinding a service instance from an app removes the credentials from the VCAP_SERVICES environment variable or the file system, depending on the chosen [Credential Delivery Method](./application-binding.html#credential-delivery-methods).
     
    -You must restart or in some cases re-push your app for changes to be applied to the VCAP_SERVICES environment variable and for the app to recognize these changes.
    +You must restart, or in some cases re-push, your app for changes to be applied.
     
     
     $ cf unbind-service my-app mydb
    @@ -252,7 +252,7 @@ OK
     
     ## Rename a service instance
     
    -You can change the name given to a service instance. Upon restarting any bound apps, the name of the instance changes in the [VCAP_SERVICES](../deploy-apps/environment-variable.html) environment variable. If your app depends on the instance name for discovering credentials, changing the name might break your app's use of the service instance.
    +You can change the name given to a service instance. Upon restarting any bound apps, the name of the instance changes in the [VCAP_SERVICES](../deploy-apps/environment-variable.html) environment variable or the file system depending on the chosen [Credential Delivery Method](./application-binding.html#credential-delivery-methods). If your app depends on the instance name for discovering credentials, changing the name might break your app's use of the service instance.
     
     
     $ cf rename-service mydb mydb1
    @@ -294,8 +294,6 @@ Updating service instance mydb as user@example.com...
     ###  Instance tags
     _Instance tags require cf CLI v6.12.1+_
     
    -Some services provide a list of tags that Cloud Foundry delivers in the [VCAP_SERVICES environment variable](../deploy-apps/environment-variable.html#VCAP-SERVICES). These tags provide developers with a more generic way for apps to parse `VCAP_SERVICES` for credentials. Developers can provide their own tags when creating a service instance by including a comma-separated list of tags with the `-t` flag.
    -
     
     $ cf update-service my-db -t "staging, web"
     
    @@ -306,7 +304,6 @@ OK
     ##  Upgrade a service instance
     
     

    -Important Upgrading a Service instance requires at least cf CLI v6.46.0+ and CAPI release 1.83.0+.

    diff --git a/services/route-binding.html.md.erb b/services/route-binding.html.md.erb index 2f2fc64a..3a8279d2 100644 --- a/services/route-binding.html.md.erb +++ b/services/route-binding.html.md.erb @@ -22,10 +22,9 @@ To view an example demonstrating the use of a sample route service, see [Route S You must install the Cloud Foundry Command Line Interface (cf CLI) to bind a route to a service instance. For more information, see [Installing the cf CLI](../../cf-cli/install-go-cli.html).

    -Important Gorouter rejects WebSocket requests for routes that are bound to route services. These requests return a 503 error and a X-Cf-Routererror route_service_unsupported header.

    -Run [cf bind-route-service](http://cli.cloudfoundry.org/en-US/cf/bind-route-service.html) to bind a route from an app to a service instance. +Run `cf bind-route-service` to bind a route from an app to a service instance. The following example binds the route from `my-app.<%=vars.app_domain%>` to the service instance `my-route-service`. @@ -37,7 +36,6 @@ OK

    -Caution When binding a service instance to a route, Cloud Foundry might have proxy requests for the route to the service instance, or configure a network component already in the request path.

    ### Bind with parameters @@ -66,7 +64,7 @@ OK You must install the Cloud Foundry Command Line Interface (cf CLI) to bind a route to a service instance. For more information, see [Installing the cf CLI](../../cf-cli/install-go-cli.html). -Run the [cf unbind-route-service](http://cli.cloudfoundry.org/en-US/cf/unbind-route-service.html) command to unbind a route from an app to a service instance. +Run the `cf unbind-route-service` command to unbind a route from an app to a service instance. This example removes the route from `my-app.<%=vars.app_domain%>` to the service instance `my-route-service`. diff --git a/services/service-keys.html.md.erb b/services/service-keys.html.md.erb index fd41c5bd..afb17ecc 100644 --- a/services/service-keys.html.md.erb +++ b/services/service-keys.html.md.erb @@ -10,7 +10,6 @@ Here are instructions for managing service instance credentials (binding credent Service keys generate credentials for manually configuring consumers of Marketplace services. After you configure them for your service, local clients, apps in other spaces, or entities outside your deployment can access your service with these keys.

    -Important Some service brokers do not support service keys. To build a service broker that supports service keys, see Services. To use a service broker that does not support service keys, see Delivering service credentials to an app.

    ## Create a service key diff --git a/services/sharing-instances.html.md.erb b/services/sharing-instances.html.md.erb index 45ce8165..7d01e26d 100644 --- a/services/sharing-instances.html.md.erb +++ b/services/sharing-instances.html.md.erb @@ -146,7 +146,6 @@ In this case, no information about other spaces is exposed. ## Unsharing a service instance

    -Caution Unsharing a service instance deletes all bindings to apps in the spaces it was shared into. This might cause apps to fail. Before unsharing a service instance, run the cf service SERVICE-INSTANCE command to find out how many bindings exist in the spaces the service instance is shared into.

    You can unshare a service instance if you have the Space Developer role in the @@ -201,7 +200,6 @@ If a service binding is not deleted, the script continues trying to unshare subs To use this script, you must be logged in as an administrator and have jq installed.

    -Caution This script was tested on macOS Sierra 10.12.4 and Ubuntu 14.04.5. Use the script at your own risk.

    ``` diff --git a/services/user-provided.html.md.erb b/services/user-provided.html.md.erb index 1cece067..050538d7 100644 --- a/services/user-provided.html.md.erb +++ b/services/user-provided.html.md.erb @@ -15,13 +15,13 @@ After creation, user-provided service instances behave like service instances cr ## Create a user-provided service instance -The alias for [cf create-user-provided-service](http://cli.cloudfoundry.org/en-US/cf/create-user-provided-service.html) is `cf cups`. +The alias for the `cf create-user-provided-service` command is `cf cups`. ### Deliver service credentials to an app Suppose a developer obtains a URL, port, user name, and password for communicating with an Oracle database managed outside of Cloud Foundry. The developer can manually create custom environment variables to configure their app with these credentials (of course you never hard code these credentials in your app!). -User-provided service instances allow developers to configure their apps with these using the familiar [App binding](application-binding.html) operation and the same app runtime environment variable used by Cloud Foundry to deliver credentials for Marketplace services ([VCAP_SERVICES](../deploy-apps/environment-variable.html#VCAP-SERVICES)). +User-provided service instances allow developers to inject credentials into the app container using the familiar [App binding](application-binding.html) operation and the same [Credential Delivery Methods](./application-binding.html#credential-delivery-methods) used by Cloud Foundry to deliver credentials for Marketplace services.
     cf cups SERVICE_INSTANCE -p '{"username":"admin","password":"pa55woRD"}'
    @@ -47,7 +47,6 @@ After creating the user-provided service instance, to deliver the credentials to
     User-provided service instances allow developers to stream app logs to a syslog compatible aggregation or analytics service that isn't available in the Marketplace. For more information about the syslog protocol see [RFC 5424](http://tools.ietf.org/html/rfc5424) and [RFC 6587](http://tools.ietf.org/html/rfc6587).
     
     

    -Important RFC-5424 is used to establish connections over HTTP/HTTPS. RFC-6587 is used for TCP based communication over syslog/syslog-tls drains.

    @@ -70,7 +69,6 @@ OK

    -Important When creating the user-provided service, the route service URL you specify must be "https."

    @@ -79,12 +77,11 @@ For more information, see [Managing app requests with route services](./route-bi ## Update a user-provided service instance -You can use [cf update-user-provided-service](http://cli.cloudfoundry.org/en-US/cf/update-user-provided-service.html) to update the attributes of an instance of a user-provided service. New credentials overwrite old credentials, and parameters that are not provided are deleted. +You can use `cf update-user-provided-service` to update the attributes of an instance of a user-provided service. New credentials overwrite old credentials, and parameters that are not provided are deleted. The alias for `update-user-provided-service` is `uups`. Bound apps can access the new configuration after restart. You can use rolling restarts to avoid any app downtime. For more information, see [Restart an app](../deploy-apps/rolling-deploy.html#restart) in _Rolling App Deployments_.

    -Caution If you are rotating credentials, the old credentials must be active until the restart is finished.

    diff --git a/sidecars.html.md.erb b/sidecars.html.md.erb index dd1a79d4..fad6fe77 100644 --- a/sidecars.html.md.erb +++ b/sidecars.html.md.erb @@ -9,7 +9,6 @@ are called sidecar processes, or sidecars. An example of a sidecar is an Applica Monitoring (APM) tool.

    -Important The cf CLI v6 commands described in this topic are unsupported, but are supported in cf CLI v7. The latest supported cf CLI release is cf CLI v8. To upgrade to cf CLI v7, see Upgrading to cf CLI v7. To upgrade to cf CLI v8, see Upgrading to cf CLI v8.

    <%= vars.capi_sidecar_req %> @@ -188,7 +187,6 @@ To push an app with a sidecar: You can explore sidecars using the app in the [capi-sidecar-samples](https://github.com/cloudfoundry-samples/capi-sidecar-samples) repository on GitHub. The following sections describe the app, how to build and push the app, and some ways to observe the app and its processes after pushing.

    -Important In this tutorial, you are pushing the Ruby sample app. You can also follow this tutorial for a Java app using the sidecar-dependent-java-app and push_java_app_with_binary_sidecar.sh in the samples repository. When pushing a Java app, follow the requirements listed in Requirements for Java apps.

    ### About the sample app @@ -255,9 +253,13 @@ To push the app and sidecar: cf push sidecar-dependent-app ``` -After you push the app, you can further explore it in [View the processes running in the container](#view-processes) and [View the web URL and app logs](#view-logs). +After you push the app, you can further explore it as described in the sections below: -### View the processes running in the container +- [View processes running in the app container via SSH](#view-processes-ssh) +- [View the web URL and app logs via SSH](#view-logs) +- [View and debug processes running in the app container via HTTP](#debug-processes-http) + +### View processes running in the app container via SSH To view the app and sidecar process running in the container: @@ -300,7 +302,7 @@ To view the app and sidecar process running in the container: ruby 13 vcap 11u IPv4 17274965 0t0 TCP localhost:42266->localhost:8082 (ESTABLISHED)
    -### View the web URL and app logs +### View the web URL and app logs via SSH To view the web URL and logs for the app: @@ -338,3 +340,124 @@ To view the web URL and logs for the app: "crash_count"=>1, "crash_timestamp"=>1555544935367052708, "version"=>"50892dcb-274d-4cf6-b944-3eda1e000283"}
    + +### View and debug processes running in the app container via HTTP + +Sidecars can be used to collect debug information (e.g. thread dumps) from +another process running in the same container. This is especially useful if you +want to debug a running process using an HTTP request, for instance if you do +not have ssh access to the application container. + +This is an example of a simple routable debug sidecar for java applications, +but the same concept can be adapted to more advanced debug tooling and other +languages or frameworks. + +#### Prerequisites + +Before you begin, you must have: + +* A java app with [a manifest](./deploy-apps/manifest.html) that is ready to be +pushed. For example, the [java sample +app](https://github.com/cloudfoundry/cf-acceptance-tests/tree/main/assets/java) +from CF Acceptance Tests. + +* A route to map to the debug sidecar + +#### Procedure + +To add a debug sidecar to the java app: + +1. Create a sidecar that responds to HTTP requests and calls `kill -3` on the +java process. When a java process receives the resulting SIGQUIT signal, it +will print a thread dump to STDOUT. For an example, see the +[java_debug_sidecar](https://github.com/Gerg/java-debug-buildpack/blob/main/java_debug_sidecar.go) +on GitHub. + +1. Place the sidecar binary in the root directory of your java app + +1. Add the following to your app manifest: + + ``` + sidecars: + - name: debug-sidecar + process_types: [ 'web' ] + command: START-COMMAND + memory: 256MB + ``` + + Where `START-COMMAND` is the command used to start the sidecar. For the above + example sidecar, `./java_debug_sidecar`. + +1. Push the java application. For example: + + ``` + cf push APP-NAME -f manifest.yml -m 1G + ``` + + Where `APP-NAME` is the name of your app. + +1. Map a route to the sidecar process's port. For detailed steps, see +[Configuring Cloud Foundry to route traffic to apps on custom ports](./custom-ports.html). + + ``` + cf curl -X PATCH /v3/routes/ROUTE-GUID/destinations -d '{ + "destinations": [ + { + "app": { + "guid": "APP-GUID", + "process": { + "type": "web" + } + }, + "port": PORT, + "protocol": "http1" + } + ] + }' + ``` + + Where: + + +1. Restart the app to complete the port mapping + + ``` + cf restart APP_NAME + ``` + + Where `APP-NAME` is the name of your app. + +1. Tail the app logs: + + ``` + cf logs APP_NAME + ``` + + Where `APP-NAME` is the name of your app. + +1. In another terminal, make a HTTP request to the sidecar, to trigger the +thread dump. For example: + + ``` + curl https://debug-sidecar.example.com/threaddump + ``` + +1. Observe the thread dump in the app logs + +### Next Steps + +Now that you have a simple debugging sidecar working, here are some ideas for +next steps: + +* Use more sophisticated debugging tools +* Return the debug information in the HTTP response, rather than logging to STDOUT +* Inject the debug sidecar via a [Sidecar +buildpacks](../buildpacks/sidecar-buildpacks.html). For example: +[java-debug-buildpack](https://github.com/Gerg/java-debug-buildpack) on GitHub. +* Add authentication for the debug sidecar's HTTP route, for instance using an +authentication [Route Service](../services/route-services.html). diff --git a/using-tasks.html.md.erb b/using-tasks.html.md.erb index 363c0427..486469dc 100644 --- a/using-tasks.html.md.erb +++ b/using-tasks.html.md.erb @@ -49,7 +49,6 @@ The life cycle of a task is as follows: The container also inherits environment variables, service bindings, and security groups bound to the app.

    -Note You cannot SSH into the container running a task.

    ### Task logging and execution history @@ -65,8 +64,8 @@ more information, see the [Cloud Foundry API documentation](http://v3-apidocs.cl Admins can set the default memory, disk usage and log rate quotas for tasks on a global level. -Tasks use the same memory, disk usage, and log rate limit defaults as apps, unless you customize them using the `cf run-task` command. For more information -about the `cf run-task` command, see the [Cloud Foundry CLI reference guide](https://cli.cloudfoundry.org/en-US/v8/run-task.html). +Tasks use the same memory, disk usage, and log rate limit defaults as apps, unless you customize them using the `cf run-task` command. +For more information about the `cf run-task` command, enter `cf help run-task`. <% if vars.platform_code == 'PCF' %> <%= partial "/pcf/core/tasks_rec_alloc_pcf" %> @@ -80,7 +79,6 @@ about the `cf run-task` command, see the [Cloud Foundry CLI reference guide](htt You can use the Cloud Foundry Command Line Interface (cf CLI) to run a task in the context of an app.
    -Important
    • To run tasks with the cf CLI, you must install cf CLI v6.23.0 or later, or install cf CLI v7 or v8. To download, install, and uninstall the cf CLI, see Installing the Cloud Foundry Command Line Interface.
    • To run a task using cf CLI v6 without starting the app, push the app with cf push -i 0 and then run the task. You can run the app later by scaling up its instance count.
    • @@ -125,7 +123,6 @@ To run a task on an app with cf CLI v6:

    - Note To run a task again, you must run it as a new task using the previous command.

    1. To display the recent logs of the app and all its tasks, run: @@ -187,7 +184,6 @@ To run a task on an app with cf CLI v7:

    - Important cf run-task allows you to include the --process and --command flags. Including the --command flag overrides the manifest property.

    The following example command runs a task on the `example-app` app: @@ -210,6 +206,42 @@ To run a task on an app with cf CLI v7: ``` Where `APP-NAME` is the name of your app. +## Get a task for an app + +To get a task for a given app: + +1. In a terminal window, run: + + ``` + cf task APP-NAME TASK-ID + ``` + + Where `APP-NAME` is the name of your app and `TASK-ID` is the ID of the task you want to get. + + The command returns output similar to the following example: + +
    +    Getting task 4 for app static in org org-1 / space space-1 as admin...
    +
    +    id:               4
    +    name:             125c884d
    +    state:            FAILED
    +    start time:       2024-11-22T17:41:19Z
    +    command:          custom_command
    +    memory in mb:     256
    +    disk in mb:       1024
    +    log rate limit:   -1
    +    failure reason:   APP/TASK/125c884d: Exited with status 127
    +    
    + +Tasks can be in the states shown in the following table: + +| State | Description | +| ----- | ----------- | +| `RUNNING` | The task is in progress. | +| `FAILED` | The task did not complete. This state occurs when a task does not work correctly or a user cancels the task. | +| `SUCCEEDED` | The task completed successfully. | + ## List tasks running on an app
    Resource DescriptionCommandCommands
    App
      +
    • cf app
    • +
    • cf apps
    • cf create-app
    • cf create-package
    • +
    • cf packages
    BuildStaging the app. Creating a build combines a Package with a Buildpack and builds it into an executable resource.
    +
    Staging the app. Creating a build combines a Package with a Buildpack and builds it into an executable resource, called a Droplet.
    For more information, see Builds in the CAPI documentation.
      @@ -66,6 +66,8 @@ The cf CLI v6 commands described in this topic are experimental and unsupported, For more information, see Droplet in the CAPI documentation.
      +
    • cf download-droplet
    • +
    • cf droplets
    • cf set-droplet
      -
    • cf create-app-manifest, cf apply-manifest
    • +
    • cf apply-manifest
    • +
    • cf create-app-manifest