Manage Buckets on Cloud Foundry S3 Services
S3 is a great concept to store static files and larger BLOBs. Let’s look into how we can use it in Cloud Foundry.
S3 was originally created by Amazon Web Services, but by now there are many 3rd party services that are compatible with the S3 API. Some Cloud Foundry providers have S3 compatible services available in their marketplace. If they don’t, you can create your own by creating a user-provided service and adding the respective S3 credentials (e.g., from AWS).
Blue Green Deployment on Cloud Foundry
Imagine you have one of your apps in production and want to cf push
an update
to it. If you do so, your app will experience a short downtime because CF needs
to stop your old application and then power up the new one. During this short
period of time, your users will be receiving 404
s when trying to access your
application. Now, what if the new version of your app has an error in it and
doesn’t even start on Cloud Foundry? Your users will face an even longer
downtime until you have found and fixed the bug.
Run Piwik on Cloud Foundry
Piwik is an open-source analytics platform based on PHP and MySQL. That makes it a perfect application to be run on Cloud Foundry-based platforms. So, in case you are tired of sending all your data to Google Analytics but rather want to have your own analytics platform in place, this tutorial is for you. We will see what it takes to run Piwik on Cloud Foundry and what modifications are necessary to integrate it smoothly into our platform.
Configure Front End Apps With Environment Variables on Cloud Foundry
The 12 factor manifest tells us in point III that apps
should retrieve their config from environment variables to strictly separate
config from code. “Config” meaning everything that is likely to vary between
deployments (staging, production, developer environments, etc.). Cloud Foundry
allows us to do that easily using either the manifest.yml
file or the
cf set-env
command. However, this only works for apps which have a dynamic
back end. What if we want to configure a front end app that we have pushed to
Cloud Foundry using the
Staticfile Buildpack?
These apps are, by definition, static, so they cannot read out any environment
variables. Therefore, if we use this buildpack to deploy an
Angular or React
app, we cannot use these variables.
Cloud Foundry Route Services
In Cloud Foundry, we use services to provide additional functionality as reserved resources to our apps. They get bound to the app(s) directly and are accessible from these bound apps only. The image below shows how they get provisioned through the service broker and are then accessible to the client through the app. This is obviously a great setup for services like databases, messaging brokers, app data loggers or other handy additions for our apps to consume.
Observables With Angular and Feathers
Feathers is a modern API framework for Node.js. It exposes its backend services as a REST API or as a WebSocket API. To consume the exposed WebSockets from an Angular app, it makes sense to create Angular services to abstract the respective Feathers services in a way that makes it easy for our Angular components to consume them. This tutorial is assuming that you are using the Angular CLI for your app.
Run a CI/CD Server on Cloud Foundry
Pushing Apps to Cloud Foundry is as easy as it gets, thanks to the cf push
command. However, it is still tedious to push your code after every change you
make, just to see if it still runs in the cloud. That’s where a CI/CD server is
useful. It tests, builds and deploys your code every time you git push
to any
Git repo.
Strider is an open-source CI/CD server based on Node.js and MongoDB. It integrates well with Git and its hosted solutions (e.g., GitHub, Bitbucket or GitLab) and features a number of plugins to suit almost all your needs. The idea is, to have Strider “watch” your Git repos and, on change, go through the following stages: