Friday, 29 March 2019

Deploying an Application to Pivotal Cloud Foundry through Spinnaker and then invoking a resize operation

In this post we show a basic deployment to Cloud foundry in fact Pivotal Cloud foundry 2.4 using spinnaker 1.13.0.


1. Configured a Cloud Foundry provider as shown below

spinnaker@myspinnaker-spinnaker-halyard-0:/workdir$ hal config provider cloudfoundry account add pez208 --user admin --password mypassword --api --environment dev --appsManagerURI
+ Get current deployment
+ Add the pez208 account
Problems in default.provider.cloudfoundry:
- WARNING To be able to link server groups to CF Metrics a URI is
  required: pez208

+ Successfully added account pez208 for provider cloudfoundry.

2. Enable cloud foundry provider

spinnaker@myspinnaker-spinnaker-halyard-0:/workdir$ hal config provider cloudfoundry enable
+ Get current deployment
+ Edit the cloudfoundry provider

+ Successfully enabled cloudfoundry

3. Run "hal deploy apply"

spinnaker@myspinnaker-spinnaker-halyard-0:/workdir$ hal deploy apply
+ Get current deployment
+ Prep deployment
+ Preparation complete... deploying Spinnaker
+ Get current deployment
+ Apply deployment
+ Deploy spin-clouddriver
+ Deploy spin-front50
+ Deploy spin-orca
+ Deploy spin-deck
+ Deploy spin-echo
+ Deploy spin-gate
+ Deploy spin-igor
+ Deploy spin-rosco
+ Run `hal deploy connect` to connect to Spinnaker.

IN this demo I can simply going to deploy my artifact sitting within my GitHub repo using a HTTP endpoiunt so for that will need to enable HTTP artifact support in Spinnaker as shown below

$ hal config features edit --artifacts true
$ hal config artifact http enable
$ hal config artifact http account add apples-http
$ hal deploy apply


1. Lets create a new application called "pastest" as shown below. Be sure to select "CloudFoundry" provider.

2. Click "Create"

3. Click on "Create Server group"

4. Fill in the fields as shown below. In this example I am using the following

  • Account "pez208" which was the cloud foundry provider name we used above
  • Region is basically the CF space we will deploy into
  • HTTP artifact which I enabled called "apples-http".
  • Fully qualified path to my JAR file I wish to deploy
  • Form based manifest settings to define my application deployment settings

5. Click "Create"

6. Verify your application is going through the deploy phase as shown in the dialog

7. Oncer complete we can see our deployed application in Pivotal Cloud Foundry Applications Manager as shown below.

8. Now if we return to the Spinnaker UI we will see various views of what we just deployed as follows

Server Group Main Page

Load Balancer Page

Instance Page

9. Now let's actually scale our application to 2 instances rather than just a single instance. To do that lets click the "Resize Option" in the "Server Group Page" as shown below

10. In the dialog which appears set "Resize to" to "2"

11. Click "Submit"

12. Return to Pivotal Cloud Foundry Applications Manager and verify we now have 2 instances of our application as shown below

13. This will also be reflected on Spinnaker UI as well

More Information

Cloud Foundry - Cloud Provider

No comments: