How do I find out what image is running in a Kubernetes VM on GCE?

2/6/2017

I've created a Kubernetes cluster in Google Compute Engine using cluster/kube-up.sh. How can I find out what Linux image GCE used to create the virtual machines? I've logged into some nodes using SSH and the usual commands (uname -a etc) don't tell me.

The default config file at kubernetes/cluster/gce/config-default.sh doesn't seem to offer any clues.

-- J Bramble
google-compute-engine
kubernetes

2 Answers

2/6/2017

It uses something called Google Container VM image. Check out the blogpost announcing it here:

https://cloudplatform.googleblog.com/2016/09/introducing-Google-Container-VM-Image.html

-- iamnat
Source: StackOverflow

2/6/2017

There are two simple ways to look at it

  1. In the Kubernetes GUI based dashboard, click on the nodes
  2. From command line of the kubernetes master node use kubectl describe pods/{pod-name}

(Make sure to select the correct namespace, if you are using any.)

Here is a sample output, please look into the "image" label of the output

kubectl describe pods/fedoraapache
Name:                fedoraapache
Namespace:            default
Image(s):            fedora/apache
Node:                127.0.0.1/127.0.0.1
Labels:                name=fedoraapache
Status:                Running
Reason:
Message:
IP:                172.17.0.2
Replication Controllers:    <none>
Containers:
  fedoraapache:
    Image:        fedora/apache
    State:        Running
      Started:        Thu, 06 Aug 2015 03:38:37 -0400
    Ready:        True
    Restart Count:    0
Conditions:
  Type        Status
  Ready     True
Events:
  FirstSeen                LastSeen            Count    From            SubobjectPath                Reason        Message
  Thu, 06 Aug 2015 03:38:35 -0400    Thu, 06 Aug 2015 03:38:35 -0400    1    {scheduler }                            scheduled    Successfully assigned fedoraapache to 127.0.0.1
  Thu, 06 Aug 2015 03:38:35 -0400    Thu, 06 Aug 2015 03:38:35 -0400    1    {kubelet 127.0.0.1}    implicitly required container POD    pulled        Pod container image "gcr.io/google_containers/pause:0.8.0" already present on machine
  Thu, 06 Aug 2015 03:38:36 -0400    Thu, 06 Aug 2015 03:38:36 -0400    1    {kubelet 127.0.0.1}    implicitly required container POD    created        Created with docker id 98aeb13c657b
  Thu, 06 Aug 2015 03:38:36 -0400    Thu, 06 Aug 2015 03:38:36 -0400    1    {kubelet 127.0.0.1}    implicitly required container POD    started        Started with docker id 98aeb13c657b
  Thu, 06 Aug 2015 03:38:37 -0400    Thu, 06 Aug 2015 03:38:37 -0400    1    {kubelet 127.0.0.1}    spec.containers{fedoraapache}        created        Created with docker id debe7fe1ff4f
  Thu, 06 Aug 2015 03:38:37 -0400    Thu, 06 Aug 2015 03:38:37 -0400    1    {kubelet 127.0.0.1}    spec.containers{fedoraapache}        started        Started with docker id debe7fe1ff4f
-- Santanu Dey
Source: StackOverflow