I have implemented Liveness Probe in C# based Kubernetes Application. When I am removing InitialDelaySeconds in my livenessconfig (at code level using Kubernetes Client's V1Probe):

IList<string> command = new List<string>();
V1Probe livenessconfig = null;
command.Add("- f");
V1ExecAction execommand = new V1ExecAction(command);
livenessconfig = new V1Probe { Exec = execommand, PeriodSeconds = 10};

then I am seeing Liveness Probe failing in Pod description(no reason is mentioned though):

  Normal   Created    26s               kubelet            Created container App-prox
  Normal   Started    26s               kubelet            Started container App-prox
  Warning  Unhealthy  6s (x2 over 16s)  kubelet            Liveness probe failed:
  Normal   Killing    6s                kubelet            Stopping container App-prox

I don't want to give any initialdelay to my probe and want my probe to start executing command as soon as container is up.

  1. How should I manage this?
  2. isn't this the job of probe to execute the command only when container is up ? then why should I delay more with "initialDelaySeconds" ?
  3. is "initialDelaySeconds" mandatory argument or optional ? if its mandatory then no need for discussion , I have to add it in probe then.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.