<p>On Minikube using KubeCtl, I run an image created by Docker using the following command:</p>
<pre><code>kubectl run my-service --image=my-service-image:latest --port=8080 --image-pull-policy Never
</code></pre>
<p>But on Minukube, a different configuration is to be applied to the application. I prepared some environment variables in a deployment file and want to apply them to the images on Minikube. Is there a way to tell KubeCtl to run those images using a given deployment file or even a different way to provide the images with those values?</p>
<p>I tried the <em>apply</em> verb of KubeCtl for example, but it tries to create the pod instead of applying the configuration on it.</p>

AHH
<p>In minukube/kubernetes you need to apply the environment variables in the yaml file of your pod/deployment.</p>
<p>Here is a example of how you can configure the environment variables in a deployment spec:</p>
<pre><code>apiVersion: apps/v1
kind: Pod
metadata:
  name: envar-demo
  labels:
    purpose: demonstrate-envars
spec:
  containers:
  - name: envar-demo-container
    image: gcr.io/google-samples/node-hello:1.0
    env:
    - name: DEMO_GREETING
      value: &quot;Hello from the environment&quot;
    - name: DEMO_FAREWELL
      value: &quot;Such a sweet sorrow&quot;
</code></pre>
<p><a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">Here</a> you can find more information abour environment variables.</p>
<p>In this case, if you want to change any value, you need to delete the pod and apply it again. But if you use <a href="https://kubernetes.io/docs/concepts/workloads/controllers/deployment/" rel="nofollow noreferrer"><code>deployment</code></a> all modification can be done using <code>kubectl apply</code> command.</p>
