Memcache on kubernetes

5/4/2018

I have a spring boot api running on google cloud kubernetes cluster, I wanna have a caching server to use for my api so I thought to use memcache.

I tried two ways of doing it:

  1. I downloaded the memcache from the google launcher which is basically deploying an instance of memcache on a vm. And then I assigned an external IP to my vm, whitelisted my ip to try it locally and ofc opened the port 11211 (the default one). For the client side I used, this guy, specified the ip address but I still get connection cancelled : java.util.concurrent.CancellationException: Cancelled and the doc is bad so I could find anything that helps.
  2. I decided to try another way, which is following this tutorial and now I have the memcached cluster but I don't know how to consume these pods from my other cluster or should the pods be on the same cluster i have the api running on?

I would appreciate any help, this is my first encounter with the global caching.

-- user2137817
kubernetes
memcached
spring-boot

1 Answer

5/10/2018

So I figured it out based on Jonah Benton's advice.

It was actually pretty simple, i used this tutorial to create a new pod running memcached in my cluster and then I used this client to connect on it and it worked like a charm!

Hope it helps someone.

-- user2137817
Source: StackOverflow