memcached / memcached-proxylibs

compatibility and contributed lua libraries for memcached proxy
BSD 3-Clause "New" or "Revised" License
10 stars 3 forks source link

Trouble starting Memcached Builtin Proxy in Kubernetes #3

Closed cbwsports closed 1 year ago

cbwsports commented 1 year ago

I need to deploy memcached w/ proxy in a Kubernetes cluster. When I start the pods and run memcached I receive an error as the proxy attempts to create backends. Because of the error the memcached container enters a crash loop and never starts. After some testing I determined that when memcached attempts to create backends the other containers are not in a “ready” state and therefore have not been added to the loadbalancing pools of the Kubernetes service. Since the backends are not available when the command is run it throws an error and terminates the pod.

Are there any config options that will allow us to start memcached and wait for backends to become available instead of throwing an error immediately?

We are currently using the simple.lua and the following config file:



local s = require("simple")
verbose(true)
my_zone("z1")

router{
    router_type = "flat",
    log = true,
}

pool{
    name = "default",
    zones = {
      z1 = {
        "127.0.0.1:11211",
      },
      z2 = {
        “memcached-0.memcached-svc:11211",
      },
      z3 = {
        “memcached-1.memcached-svc:11211",
      },
      z4 = {
        “memcached-2.memcached-svc:11211",
      },
    }
}
dormando commented 1 year ago

Hey,

Can you try building from the next branch? That bug was fixed a while ago but I've been behind on getting a new release out.

dormando commented 1 year ago

Sorry to be clear I mean the next branch of the memcached main repo, for building the proxy itself