Book Image

Cloud Foundry for Developers

By : Rahul Kumar Jain, Rick Farmer, David Wu
Book Image

Cloud Foundry for Developers

By: Rahul Kumar Jain, Rick Farmer, David Wu

Overview of this book

Cloud Foundry is the open source platform to deploy, run, and scale applications. Cloud Foundry is growing rapidly and a leading product that provides PaaS (Platform as a Service) capabilities to enterprise, government, and organizations around the globe. Giants like Dell Technologies, GE, IBM, HP and the US government are using Cloud Foundry innovate faster in a rapidly changing world. Cloud Foundry is a developer’s dream. Enabling them to create modern applications that can leverage the latest thinking, techniques and capabilities of the cloud, including: ? DevOps ? Application Virtualization ? Infrastructure agnosticism ? Orchestrated containers ? Automation ? Zero downtime upgrades ? A/B deployment ? Quickly scaling applications out or in This book takes readers on a journey where they will first learn the Cloud Foundry basics, including how to deploy and scale a simple application in seconds. Readers will build their knowledge of how to create highly scalable and resilient cloud-native applications and microservices running on Cloud Foundry. Readers will learn how to integrate their application with services provided by Cloud Foundry and with those external to Cloud Foundry. Readers will learn how to structure their Cloud Foundry environment with orgs and spaces. After that, we’ll discuss aspects of continuous integration/continuous delivery (CI/CD), monitoring and logging. Readers will also learn how to enable health checks, troubleshoot and debug applications. By the end of this book, readers will have hands-on experience in performing various deployment and scaling tasks. Additionally, they will have an understanding of what it takes to migrate and develop applications for Cloud Foundry.
Table of Contents (20 chapters)
Title Page
Credits
About the Authors
Acknowledgements
About the Reviewer
www.PacktPub.com
Customer Feedback
Dedication
Preface

Deploying an application to Cloud Foundry


We now have our PWS account set up and working, and we also have our cf CLI installed and working. Now we just want to push a simple application to see it run on Cloud Foundry. To do that, we must do a few things:

  1. Set the target Cloud Foundry instance so that our cf CLI knows where we are pushing our application bits. 
  2. Log in to the targeted Cloud Foundry instance using the cf CLI.
  3. Push our simple app.

Targeting Pivotal cf API endpoint

What could make more sense than to target the Cloud Foundry instance you want to deploy your application into? To do that, you must set the Cloud Foundry API endpoint to which your cf CLI will issue commands. Behind the scenes, your cf CLI will have a back-and-forth conversation with the Cloud Foundry instance using RESTful calls. And, as with all RESTful calls, you must have an API endpoint to communicate with.

To set the API endpoint to PWS, type the following command in your Terminal:

$ cf api https://api.run.pivotal.io...