Deploying A Ruby Application to Kubernetes Using Cloud Foundry

Ram Iyengar
Cloud Foundry Foundation
2 min readJan 14, 2021

Ruby app developers face a few problems when it comes to deploying their apps in production, especially with Kubernetes running on their infrastructure. With Cloud Foundry, they can resolve some of these deployment issues easily.

Here’s a short video that helps you understand how to deploy a Ruby application to Kubernetes using Cloud Foundry. The cf push developer experience is possible thanks to cf-for-k8s, an open source project led by the Cloud Foundry community.

Summary of steps:

  1. Clone the repo from here:
    git clone https://github.com/tcdowney/sinatra-k8s-sample

2. Switch into the directory that you cloned
cd sinatra-k8s-sample

3. Next, modify the builder version to a more updated one. Open the Gemfile.lock in a text editor and under the “BUNDLED WITH” header, delete the 1.17.2 and replace it with 2.1.4

4. Deploy the app using the cf push command and remember to specify an app name. In this case, ruby-cf-demo is the name of the app that is being used. Wait until the deployment completes successfully.
cf push ruby-cf-demo

5. Copy the route that is generated and open it in a browser. You will be able to access the app.

If you’d like to know more about the #cf-for-k8s project or Cloud Foundry in general, please join us on Slack. You can also reach out to us via our Twitter handle @cloudfoundry!

--

--

Ram Iyengar
Cloud Foundry Foundation

culture vulture. (d)evangelist. help tech find people, and vice versa.