<p>I inherited a Kubernetes/Docker setup. I am trying to recreate a dev environmental exactly as it is (with a new name) on a separate cluster. Sorry if my question is a bit ignorant, while I've mostly picked up Kubernetes/Docker, I'm still pretty new at it.</p>

<p>I've copied all of the information over to the cluster and launched it via kubectl and the old YAML. <strong>I am also using the old image file, which should contain the relevant secrets to my knowledge</strong></p>

<p>However, I am getting an error about a missing secret, db-user-pass.</p>

<p>I have checked the included secrets directory in my state store for KOPS (on S3)</p>

<pre><code> Warning  FailedScheduling       22m (x3 over 22m)  default-scheduler                                    No nodes are available that match all of the predicates: Insufficient memory (2), PodToleratesNodeTaints (1).
  Normal   Scheduled              22m                default-scheduler                                    Successfully assigned name-keycloak-7c4c57cbdf-9g2n2 to ip-ip.address.goes.here.us-east-2.compute.internal
  Normal   SuccessfulMountVolume  22m                kubelet, ip-ip.address.goes.here.us-east-2.compute.internal  MountVolume.SetUp succeeded for volume "default-token-2vb5x"
  Normal   Pulled                 21m (x6 over 22m)  kubelet, ip-ip.address.goes.here.us-east-2.compute.internal  Successfully pulled image "image.location.amazonaws.com/dev-name-keycloak"
  Warning  Failed                 21m (x6 over 22m)  kubelet, ip-ip.address.goes.here.us-east-2.compute.internal  Error: secrets "db-user-pass" not found
  Warning  FailedSync             21m (x6 over 22m)  kubelet, ip-ip.address.goes.here.us-east-2.compute.internal  Error syncing pod
  Normal   Pulling                2m (x90 over 22m)  kubelet, ip-ip.address.goes.here.us-east-2.compute.internal  pulling image "image.location.amazonaws.com/dev-name-keycloak"
</code></pre>

<p>What exactly am I misunderstanding here? Is it maybe that Kubernetes is trying to assign a variable based on a value in my YAML, which is also set on the Docker image, but isn't available to Kubernetes? Should I just copy all of the secrets manually from one pod to another (or export to YAML and include in my application).</p>

<p>I'm strongly guessing that export + put into my existing setup is probably the best way forward to give all of the credentials to the pod.</p>

<p>Any guidance or ideas would be welcome here.</p>

Steven Matthews
<p>Could you please check if you have a secret named as a "db-user-pass" in your old cluster?</p>

<p>You can check that via :
ubuntu@sal-k-m:~$ kubectl get secrets</p>

<p>OR (if  it's in a different namespace)</p>

<p>ubuntu@sal-k-m:~$ kubectl get secrets -n web </p>

<p>If the secret is there then you need to --export that also and configure that in the new cluster.</p>

<p>kubectl get secrets -n web -o yaml --export > db-user-pass.yaml</p>

<p>You can find more details about the secret in this doc.</p>

<p><a href="https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/inject-data-application/distribute-credentials-secure/</a></p>
