Restart specific Container in a Multi Conatainer POD ?

1,112 views
Skip to first unread message

Vinoth Narasimhan

unread,
Oct 6, 2016, 10:00:47 AM10/6/16
to Kubernetes user discussion and Q&A
Is there a way in kubernetes to restart a specfic container inside a multicontainer pod

The below pod is running with 3 container (influxdb,grafana,kapacitor)

monitoring-influxdb-grafana-v3-n17li                               3/3       Running

I have a configmap setup . If we update the configmap with new ENV means we need to restart the container to take effect.

So , is there a way to restart the specific container kapacitor alone as like we see the logs like below using -c options

kubectl logs -c kapacitor monitoring-influxdb-grafana-v3-n17li  --namespace=kube-system

David Aronchick

unread,
Oct 6, 2016, 10:41:24 AM10/6/16
to 'David Aronchick' via Kubernetes user discussion and Q&A
May I ask why? 

--
You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-users+unsubscribe@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Vinoth Narasimhan

unread,
Oct 6, 2016, 1:06:37 PM10/6/16
to Kubernetes user discussion and Q&A
In the kapacitor docker image we used ENV to update the kapacitor configure in entrypoint. We read those ENV from configmap

Let say I added the ENV as EMAIL-TO as x...@abc.com and this will update in the kapacitor config while start the pod and send alerts to this address. Later if we want to add some more address in it means, we update the configmap.

Without restarting the kapacitor container the changes won't affect on it.

For this change to take effect I need to restart all the 3 container in the influx-grafana pod.

Tim Hockin

unread,
Oct 6, 2016, 2:36:00 PM10/6/16
to kubernet...@googlegroups.com
We support live-update of configmap as file projections. Obviously we
can not support that for env, but we could allow the user to ask for a
notification or something. Not sure what that API would look like..
> --
> You received this message because you are subscribed to the Google Groups "Kubernetes user discussion and Q&A" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kubernetes-use...@googlegroups.com.
> To post to this group, send email to kubernet...@googlegroups.com.

Matthias Rampke

unread,
Oct 6, 2016, 4:24:43 PM10/6/16
to kubernet...@googlegroups.com
On Thu, Oct 6, 2016 at 5:06 PM Vinoth Narasimhan <talk2...@gmail.com> wrote:
Later if we want to add some more address in it means, we update the configmap.

How often does that happen? Keep in mind that Kubernetes makes changing a deployment easy, and just having all the pods replaced is the baseline design.

/MR 

Vinoth Narasimhan

unread,
Oct 7, 2016, 8:14:42 AM10/7/16
to Kubernetes user discussion and Q&A
Tim,

Is this somewhat mounting the configmap as volume ?

Can u point some link so that i can look to see if it match our requirements,

Thanks for your reply.

Vinoth Narasimhan

unread,
Oct 7, 2016, 8:16:53 AM10/7/16
to Kubernetes user discussion and Q&A

Those 3 containers in RC layer not in deployment :(

Tim Hockin

unread,
Oct 7, 2016, 11:50:34 AM10/7/16
to kubernet...@googlegroups.com
The docs are weak (absent) on this. I filed a docs bug. The idea is
that when you use the configMap volume type, and later update the API
object, the files on disk get updated atomically.
Reply all
Reply to author
Forward
0 new messages