How to deploy and use Redis in cloud foundry? - redis

I am sort of new to cloud foundry. I have some queries -
Can I use REDIS as a service in Cloud Foundry , if yes , how. Do we need service broker as well for that.
Manifest file for deploying Redis on Cloud foundry in openstack Neutron.
Can I do HA of Redis service in CF.
I have been through these links as well
https://github.com/pivotal-cf/cf-redis-release
https://github.com/cloudfoundry-community/redis-boshrelease
and deployed redis with a dedicated node and broker but not sure how it will work with an app.

Yes, you can use Redis as a service in CF, and yes, you'll need to make sure that there is a service broker -- in fact, having a service broker is the definition of something being a CF Service (if you can write a service broker for it, you can use it as a service). Here's an overview of the CF Service Broker API. Once you have your Redis cluster and service broker set up, you'll need to do the following:
Register your service broker with cf create-service-broker redis-broker <username> <password> <url to service broker>.
Create a service instance: cf create-service redis <redis-plan-name> myRedis
Bind your app to the service instance: cf bind-service myApp myRedis
Building a manifest file depends on which Redis release you use. The cloudfoundry-community/redis-boshrelease has a template for generating an openstack manifest. Unfortunately, that release doesn't have a service broker so you can't use that redis as a service in CF. The pivotal-cf/cf-redis-release, on the other hand, does have a service broker. Maybe you can use the Openstack-specific properties from the cloudfoundry-community/redis-boshrelease to make an Openstack manifest for pivotal-cf/cf-redis-release?
I don't know too much about HA Redis. You'll have to get some help from Redis experts, but I do know that there's a piece of software called Sentinel that's meant to get Redis to HA. You should take a look at that and see if you can extend the release to include Sentinel.
Hope that helps!

Related

Cloud Foundry on Google Cloud Platform

My application has Jackrabbit Oak implementation, so it uses direct binary upload features through S3DataStore for storing files on AWS-S3. For AWS-S3 integration, we had created service broker instance on Cloud Foundry which was on our on-premises server.
Now I moved Cloud Foundry on Google Cloud Platform, but when I am trying to search AWS-S3 service broker using cf marketplace command. I could not see the aws-s3 service broker.
How to get aws-s3 service broker and if it is not possible then, is there any way to integrate aws-s3 storage with application deployed on CloudFoundry on GCP in case of above scenarios.
It's hard to know what you had deployed on your platform as we don't have any context of what was installed there. Just a guess, but it sounds like you had the Tanzu AWS Service Broker installed. It has service offerings for aws-s3.
https://docs.pivotal.io/aws-services/creating.html#view
You can still install the Tanzu AWS Service Broker when running Tanzu Application Service on top of GCP, you just need to have a AWS account where the broker will create your service instances. The broker creates AWS resources on behalf of the users and it does it under a given AWS account, so as long as you still have an AWS account you can make it work.
That said, there's also a GCP broker that functions in the same, so if you are trying to move off AWS to GCP entirely you could look at using the GCP broker instead. GCP has a similar cloud storage offering.
https://docs.pivotal.io/partners/gcp-sb/index.html
Once you install either broker, you'll see the service plan offerings in your marketplace. If you're still not seeing them, check cf service-access as an admin user. You may need to enable access to those services with cf enable-service-access.
Go back to the team that moved you between CF/AWS and CF/GCP and tell them you need your S3 broker back :)

What is the redis URI, when redis is used in kubernetes?

