<p>I've been having a recurring problem with a deployment for a particular pod, <code>fooserviced</code>, recently. I usually get a <code>CreateContainerConfigError</code> when I update the pod, and the detail given is <code>Error: secrets "fooserviced-envars" not found</code>. I'm not sure when I named the file this poorly but so far the only solution I've found is to re-add the environment variables file using </p>

<pre><code>kubectl create secret generic fooserviced-envars --from-env-file ./fooserviced-envvars.txt 
</code></pre>

<p>So now, when I do <code>kubectl get secrets</code> I see both <code>fooserviced-envars</code> and <code>fooserviced-envvars</code>. I'd like to change the deployment to use <code>fooserviced-envvars</code>; how would I do this?</p>

Woody1193
<p>You can edit the deployment via <code>kubectl edit deployment deploymentname</code> which will open an editor and you can change the secret there live.</p>

<p>Another way to do this would be to run <code>kubectl get deployment deploymentname -o yaml &gt; deployment.yaml</code>  which will give you the yaml file and you can edit it in your editor and <code>kubectl apply</code> the modified yaml.</p>
