Can we have Ui for cloudfoundry deployed on AWS - cloud-foundry

Iam new to Cloudfoundry on AWS. I have deployed cloudfoundry on AWS, but when i want to push an application into cf which i have deployed i was using command line tool (cf). Is there any way we have UI like Cloudfoundry where we can check our app running on UI , and even on Bluemix we can have ace.ng.bluemix.net to login and check our apps.
I want to know if i can check my appp deployed in my custom cloudfoundry deployed on AWS in UI where i can see other applications as well running.
It would be very helpful if i get this.
Thanks & regards,
Srilatha K.

There is the admin-ui, which is a bit more detailed than the Pivotal WS/CF interface but will provide you a BUI as an alternative to cf cli:
https://github.com/cloudfoundry-incubator/admin-ui

You can make use of BOSH.
It takes care of deployment & life cycles managements...
Reference - http://www.slideshare.net/ManuelGarcia122/cloud-foundry-handson-deployment-workshop
Slide 29 onwards
Useful link - http://blog.altoros.com/tag/cloud-foundry

Related

Why does pivotal cloud foundry does not remove a route when a corresponding app is deleted?

I have been exploring Pivotal Cloud Foundry - Public Cloud Version by setting up an Pivotal Web Services account.
While exploring the CF CLI I followed the below tutorial.
https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry/introduction
I was able to successfully push the sample spring boot app to PCF Cloud and follow the tutorial.
When I started to play around with it, I tried deleting the app using the below command. cf-spring is my app name.
cf delete cf-spring
When navigated to my Pivotal Web Service account, I could see the app has been deleted. The route still displays the name of the route which was created when an app was created using the cf push command.
So I tried to delete the route using the below command.
It does not allow me to delete using CLI ? Does the app delete command should have taken care to remove the related routes associated with the application ?
Try cf delete-route -h to see the syntax of the delete-route command.
You probably want to run cf delete-route cfapps.io --hostname cf-spring-rested-platypus.
In recent versions of cf-cli you can also run cf delete-orphaned-routes.
I think the reason CF doesn't completely delete the route when you delete an app is so that it kind of keeps the hostname reserved for your use, ie: someone else can't reuse it in another org or space if you've just taken down your app for a refresh. It's kind of annoying when you actually want to reuse the hostname in another space, but considering the multi-tenancy capabilities it kind of makes sense to keep them intact/reserved.
cf delete APP_NAME will not delete the route bound to the Apps and this should not happen first-of-all. Because the router-concept in Cloud foundry is that
One App can have Multiple Routes and Multiple Routes can be configured to one App.
Its Many-to-One mapping. So there is a possibility that the routes you created would still be mapped to another App and it would be as Orphaned-route, only when there are no apps for that routes..
So its a cautious decision and a wise decision too !!

I am binding a service to an app in Cloud Foundry. What's the URL to call service APIs?

