haproxy pods keep crashloopbackoff

9/26/2019

I'm setting up a redis-ha in my kubernetes cluster. And I used helm to install it. But my haproxy pods keep crashloopbackoff

I'm using helm to install a redis-ha in my kubernetes cluster with command: helm install -f develop-redis-values.yaml stable/redis-ha --namespace=develop -n=develop-redis In develop-redis-values.yaml, I set haproxy.enabled to true

This is the logs in my crashloopbackoff pod

> [ALERT] 268/104750 (1) : parsing [/usr/local/etc/haproxy/haproxy.cfg:34] : 'tcp-check expect string' expects <string> as an argument.
> [ALERT] 268/104750 (1) : Error(s) found in configuration file : /usr/local/etc/haproxy/haproxy.cfg
> [ALERT] 268/104750 (1) : Fatal errors found in configuration.

I'm expected the haproxy pods is running

-- Blake Ash
haproxy
kubernetes-helm
redis

1 Answer

5/5/2020

CrashLoopBackError can be related to these possible reasons:

  • the application inside your pod is not starting due to an error;
  • the image your pod is based on is not present in the registry, or the node where your pod has been scheduled cannot pull from the registry;
  • some parameters of the pod has not been configured correctly.

In your case, it seems that there are some errors in you haproxy configuration files. Have you tried to pull the image you're using locally, and start a container to verify it? You can enter in the container and check the configuration with:

haproxy -c -V -f /usr/local/etc/haproxy/haproxy.cfg

For more information and debugging ways: https://pillsfromtheweb.blogspot.com/2020/05/troubleshooting-kubernetes.html

-- SegFault
Source: StackOverflow