Rancher agents trouble

I have some strange problem with rancher agent on some of my hosts. I have 2 rancher agents that are running :

  • rancher/agent:v1.0.2 (with name = rancher-agent)
  • rancher/agent:latest (with name = rancher-agent-init)

And they are both restarting randomly.

I have two kinds of host : Hyper-V (on premise) VM and Amazon EC2 VM. For the Hyper-V VMs I have manually added them in my rancher environment. For the EC2 VMs I have added them through a Chef recipe.

In this chef recipe I install docker engine, rancher agent, registrator and consul agent. I think I have a problem in this recipe because I end up with rancher-agent and rancher-agent-init only on EC2 created via chef.

So, I’d like to know what it’s the difference between rancher-agent and rancher-agent-init ?

Thank you

Ok, I have found my problem. I had setup a restart policy “always” on the rancher agent in my chef recipe. But I did not know that this container proceed a sort of two-phases starting. The rancher-agent-init seems to create the rancher-agent and then shut down itself.

But with the restart policy the rancher-agent-init always came back to life like a zombie and recreate the rancher-agent container.

So I remove the restart policy and everything is workong fine now.

1 Like