0

I am trying to setup a cron job on my cluster and I have a cloudsql proxy and my application container running in the pod, the cron job works fine, but when i execute kubectl get pods --watch, I see that in my cronjob pod, the ready column says 1/2, is this expected behaviour

I am not sure and trying to understand if this is the expected behavior or am i missing something and not configuring it correctly, any help would be really great.

Not sure if it helps but my cron job is just executing a rake task

this is the output of kubectl get pods --watch

NAME                                         READY   STATUS    RESTARTS   AGE
trial-expiration-reminder-1573032300-7tjjq   0/2     ContainerCreating   0          0s
trial-expiration-reminder-1573032300-7tjjq   2/2     Running             0          1s
trial-expiration-reminder-1573032300-7tjjq   1/2     Running             0          9s
trial-expiration-reminder-1573032600-khlsm   0/2     Pending             0          0s
trial-expiration-reminder-1573032600-khlsm   0/2     Pending             0          0s
trial-expiration-reminder-1573032600-khlsm   0/2     ContainerCreating   0          0s
trial-expiration-reminder-1573032600-khlsm   2/2     Running             0          2s
trial-expiration-reminder-1573032600-khlsm   1/2     Running             0          9s
opensource-developer
  • 2,826
  • 4
  • 38
  • 88

1 Answers1

1

If in your cronjob there is two container running inside one pod then it will first how 1/2 after some time 2/2.

If you look in some pod there is 2/2 mean both container running inside single pod and READY to take requests or Running.

Harsh Manvar
  • 27,020
  • 6
  • 48
  • 102
  • 1
    Hi Harsh, the 2/2 is a step before it reaches 1/2. 2/2 is when both containers have successfully started and ready to take requests as you said, but after after the rake task is executed it reaches 1/2. I wanted to understand what makes it reach 1/2. – opensource-developer Nov 06 '19 at 10:35
  • so one of your container or process end so one container shutdown in pod while another container still running inside pod so it come back to `1/2`. – Harsh Manvar Nov 06 '19 at 10:52