Objective
I want to access the redis database in kubernetes, from a function inside ibm functions using javascript.
Question
How do I get the right URI, when redis is running on a Pod in Kubernetes?
Situation
I used this sample to setup the redis database in kubernetes This is the link to the sample in Kubernetes
I run Kuberentes inside IBM Cloud.
Findings
I was not able to find a answer to my question on the redis documentation
As far as I understand by default no password configured.
Is this assumption right?
redis://[USER]:[PASSWORD]#[CLUSTER-PUBLIC-IP]:[PORT]
Thanks for help ... I know this is maybe a to simple question, but currently I do not see the tree in the woods ;-)
As far as I understand by default no password configured.
Yes, there is no default password in that image with Redis, you are right.
If you following the instruction you mentioned, you will use a kubectl proxy, which will forward port of your Redis in cluster to your local machine by call kubectl port-forward redis-master 6379:6379.
So in that case, Redis will be available on redis://localhost:6379 on your PC.
If you want to make it available directly from ouside of the cluster, you need to create Service with NodePort, Service with LoadBalancer (if you in Cloud) or simply Service with Ingress.
Inside a cluster, you can create Service with Cluster IP (which is actually simply Service, because it always has Cluster IP) for your Redis pod and will be available on:
redis://[USER]:[PASSWORD]#[SERVICE-IP]:[PORT]
Here is a good official documentation about connecting applications with service.

Deploying the Redis Broker then Redis as a service onto Cloud Foundry

So I am currently trying to deploy the Redis CF service onto Cloud Foundry which is on an Openstack IAAS and getting stuck with deploying the Redis Service Broker. Cloud Foundry is all set up (deployed using BOSH), but how to I deploy the broker? Is it pushed like an application? Do I need to change any files/manifests manually?
The documentation seemed a little light on how I would do this.
Googling "Cloud Foundry Redis service broker", the first result I find is https://github.com/pivotal-cf/cf-redis-release. This appears to document the deployment and configuration steps pretty well in its README. You will deploy the Redis service as a BOSH deployment, and this service includes the broker. You can drive that broker to register it with the Cloud Foundry service broker API as documented in that same README.
There are a couple ways to handle this.
Run open source Cloud Foundry on top of Openstack and then deploy open source Redis (or Redis Cloud, Redis Enterprise, etc.) and connect to it using User-Provided Service Instances
The easiest way is with a Service Broker (aka Pivotal Tile) as Amit describes in the previous answer. Run Pivotal Cloud Foundry on top of Openstack and then deploy a Redis Service Broker, such as Redis Enterprise Service Broker for Pivotal Cloud Foundry and connect to it as documented.
There are other Redis service providers in the The Foundry: such as a9s, IBM, Redis Labs, Pivotal and Swisscom

Creating AMQ network of broker clusters on JBoss Fuse 6.2, without fabric

I want to create (2) broker clusters connected by network of brokers in JBoss Fuse 6.2; each cluster has 2 master/slave pairs.
It's a small cluster, so we don't intend to use Fabric/Zookeeper; everything will be statically configured, no auto discovery.
Questions
Is it possible to use fabric profiles to build the topology, but
avoid using fabric at runtime?
Can we use Git, or something similar, for centrally managing container config files, again, without fabric?
We tried creating profiles using fabric:mq-create, but the command is not available unless a fabric is first created, which defeats the purpose.
No fabric profiles requires using fabric. You can use git to store files, but you cannot have JBoss Fuse automatic use it such as it does with fabric. You would need to use git manually.
The AMQ broker in JBoss Fuse is just standard Apache ActiveMQ so you can configure it manually/static as a network of brokers. It just not very easy to do if you haven't done that before.
See the JBoss A-MQ documentation as that covers the broker: http://www.jboss.org/products/amq/overview/
for example at: https://access.redhat.com/documentation/en-US/Red_Hat_JBoss_A-MQ/6.2/html/Using_Networks_of_Brokers/index.html

Legacy application to communicate with cloud foundry using RabbitMQ

I am new to cloud foundry and investigating possible ways for our legacy Java EE application to communicate asynchronously with an application running on cloud foundry.
We are doing a lot of asynchronous work already and are publishing events to Active MQ.
I know that cloud foundry has a possibility to bind with Rabbit MQ and my question is with the possibility for a cloud foundry running application to connect (listen) to an existing out of CF platform Rabbit MQ?
Any idea on other alternatives to achieve this?
Yes, that is possible. You can use a user provided service.
That allows you to inject the environment variables into your app, that are needed to connect to RabbitMQ (like host, port, vhost, username, password).
Once you create that service, you can bind it to your app. Inside your app code, you then can read the environment variables exactly the same way as you would do it, if you had used a RabbitMQ service provided by CloudFoundry.