This blog is related to the topics Cloud Foundry Enterprise Environment , serverless , code patterns and the IBM Coder Program.
I just want to move an existing Cloud Foundry app on IBM Cloud to the new IBM Cloud Foundry Enterprise Environment,which instantiates Cloud Foundry on top of Kubernetes. You can find more details about this IBM Cloud offering in this blog post “An on-demand, single-tenant Platform-as-a-Service on IBM Cloud” from IBM.
Motivation
Maybe you noticed the section Combined Power in my blog post Operations and Developers side by side @“Continuous Lifecycle” and “Container Conf” related to Simon Moser’s session “CF3 – Combining the Power of Cloud Foundry and Kubernetes” ? In this blog post you can read more about the motivation to combine the power. Also you can find out which open source projects ( eirini for example) are relevant.
Based on Simon Moser´s speech, I was motivated to check out the Cloud Foundry Enterprise Environment on IBM Cloud.
I started my test of moving an existing Could Foundry App. I have chosen to move the app instance from one of my modified code patterns . My selection was the Predictive Industrial Visual Analysis. This code pattern has a big focus on serverless, but I will write more about the serverless part in the near future.
Let’s get started: How do I move an existing Cloud Foundry app?
By the way, I noticed this code pattern, during a challenge in the IBM Coder program related to Call for Code in September 2018.
Here you can see the challenge on IBM Coder.
Moving the App to Cloud Foundry Enterprise Environment
The following will describe the steps to move the app.
The Cloud Foundry app
The app I wanted to move to the Cloud Foundry Enterprise Environment is the sample frontend web application for the “Predictive Industrial Visual Analysis” code pattern. Currently my app instance runs as Node.js as a Cloud Foundry App in IBM Cloud.
The basic functionality of the app is: you can upload and analyse images.
Creating a Cloud Foundry Enterprise Environment
To create the environment I followed the steps in the getting started tutorial for the Cloud Foundry Enterprise Environment, by using the smallest instance size and the datacenter location for Germany. This worked very well.
Here you can see the instance of the Cloud Foundry Enterprise Environment.
Then I finished the necessary administrative tasks :
- creating organizations
- creating spaces
- applying the user rights
Here you can see the organizations and spaces.
Binding the existing IBM Cloud services to the app
The one remaining question was: How do I bind existing instances of cloud services to an app?
As you notice in the sample architecture picture, the app has two bindings to two existing IBM Cloud services: IBM Cloudant and IBM Watson Visual Recognition. For the existing instances of cloud services, Cloud Foundry Enterprise Environment automatically provides alias instances to bind the services to apps . How you can manage all of these instances, you can examine here in the documentation.
Here you can see my moved app with the bindings to the two service instances.
Note: Yes, you can see two instances of the app. I also created one in another way, using continuous delivery pipeline service, but this is not the topic of this blog post.
Deploy the Cloud Foundry application
For the deployment I created a bash script. The script automates the logon to IBM Cloud and to the Cloud Foundry Enterprise Environment, the binding to the services, and the deployment of the application. I created a new manifest.yml containing the necessary information:
- The Cloud Foundry Enterprise Environment domain: de-cloudfoundry-check-cl.eu-de.containers.appdomain.cloud
- The application and host name I want to use inside the Cloud Foundry Enterprise Environment
Here are the parts of my automation inside the script:
1) Logon to IBM Cloud
ibmcloud login -u $USER_ID -o $ORGANIZATION_NAME -apikey $IBMCLOUD_CLI_DEVOPS_PLATFORM_KEY -s $SPACE_NAME -g $RESOURCE_GROUP -a $API_ENDPOINT
2) Set the Endpoint for the target Cloud Foundry Enterprise Environment
cf api $CFEE_API_ENDPOINT
3) Logon to IBM Cloud Foundry Enterprise Environment
cf login $USER_ID -o $CFEE_ORGANIZATION -s $CFEE_SPACE -sso
4) Push the application with the new manifest.yml file
cf push -f $CFEE_MANIFEST_PATH
5) Bind the existing IBM Cloud Services
cf bind-service "{$CFEE_APP_NAME}" pattern-PIVA-US-Cloudant -c '{"permissions":"read-only"}'
After I executed the script, I had my app instance running on Cloud Foundry Enterprise.
Here you can see how I access the app using Stratos (open source UI) inside the Cloud Foundry Enterprise Environment.
Now I can take advantage of the Cloud Foundry Platform Environment.
Cloud Foundry runs on top of Kubernetes.
Summary
The result of the first test, moving an existing application, is very well documented in the Cloud Foundry Enterprise Environment documentation.
- how to setup
- how to deploy
- how to reuse existing IBM Cloud services Environment. So, it was no big deal to move my existing app into the Cloud Foundry Enterprise Environment.
With this in mind I will surely dig more into the new possibilities of the Cloud Foundry Enterprise Environment on top of Kubernetes.
I hope this was useful for you and let’s see what’s next?
Greetings,
Thomas
PS: By the way, you can use the IBM Cloud for free, if you simply create an IBM Lite account. Here you only need an e-mail address.
#erini #cfee #kubernetes #cloudfoundry #cf #ibmdeveloper #ibmcoder #codepatterns #cloudfoundryenterpriseenvironment