Followed the Pivotal CloudFoundry tutorial (https://pivotal.io/platform/pcf-tutorials/getting-started-with-pivotal-cloud-foundry) and pushed an app, cf-spring-unspent-autoradiography.run. Then bound a service to the app and pushed it, using CF Push. Now, I'd like to communicate with the bound service (API) via a third party app. Doable? If so, what's the destination URL / header?
You would need to parse VCAP_SERVICES environment variable for service- specific credentials/urls
https://docs.run.pivotal.io/devguide/deploy-apps/environment-variable.html
Yes. You can see the service dashboard which you bound with an app. Click on your service instance in services tab. You can find Manage link - once you clicked it will redirect to your service dashboard.
Following links are Docs and Support in service instance page. Docs link will give detailed information about service and support link will help you to solve any issues.

Dockerized wso2 APIM

I was exploring the possibility of using Wso2 API Manager in a dockerized cluster and was pointed to this link.
https://github.com/gayangunarathne/Docker-compose/tree/master/wso2-products/WSO2APIM/1.10.
In the docker-compose file I see references to svnrepo service. Could you please point me to instructions on how to configure this? Is this really required for Deployment Synchronizer Configuration?
Also any idea how I can access dockerhub.private.wso2.com ? Also any other examples of the distributed patterns of components of API Manager (like gateway,keymanager,store,publisher) in docker containers that are running in the production environment?
WSO2 will soon have their docker images available publicly.
SVN is only required for dep-sync. For now you can use any svn docker container for that.
We are currently implementing distributed deployment patterns with docker-compose. These will be released once ready..
Hope this helps.
Supun

Create and Push an App programmatically from another App in Cloud Foundry

Is it possible to create and push an application into Cloud Foundry from a different application that is already running in Cloud Foundry? Essentially I need to do a 'cf push' from within the application.
I saw there's a Cloud Foundry API that I can use (https://apidocs.cloudfoundry.org/237/apps/creating_an_app.html). Can anyone give me an example?
The Cloud Foundry Java Client is designed for use cases like this. It takes care of negotiating the OAuth2 security used by the CF API and provides nice abstractions for common operations that require multiple CF API calls (e.g. pushing an app, which involves creating app metadata, pushing the bits, and starting the app). I would prefer this option over using Java to shell out to the cf CLI, as you get greater control over the CF API and aren't subject the CLI UI to detect success/failure.
There's nothing stopping an app from running on CF from pushing other apps, but the platform doesn't do a lot to help with this either. Specifically, you'll need the address of the CF API endpoint (e.g. http://api.mycf.example.com) to be able to target, authenticate, and deploy apps. But there is no way for an app running on CF to know the API endpoint of the CF it is running on. So you will need to configure the CF API endpoint into the application that will be pushing other apps.
TL;DR Yes it is possible. Shell out to the CF cli.
The easiest way to do this would be to just include the CF cli in your application and shell out to it to push your app. You'll have to make sure that the binary you use matches the OS where your app is running (most likely Ubuntu 14.04). But that way, you can just provide it with your user's CF credentials and use the cf push logic in the CLI.
There is a CloudFoundry API you can use, but I'd advise against it. Trying to authenticate and push a cf app will be tricky. cf push does a lot under the hood -- it not only creates the app via the API endpoint you found, but it also uploads application files in an intelligent way, it attaches routes and services to the app, starts the app, polls the CF API for the updates on the status of the staging task, etc. You'd have to implement all of this on your own (not to mention the OAuth2 workflow to get an auth token).
There are some third-party CF libraries you might find useful (depending on the language you are using):
https://github.com/cloudfoundry/cf-java-client
https://www.npmjs.com/package/cf-nodejs-client
Lastly the CloudFoundry cli is open-sourced (https://github.com/cloudfoundry/cli). Bear in mind that as discussed above the push logic consists of multiple operations, and as such the codebase might be difficult to grok.

Grails App with Multi Tenant Single DB plugin URL implementation in Cloudfoundry

I am currently creating a web app using Grails implementing Multi Tenant Single DB plugin. The plugin allows me to have multiple tenants on a single db using a tenantID to differentiate between tenants. The plugin detects witch tenant will deal the current request that is made on my app by resolving using different domains/subdomains for each tenant.
For example:
Tenant 1 = companyA.myapp.com
Tenant 2 = companyB.myapp.com
On my local machine running Grails development mode I was able to implement the different hosts by changing my /etc/hosts and each tenant would have their own subdomain.
I am currently interested in using cloud foundry as my cloud platform but when I deploy my app to cloud foundry it is already using my app name as the subdomain for cloud foundry.
For example:
- myapp.cloudfoundry.com
Is it possible to change or control the domain name resolver in
cloud foundry?
Does anybody know how to handle multi-tenant subdomains as explained above in cloud foundry? Probably provide the steps in implementing this using cloud foundry?
What is the best approach to implement this using cloud foundry?
My App is using Grails 2.0.4 and Multi Tenant Single DB plugin 0.8.2.
Thanks
Unfortunately the current beta version CloudFoundry does not allow modification of the cloudfoundry subdomain. The plan is to have the GA towards the end of this year with a private preview of the version of the site available sooner in the fall. At that time you could be able to customize the subdomain.
Therefore you might need to change a little in your TenantResolver to only check the subdomain that varies.
To implement your requirement, did you try installing the grails cf plugin? If not you can start from here.
If you are using cli, installing the plugin just needs command in your project workspace:
grails install-plugin cloud-foundry
When your app is ready for deployment, push it to cloudfoundry:
grails cf-push
Note that you will have to have your cf credentials configured in the grails config file.
After that you can map multiple URLs you want using:
grails cf-map user1.yourapp.cloudfoundry.com
If you have already known about vmc which is the client command line interface for cf, you can see the urls mapped with your app by
vmc apps
If not you can refer to the installation guide to start if you would like to do that.
If you are using STS/eclipse, things will be even easier. First you need to have grails-support extension as well as the cloud foundry integration installed. For detailed docs of the cf integration please refer here.
After your app is deployed, right click the project and choose "Grails Tools" -> "Open Grails Command Prompt". This will enable you to have same grails cf plugin commands as the CLI does.
Hope this can help your move forward in the cloudfoundry world. Let me know if you have more questions.
Thanks,
William