Search code examples
spring-bootcloud-foundrycloudfoundry-uaablue-green-deployment

Unable to deploy service to PCF with no-route


I have this strange issue while pushing one of my application to PCF. I wants to implement blue-green deployment for my service and I want to deploy app-v2 version with no-route and then add temp route after deployment done. because I need to bind one marketplace service UAA Single Sign-on(Provides identity capabilities via UAA as a Service) service at application startup time. This UAA service is causing issue while pushing.

cf command using for deployment

cf push -f manifest-dev.yml --no-route

Error screenshot:

enter image description here

PCF version 2.x


Solution

  • I have a couple ideas that might help to get around this.

    1. Don't use --no-route. You said I want to deploy app-v2 version with no-route and then add temp route after deployment done, so just skip the --no-route part and put the temp route directly into your manifest-dev.yml file. If you already have a route in that file, you could make a copy and call it manifest-dev-v2.yml and put the route there.

    2. Split this up. Remove your service from the manifest-dev.yml file. Run cf push -f manifest-dev.yml --no-route --no-start. Then map the temp route. Then bind the service. Then run cf start. You could alternatively drop the manifest all together, and just script your cf cli actions in a shell script or something like that.

    3. You could look at using one of the blue/green plugins for the cf cli. There's a few and I can't recommend one over another. You can see them all here (search for blue/green).

      http://plugins.cloudfoundry.org/

    For a little background on the error that's being reported, the authorization code grant (Oauth2) cannot work without a redirect URL. For this flow, a user get's redirected to the login page and then get's redirected back to your redirect URL once login has occurred. Without that redirect URL, users can't complete the flow. It appears to be failing since you don't have any routes and thus cannot have a redirect URL.

    Hope that helps!