Generate immutable ConfigMaps and Secrets that roll out on change.
Timoni offers a CUE definition #ImmutableConfig for generating immutable Kubernetes ConfigMaps and Secrets.When the ConfigMap or Secret data changes, Timoni will create a new object with a new name suffix,
and it will update the references to the new object, triggering a rolling update for the
application’s Deployments, StatefulSets, DaemonSets, etc.
The old ConfigMaps and Secrets will be deleted from the cluster after the rolling update is completed.
Assuming you want to populate the app Deployment environment variables from a Kubernetes Secret,
with data that end-users can set at installation and upgrade time.
The #ImmutableConfig definition will generate an immutable Secret resource with the
metadata.name set to<instance-name>-<data-hash>, where <data-hash> is a hash
of the #Data object. This ensures that the Secret name will change when the
#Data content changes.
ConfigMap generatorIf you want to generate a Kubernetes ConfigMap instead of a Secret,
set the #Kind to timoniv1.#ConfigMapKind.If you want to generate multiple ConfigMaps and Secrets, to avoid name collisions,
set the #Suffix to a unique string, e.g. #Suffix: "-cm1".
We need to pass the secretName to the Deployment template so that every time the
Secret name changes, the Deployment spec will be updated with the new name.
In the templates/config.cue file, add the Secret resource to the instance objects,
and pass the generated secret.metadata.name to the Deployment template:
{"docsConfig":{"theme":"aspen","$schema":"https://mintlify.com/docs.json","name":"Timoni","description":"Timoni is a package manager for Kubernetes powered by CUE lang.","colors":{"primary":"#7e56c2","light":"#a98be0","dark":"#6500b0"},"logo":{"light":"https://mintcdn.com/timoni/8xOqj2ulwazG1u2D/images/logo_text_black.svg?fit=max\u0026auto=format\u0026n=8xOqj2ulwazG1u2D\u0026q=85\u0026s=85ffbf62ec541a621a19255513199222","dark":"https://mintcdn.com/timoni/8xOqj2ulwazG1u2D/images/logo_text_white.svg?fit=max\u0026auto=format\u0026n=8xOqj2ulwazG1u2D\u0026q=85\u0026s=89788f7e520a7c81896a693804eb502d","href":"/"},"favicon":"https://mintcdn.com/timoni/8xOqj2ulwazG1u2D/images/favicon.png?fit=max\u0026auto=format\u0026n=8xOqj2ulwazG1u2D\u0026q=85\u0026s=214f9ea61f808abf055c6211a83d221c","appearance":{"default":"system"},"background":{"decoration":"gradient"},"navbar":{"links":[{"icon":"download","href":"/install","label":"Install"},{"icon":"github-alt","href":"https://github.com/stefanprodan/timoni","label":"GitHub"}]},"footer":{"socials":{"github":"https://github.com/stefanprodan/timoni","slack":"https://cloud-native.slack.com/team/ULPRMFH38","x":"https://x.com/stefanprodan","linkedin":"https://linkedin.com/in/stefanprodan"}},"seo":{"metatags":{"twitter:site":"@stefanprodan","twitter:creator":"@stefanprodan","twitter:card":"summary_large_image"},"indexing":"navigable"},"styling":{"eyebrows":"breadcrumbs","codeblocks":"system","latex":false},"errors":{"404":{"redirect":false,"title":"Page not found","description":"The page you are looking for does not exist or has moved.\n\n\u003cCardGroup cols={2}>\n \u003cCard title=\"Quickstart\" icon=\"rocket\" href=\"/quickstart\">Deploy your first module in minutes.\u003c/Card>\n \u003cCard title=\"Installation\" icon=\"download\" href=\"/install\">Get the Timoni CLI for your OS.\u003c/Card>\n \u003cCard title=\"CUE Reference\" icon=\"code\" href=\"/cue/module/initialization\">Author Timoni modules with CUE.\u003c/Card>\n \u003cCard title=\"CLI Reference\" icon=\"terminal\" href=\"/cmd/timoni\">Every timoni command and flag.\u003c/Card>\n\u003c/CardGroup>\n\nFollowed a broken link? [Open an issue](https://github.com/stefanprodan/timoni/issues) so we can fix it."}},"contextual":{"options":["copy","mcp","view","cursor","vscode"],"display":"header"},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"timoni","hasAudioNarration":false,"actualSubdomain":"timoni","customDomains":["timoni.sh"],"gitSource":{"type":"github","owner":"stefanprodan","repo":"timoni","deployBranch":"website","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6ad8f35f909164048812f22b","collectionId":"53c8db00-97e1-4614-805a-d7f924f853ad","liveDeploymentHistoryId":"6ad8f35f909164048812f22b","schemaVersion":"v3"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6ad8f35f909164048812f22b","clientVersion":"0.0.3971","searchFilterCounts":[{"language":"default","tag":"CLI Reference","count":49},{"language":"default","tag":"Documentation","count":16},{"language":"default","tag":"CUE Reference","count":14},{"language":"default","tag":"Module","count":13},{"language":"default","tag":"Instance","count":9},{"language":"default","tag":"Module Development","count":9},{"language":"default","tag":"Artifact","count":7},{"language":"default","tag":"Bundle","count":7},{"language":"default","tag":"App Delivery","count":6},{"language":"default","tag":"Integrations","count":5}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true,"deflection":{"enabled":true,"email":"[email protected]"}},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":"body:has(#timoni-home) #navbar div:has(>.nav-tabs){display:none}#body-content,#navbar>div.mx-auto{max-width:100rem!important}@media (min-width:1024px){#content-container{max-width:none!important;padding-left:3rem!important}}#header>.text-lg.prose{display:none}body:has(#timoni-home) #body-content{max-width:none!important}.tm-gradient{background:linear-gradient(135deg,#7e56c2 0,#6500b0 60%,#2b1a4a 100%)}.tm-on-gradient{color:rgba(255,255,255,.8)}.tm-outline-light{color:#fff;border:1px solid rgba(255,255,255,.5)}.tm-outline-light:hover{border-color:#fff}.tm-band{background:#faf8fd;border-top:1px solid #ebe6f4;border-bottom:1px solid #ebe6f4}html.dark .tm-band{background:rgba(255,255,255,.025);border-color:rgba(255,255,255,.07)}#navbar .navbar-link>a,.tm-check{justify-content:center;border-radius:9999px}.tm-check{display:inline-flex;flex:none;align-items:center;width:1.25rem;height:1.25rem;margin-top:.1rem;background:rgba(126,86,194,.12);color:#7e56c2}.tm-check svg{width:.65rem!important;height:.65rem!important}html.dark .tm-check{background:rgba(169,139,224,.18);color:#a98be0}.tm-diagram-frame{padding:1.25rem;border:1px solid #ebe6f4;border-radius:1rem;background:#fff}html.dark .tm-diagram-frame{border-color:rgba(255,255,255,.08);background:rgba(255,255,255,.02)}.tm-footer,.tm-footer-bottom{border-top:1px solid #ebe6f4}html.dark .tm-footer,html.dark .tm-footer-bottom{border-color:rgba(255,255,255,.07)}.tm-footer ul a{color:#4b5563}html.dark .tm-footer ul a{color:#9ca3af}.tm-footer ul a:hover,.tm-footer-socials a:hover{color:#7e56c2}html.dark .tm-footer ul a:hover{color:#a98be0}.tm-footer-socials{display:inline-flex;gap:1rem}.tm-footer-socials a{color:#6b7280}.tm-footer-socials svg{width:1.1rem!important;height:1.1rem!important}#navbar .navbar-link>a{width:30px;height:30px;padding:0;background:rgba(31,41,55,.04)}.tm-outline-light:hover,html.dark #navbar .navbar-link>a{background:rgba(255,255,255,.1)}#navbar .navbar-link>a>span{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}#navbar .navbar-link>a>svg{width:1rem;height:1rem;background-color:#4b5563}#navbar .navbar-link>a:hover>svg{background-color:#1f2937}html.dark #navbar .navbar-link>a>svg{background-color:#d1d5db}html.dark #navbar .navbar-link>a:hover>svg{background-color:#f3f4f6}.not-found-container{max-width:44rem!important;padding-top:8rem!important}.not-found-description .card-group{width:100%;text-align:left}.not-found-description .card-group .card{text-align:left}#navbar img.nav-logo{height:30px}[data-component-part=card-icon] img[src*=\"/images/icons/\"],img.tm-hero-logo{object-fit:none;object-position:-9999px -9999px;mask-repeat:no-repeat;mask-position:center;mask-size:contain}[data-component-part=card-icon] img[src*=\"/images/icons/\"]{background-color:rgb(var(--primary))}html.dark [data-component-part=card-icon] img[src*=\"/images/icons/\"]{background-color:rgb(var(--primary-light))}[data-component-part=card-icon] img[src*=\"/images/icons/kubernetes.svg\"]{mask-image:url(/images/icons/kubernetes.svg)}[data-component-part=card-icon] img[src*=\"/images/icons/helm.svg\"]{mask-image:url(/images/icons/helm.svg)}[data-component-part=card-icon] img[src*=\"/images/icons/cue.svg\"]{mask-image:url(/images/icons/cue.svg)}[data-component-part=card-icon] img[src*=\"/images/icons/flux.svg\"]{mask-image:url(/images/icons/flux.svg)}img.tm-hero-logo{background-color:#111827;mask-image:url(/images/logo_icons.svg)}html.dark img.tm-hero-logo{background-color:#fff}"}],"page":{"pagePath":"cue/module/immutable-config","slug":"/cue/module/immutable-config","pageMetadata":{"title":"Immutable ConfigMaps and Secrets","description":"Generate immutable ConfigMaps and Secrets that roll out on change.","href":"/cue/module/immutable-config"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Generate immutable ConfigMaps and Secrets that roll out on change.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={code:`code`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Tip}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Tip)_missingMdxReference(`Tip`,true);return _jsxs(_Fragment,{children:[_jsxs(_components.p,{children:[`Timoni offers a CUE definition `,_jsx(_components.code,{children:`#ImmutableConfig`}),` for generating immutable Kubernetes ConfigMaps and Secrets.`]}),`\n`,_jsx(_components.p,{children:`When the ConfigMap or Secret data changes, Timoni will create a new object with a new name suffix,\nand it will update the references to the new object, triggering a rolling update for the\napplication’s Deployments, StatefulSets, DaemonSets, etc.\nThe old ConfigMaps and Secrets will be deleted from the cluster after the rolling update is completed.`}),`\n`,_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(_components.p,{children:`Assuming you want to populate the app Deployment environment variables from a Kubernetes Secret,\nwith data that end-users can set at installation and upgrade time.`}),`\n`,_jsxs(Heading,{level:`3`,id:`create-the-secret-template`,children:[`Create the `,_jsx(_components.code,{children:`Secret`}),` template`]}),`\n`,_jsxs(_components.p,{children:[`In the `,_jsx(_components.code,{children:`templates`}),` directory, create a `,_jsx(_components.code,{children:`secret.cue`}),` file with the following content:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`15`,language:`cue`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cue`,children:_jsxs(_components.code,{language:`cue`,numberOfLines:`15`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`package`}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:` templates`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` (`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#4EC9B0`},children:`\ttimoniv1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`timoni.sh/core/v1alpha1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`)`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Secret`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timoniv1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#ImmutableConfig`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t#config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Config`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t#Kind`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`timoniv1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#SecretKind`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t#Meta`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t#Data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`LOGGING_LEVEL_ROOT`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`logLevel`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`The `,_jsx(_components.code,{children:`#ImmutableConfig`}),` definition will generate an immutable `,_jsx(_components.code,{children:`Secret`}),` resource with the\n`,_jsx(_components.code,{children:`metadata.name`}),` set to`,_jsx(_components.code,{children:`\u003cinstance-name>-\u003cdata-hash>`}),`, where `,_jsx(_components.code,{children:`\u003cdata-hash>`}),` is a hash\nof the `,_jsx(_components.code,{children:`#Data`}),` object. This ensures that the `,_jsx(_components.code,{children:`Secret`}),` name will change when the\n`,_jsx(_components.code,{children:`#Data`}),` content changes.`]}),`\n`,_jsxs(Tip,{children:[_jsx(_components.p,{children:_jsx(_components.strong,{children:`ConfigMap generator`})}),_jsxs(_components.p,{children:[`If you want to generate a Kubernetes ConfigMap instead of a Secret,\nset the `,_jsx(_components.code,{children:`#Kind`}),` to `,_jsx(_components.code,{children:`timoniv1.#ConfigMapKind`}),`.`]}),_jsxs(_components.p,{children:[`If you want to generate multiple ConfigMaps and Secrets, to avoid name collisions,\nset the `,_jsx(_components.code,{children:`#Suffix`}),` to a unique string, e.g. `,_jsx(_components.code,{children:`#Suffix: \"-cm1\"`}),`.`]})]}),`\n`,_jsxs(Heading,{level:`3`,id:`reference-the-secret-in-the-deployment-template`,children:[`Reference the `,_jsx(_components.code,{children:`Secret`}),` in the `,_jsx(_components.code,{children:`Deployment`}),` template`]}),`\n`,_jsxs(_components.p,{children:[`In the `,_jsx(_components.code,{children:`templates/deployment.cue`}),` file, define the `,_jsx(_components.code,{children:`secretName`}),` as an input parameter,\nand reference it in `,_jsx(_components.code,{children:`envFrom`}),`:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`19`,language:`cue`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cue`,children:_jsxs(_components.code,{language:`cue`,numberOfLines:`19`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Deployment`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`appsv1`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Deployment`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t#config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Config`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t#secretName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4EC9B0`},children:`string`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` `})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\tspec`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\ttemplate`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\tspec`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\t\tcontainers`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\t\t\tenvFrom`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [{`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\t\t\t\tsecretRef`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\t\t\t\t\tname`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#secretName`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t\t\t\t\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t\t\t\t}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t\t\t}]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`We need to pass the `,_jsx(_components.code,{children:`secretName`}),` to the `,_jsx(_components.code,{children:`Deployment`}),` template so that every time the\n`,_jsx(_components.code,{children:`Secret`}),` name changes, the `,_jsx(_components.code,{children:`Deployment`}),` spec will be updated with the new name.`]}),`\n`,_jsxs(Heading,{level:`3`,id:`add-the-loglevel-to-the-config-definition`,children:[`Add the `,_jsx(_components.code,{children:`logLevel`}),` to the `,_jsx(_components.code,{children:`Config`}),` definition`]}),`\n`,_jsxs(_components.p,{children:[`In the `,_jsx(_components.code,{children:`templates/config.cue`}),` file, add the `,_jsx(_components.code,{children:`logLevel`}),` configuration:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`3`,language:`cue`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cue`,children:_jsxs(_components.code,{language:`cue`,numberOfLines:`3`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` logLevel`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`*`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`INFO`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`DEBUG`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`WARN`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` |`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` \"`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`ERROR`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(Heading,{level:`3`,id:`add-the-secret-to-the-instance-definition`,children:[`Add the `,_jsx(_components.code,{children:`Secret`}),` to the `,_jsx(_components.code,{children:`Instance`}),` definition`]}),`\n`,_jsxs(_components.p,{children:[`In the `,_jsx(_components.code,{children:`templates/config.cue`}),` file, add the `,_jsx(_components.code,{children:`Secret`}),` resource to the instance objects,\nand pass the generated `,_jsx(_components.code,{children:`secret.metadata.name`}),` to the `,_jsx(_components.code,{children:`Deployment`}),` template:`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`13`,language:`cue`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`cue`,children:_jsxs(_components.code,{language:`cue`,numberOfLines:`13`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Instance`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\tconfig`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Config`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\tobjects`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\tsecret`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Secret`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\tdeploy`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`#Deployment`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` \u0026`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\t#config`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`config`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`\t\t\t#secretName`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`secret`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`metadata`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`name`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`\t}`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`]})})})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"codeStyling":"system","config":{},"pageMetadata":{"title":"Immutable ConfigMaps and Secrets","description":"Generate immutable ConfigMaps and Secrets that roll out on change.","href":"/cue/module/immutable-config"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example","slug":"example","depth":2,"children":[{"title":"Create the Secret template","slug":"create-the-secret-template","depth":3,"children":[]},{"title":"Reference the Secret in the Deployment template","slug":"reference-the-secret-in-the-deployment-template","depth":3,"children":[]},{"title":"Add the logLevel to the Config definition","slug":"add-the-loglevel-to-the-config-definition","depth":3,"children":[]},{"title":"Add the Secret to the Instance definition","slug":"add-the-secret-to-the-instance-definition","depth":3,"children":[]}]}],"codeExamples":{}},"jsLinks":[],"subdomain":"timoni","siteName":"Timoni","title":"Immutable ConfigMaps and Secrets - Timoni","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-08-16T15:06:50.643Z","originalFileLocation":"cue/module/immutable-config.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate immutable ConfigMaps and Secrets that roll out on change.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Timoni\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Immutable ConfigMaps and Secrets - Timoni\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate immutable ConfigMaps and Secrets that roll out on change.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Timoni\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://timoni.sh/cue/module/immutable-config\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://timoni.mintlify.app/_mintlify/api/og/v2?division=Module+Development\u0026amp;title=Immutable+ConfigMaps+and+Secrets\u0026amp;description=Generate+immutable+ConfigMaps+and+Secrets+that+roll+out+on+change.\u0026amp;theme=d31bdd9b74b0932292c26bd2\u0026amp;signature=d3eb581df1a3be24c3918e987637403bb6ecc209ef3cc40bc28a156b7f1275d7\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Immutable ConfigMaps and Secrets - Timoni\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate immutable ConfigMaps and Secrets that roll out on change.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://timoni.mintlify.app/_mintlify/api/og/v2?division=Module+Development\u0026amp;title=Immutable+ConfigMaps+and+Secrets\u0026amp;description=Generate+immutable+ConfigMaps+and+Secrets+that+roll+out+on+change.\u0026amp;theme=d31bdd9b74b0932292c26bd2\u0026amp;signature=d3eb581df1a3be24c3918e987637403bb6ecc209ef3cc40bc28a156b7f1275d7\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/timoni/wBHd5XBsu-JLPEJB/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Timoni\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#7e56c2\">\u003cmeta data-mint-head name=\"twitter:creator\" content=\"@stefanprodan\">\u003clink data-mint-head rel=\"canonical\" href=\"https://timoni.sh/cue/module/immutable-config\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/cue/module/immutable-config.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://timoni.sh/#organization\",\"name\":\"Timoni\",\"url\":\"https://timoni.sh\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/timoni/8xOqj2ulwazG1u2D/images/logo_text_black.svg?fit=max\u0026auto=format\u0026n=8xOqj2ulwazG1u2D\u0026q=85\u0026s=85ffbf62ec541a621a19255513199222\"}},{\"@type\":\"WebSite\",\"@id\":\"https://timoni.sh#website\",\"name\":\"Timoni\",\"url\":\"https://timoni.sh\",\"publisher\":{\"@id\":\"https://timoni.sh/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://timoni.sh/cue/module/immutable-config#webpage\",\"url\":\"https://timoni.sh/cue/module/immutable-config\",\"name\":\"Immutable ConfigMaps and Secrets\",\"description\":\"Generate immutable ConfigMaps and Secrets that roll out on change.\",\"dateModified\":\"2026-08-16T15:06:50.643Z\",\"isPartOf\":{\"@id\":\"https://timoni.sh#website\"},\"breadcrumb\":{\"@id\":\"https://timoni.sh/cue/module/immutable-config#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://timoni.sh/cue/module/immutable-config#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Module Development\",\"item\":\"https://timoni.sh/cue/module/initialization\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Immutable ConfigMaps and Secrets\",\"item\":\"https://timoni.sh/cue/module/immutable-config\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://timoni.sh/cue/module/immutable-config#article\",\"headline\":\"Immutable ConfigMaps and Secrets\",\"name\":\"Immutable ConfigMaps and Secrets\",\"description\":\"Generate immutable ConfigMaps and Secrets that roll out on change.\",\"url\":\"https://timoni.sh/cue/module/immutable-config\",\"mainEntityOfPage\":{\"@id\":\"https://timoni.sh/cue/module/immutable-config#webpage\"},\"dateModified\":\"2026-08-16T15:06:50.643Z\",\"publisher\":{\"@id\":\"https://timoni.sh/#organization\"},\"isPartOf\":{\"@id\":\"https://timoni.sh#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Timoni\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Timoni","nav":{"global":null,"tabs":[{"tab":"Documentation","icon":"book-open","pages":[{"title":"Documentation","href":"/quickstart"}]},{"tab":"CUE Reference","icon":"code","groups":[{"group":"CUE Language","pages":[{"title":"CUE Language","sidebarTitle":"Introduction","href":"/cue/introduction"},{"title":"CUE Features Walkthrough","sidebarTitle":"CUE Walkthrough","href":"/cue/walkthrough"}]},{"group":"Module Development","pages":[{"title":"Get Started with Timoni Modules","sidebarTitle":"Get started with modules","description":"Create a new module and learn its structure and development workflow.","href":"/cue/module/initialization"},{"title":"Immutable ConfigMaps and Secrets","href":"/cue/module/immutable-config"},{"title":"Embedding files","description":"Embed configs, scripts and other plain files in modules with the @embed attribute.","href":"/cue/module/embedding-files"},{"title":"Kubernetes Custom Resources","sidebarTitle":"Add custom resources","href":"/cue/module/custom-resources"},{"title":"Kubernetes Version Constraints","sidebarTitle":"Cluster version constraints","href":"/cue/module/semver-constraints"},{"title":"Control the Apply Behavior","sidebarTitle":"Control the apply behavior","href":"/cue/module/apply-behavior"},{"title":"Custom Health Checks","sidebarTitle":"Custom health checks","href":"/cue/module/health-checks"},{"title":"Run tests with Kubernetes Jobs","href":"/cue/module/test-jobs"},{"title":"Import Kubernetes Resources from YAML","sidebarTitle":"Import resources from YAML","href":"/cue/module/import-resources"}]},{"group":"Module Distribution","pages":[{"title":"Module Publishing","sidebarTitle":"Publishing module versions","href":"/cue/module/publishing"},{"title":"Module Signing and Verification","sidebarTitle":"Signing and Verification","href":"/cue/module/signing"},{"title":"Module Distribution with GitHub Actions","sidebarTitle":"GitHub Actions","href":"/cue/module/github-actions"}]}]},{"tab":"CLI Reference","icon":"terminal","pages":[{"title":"CLI Reference","href":"/cmd/timoni"}]}]},"title":"Immutable ConfigMaps and Secrets - Timoni","buildId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","deploymentId":"dpl_DFJrtvUi8HS5F9nkooKuDJsuD5BM","dynamics":[],"chunks":[]}