<p>I want google cloud kubernetes to run my docker image with images. such as:</p>

<pre><code>docker run -it --runtime=nvidia --volume path_to_data:/root/data my_image
</code></pre>

<p>How to configure these parameters?</p>

lkhgvsuren
<p>It depends on Registry visibility.</p>

<p>For public images such as <code>nginx</code> it's simple:</p>

<p>Just run:</p>

<pre class="lang-sh prettyprint-override"><code>kubectl run mynginx --image=nginx
</code></pre>

<p>There is good explanation: <a href="https://www.youtube.com/watch?v=Yji-nfuUvIo" rel="nofollow noreferrer">Running a Docker Container on Google Container Engine - YouTube</a></p>

<p>As for Private registry, there are many cases.</p>

<p>According to manual: <a href="https://kubernetes.io/docs/concepts/containers/images/" rel="nofollow noreferrer">Images - Kubernetes</a></p>

<blockquote>
  <h3><a href="https://kubernetes.io/docs/concepts/containers/images/#using-a-private-registry" rel="nofollow noreferrer">Using a Private Registry</a></h3>
  
  <p>Private registries may require keys to read images from them. Credentials can be provided in several ways:</p>
  
  <p>Using Google Container Registry</p>
  
  <ul>
  <li>Per-cluster</li>
  <li>automatically configured on Google Compute Engine or Google Kubernetes Engine</li>
  <li>all pods can read the project’s private registry</li>
  </ul>
  
  <h3><a href="https://kubernetes.io/docs/concepts/containers/images/#using-google-container-registry" rel="nofollow noreferrer">Using Google Container Registry</a></h3>
  
  <p>Kubernetes has native support for the <a href="https://cloud.google.com/tools/container-registry/" rel="nofollow noreferrer">Google Container Registry (GCR)</a>, when running on Google Compute Engine (GCE). If you are running your cluster on GCE or Google Kubernetes Engine, simply use the full image name (e.g. gcr.io/my_project/image:tag).</p>
  
  <p>All pods in a cluster will have read access to images in this registry.</p>
  
  <p>The kubelet will authenticate to GCR using the instance’s Google service account. The service account on the instance will have a <code>https://www.googleapis.com/auth/devstorage.read_only</code>, so it can pull from the project’s GCR, but not push</p>
</blockquote>

<p>So, to run image from gcr.io, you can </p>

<pre class="lang-sh prettyprint-override"><code>kubectl run myapp --image=gcr.io/my_project/image:tag
</code></pre>
