Stay organized with collections
Save and categorize content based on your preferences.
These instructions will walk you through deploying the Cloud Foundry Spring
Music reference App with Kf, demonstrating a few things along the
way:
Building Java Apps from source: The Spring Music source will be built on
the cluster, not locally.
Service broker integration: You will create and bind a PostgreSQL
database to the Spring Music App.
Spring Cloud Connectors: Spring Cloud
Connectors are used by the Spring Music App to
detect things like bound CF services. They work seamlessly with Kf.
Configuring the Java version: You will specify the version of Java you
want the buildpack to use.
Prerequisites
Option 1: Minibroker
The cluster administrator should follow these instructions
to install the Minibroker service broker into your cluster. Minibroker will
allow you to provision a PostgreSQL database and configure your App to use it.
To confirm that Minibroker is installed and available to your cluster, run kf
marketplace and you should see output similar to:
Deploy (this assumes you've already kf targeted a Space; see these
docs for more detail):
kfpushspring-music
Use the proxy feature to access the deployed App, then load
http://localhost:8080 in your browser:
kfproxyspring-music
The deployed App includes a UI element showing which (if any) Spring
profile is being used. No profile is being used here, indicating an
in-memory database is in use.
Create and bind database
Create a PostgreSQL service via the broker installed in the marketplace:
Restart the App to make the service binding available via the VCAP_SERVICES
environment variable:
kfrestartspring-music
(Optional) View the binding details:
kfbindings
kf proxy to the App again and view it in your web browser. The Spring
profile should be shown, indicating the PostgreSQL service you created and
bound is being used:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-28 UTC."],[],[],null,["# Deploy Spring Music\n\nThese instructions will walk you through deploying the [Cloud Foundry Spring\nMusic](https://github.com/cloudfoundry-samples/spring-music) reference App with Kf, demonstrating a few things along the\nway:\n\n1. **Building Java Apps from source**: The Spring Music source will be built on\n the cluster, not locally.\n\n2. **Service broker integration**: You will create and bind a PostgreSQL\n database to the Spring Music App.\n\n3. **Spring Cloud Connectors** : [Spring Cloud\n Connectors](https://cloud.spring.io/spring-cloud-connectors/) are used by the Spring Music App to\n detect things like bound CF services. They work seamlessly with Kf.\n\n4. **Configuring the Java version**: You will specify the version of Java you\n want the buildpack to use.\n\nPrerequisites\n-------------\n\n### Option 1: Minibroker\n\nThe cluster administrator should follow [these instructions](/migrate/kf/docs/2.3/how-to/minibroker)\nto install the Minibroker service broker into your cluster. Minibroker will\nallow you to provision a PostgreSQL database and configure your App to use it.\n\nTo confirm that Minibroker is installed and available to your cluster, run `kf\nmarketplace` and you should see output similar to: \n\n $ kf marketplace\n 5 services can be used in Space \"demo\", use the --service flag to list the plans for a service\n\n Broker Name Space Status Description\n minibroker mariadb Active Helm Chart for mariadb\n minibroker mongodb Active Helm Chart for mongodb\n minibroker mysql Active Helm Chart for mysql\n minibroker postgresql Active Helm Chart for postgresql\n minibroker redis Active Helm Chart for redis\n\n### Option 2: Other Service Broker\n\nYou can use a different service broker that's installed as long as it supports\ncreating PostgreSQL services. For example, the [gcp-service-broker]().\n\nDeploy\n------\n\n### Clone source\n\n1. Clone the [Spring Music repo](https://github.com/cloudfoundry-samples/spring-music).\n\n ```\n git clone https://github.com/cloudfoundry-samples/spring-music.git spring-music\n cd spring-music\n ```\n2. Edit `manifest.yml`, and replace the contents with the following:\n\n ---\n applications:\n - name: spring-music\n memory: 1G\n random-route: true\n stack: org.cloudfoundry.stacks.cflinuxfs3\n env:\n BP_AUTO_RECONFIGURATION_ENABLED: false\n\n### Push App\n\n1. Deploy (this assumes you've already `kf target`ed a Space; see [these\n docs](../quickstart#prepare_space) for more detail):\n\n kf push spring-music\n\n2. Use the proxy feature to access the deployed App, then load\n `http://localhost:8080` in your browser:\n\n kf proxy spring-music\n\n \u003e The deployed App includes a UI element showing which (if any) Spring\n \u003e profile is being used. No profile is being used here, indicating an\n \u003e in-memory database is in use.\n\n### Create and bind database\n\n1. Create a PostgreSQL service via the broker installed in the marketplace:\n\n kf create-service postgresql 11-7-0 spring-music-db -c '{\"postgresqlDatabase\":\"smdb\", \"postgresDatabase\":\"smdb\"}'\n\n2. Bind the service instance to the Spring Music App:\n\n kf bind-service spring-music spring-music-db -c '{\"postgresqlDatabase\":\"smdb\", \"postgresDatabase\":\"smdb\"}'\n\n3. Restart the App to make the service binding available via the `VCAP_SERVICES`\n environment variable:\n\n kf restart spring-music\n\n4. (Optional) View the binding details:\n\n kf bindings\n\n5. `kf proxy` to the App again and view it in your web browser. The Spring\n profile should be shown, indicating the PostgreSQL service you created and\n bound is being used:\n\nDestroy\n-------\n\n1. Unbind and delete the PostgreSQL service:\n\n kf unbind-service spring-music spring-music-db\n kf delete-service spring-music-db\n\n2. Delete the App:\n\n kf delete spring-music"]]