cronjob kubernetes expected behaviour with a application and a cloud proxy container

11/6/2019

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
kubernetes
kubernetes-cronjob

1 Answer

11/6/2019

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
Source: StackOverflow