<p>I'm new to kubernetes.
I would like to know how to pass default.yaml in secrets to env in deployment?
i tried it separately but it saves the default empty and i want to override it
Thank you.</p>

angela
<p>You can store the file in Secret or Configmap</p>
<p>Example :</p>
<pre><code>apiVersion: v1
kind: Secret
metadata:
  name: nginx-data
data:
  default.yaml: |-
    server {
            server_name  _;
            listen 443 ssl http2;
            listen [::]:443 ssl http2;
            ssl_protocols TLSv1.2 TLSv1.3;
            ssl_certificate /etc/cert/tls.crt;
            ssl_certificate_key /etc/cert/tls.key;            
            location / {
                proxy_pass http://127.0.0.1:80;
            }
        }
</code></pre>
<p>and inject it into the POD as per requirement. Update <code>default.yaml</code> as per need.</p>
<p>You can store and create the YAML inside the secret and inject into the deployment of <strong>MongoD</strong> it will work.</p>
<p>Configmap example : <a href="https://www.cloudytuts.com/guides/kubernetes/how-to-deploy-mongodb-on-kubernetes/" rel="nofollow noreferrer">https://www.cloudytuts.com/guides/kubernetes/how-to-deploy-mongodb-on-kubernetes/</a></p>
<p>For more : <a href="https://www.jeffgeerling.com/blog/2019/mounting-kubernetes-secret-single-file-inside-pod" rel="nofollow noreferrer">https://www.jeffgeerling.com/blog/2019/mounting-kubernetes-secret-single-file-inside-pod</a></p>
