{"id":8071,"date":"2023-06-01T06:16:59","date_gmt":"2023-06-01T06:16:59","guid":{"rendered":"https:\/\/www.bacancytechnology.com\/qanda\/?p=8071"},"modified":"2024-06-27T10:21:20","modified_gmt":"2024-06-27T10:21:20","slug":"reference-kubernetes-secrets-in-helm-chart","status":"publish","type":"post","link":"https:\/\/www.bacancytechnology.com\/qanda\/cloud\/reference-kubernetes-secrets-in-helm-chart","title":{"rendered":"How to Reference Kubernetes Secrets in Helm Chart?"},"content":{"rendered":"<p>We can write a secret as an environment variable in the container.<br \/>\nFor example:<\/p>\n<p>We have Deployment as mongodb.yml<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">env:\r\n - name: SECRET_VALUE_ENV_VAR \r\n   valueFrom:\r\n         secretKeyRef: \r\n                name: myusername\r\n                key: password\r\n<\/pre>\n<p>The secret will be injected in the container using Environment Variable.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We can write a secret as an environment variable in the container. For example: We have Deployment as mongodb.yml env: &#8211; name: SECRET_VALUE_ENV_VAR valueFrom: secretKeyRef: name: myusername key: password The secret will be injected in the container using Environment Variable.<\/p>\n","protected":false},"author":1,"featured_media":8435,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[17],"tags":[],"class_list":["post-8071","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cloud"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/8071"}],"collection":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/comments?post=8071"}],"version-history":[{"count":3,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/8071\/revisions"}],"predecessor-version":[{"id":8074,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/posts\/8071\/revisions\/8074"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media\/8435"}],"wp:attachment":[{"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/media?parent=8071"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/categories?post=8071"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bacancytechnology.com\/qanda\/wp-json\/wp\/v2\/tags?post=8071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}