1Password secret references for local Kubernetes secret manifests - #99
Merged
Merged
Conversation
… halt skaffold on compile failure
8 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds support for 1Password secret references (
op://) within Kubernetes manifest templates, so projects can keep secret manifests in git without plaintext secrets, resolving them to real values only at compile time.Related PRs
bin/lib/c-kc.js, so whichever merges second needs a trivial rebase).Notes
.yaml.tmplcontainingop://references has them resolved withop inject(file mode) before the template is rendered, so template placeholders never interfere with references. Templates without references never invokeop.type: secretservices can usestringData(plaintext, one value per line), which is base64 encoded intodatawithin the compiled manifest, just as Kubernetes expects.op whoami(only when references are present) and halts with a friendlyeval $(op signin)message otherwise.0600and removed after they've been applied (c kc start,c kc apply), or whenc skaffold devexits (newc kc secrets-cleancommand, quiet via-q). This only applies to the local environment; beta and production are unaffected (they will move to Google Secret Manager).c skaffold devnow halts when manifest compilation fails, rather than continuing into skaffold with stale compiled manifests.Verification and testing
Verification
manifests/local/site.secret.yaml) held base64 (i.e. plaintext) secret values committed to git:base64 -don any value reveals it.Testing
eval $(op signin)in the shell,c kc manifestscompiles secret templates into.compiledwith values identical to the originals (verified 18/18 fields against the previous committed secrets, both in.compiledand applied to the minikube cluster).0600; other compiled manifests remain0644.c kc start/c kc apply, compiled secret manifests are removed; other manifests remain.c skaffold devkeeps them for the session and removes them on exit (including Ctrl+C), via thec kc secrets-clean -qtrap.opsession,c kc manifestsandc skaffold devhalt with a friendly signin message (and skaffold never starts)..yaml.tmplwithout references) render exactly as before; plain.yamlsecrets are still copied verbatim (beta/production/devspace unaffected).Deployment
v6.1.0-beta.1(tag only,betadist-tag):npm version 6.1.0-beta.1 -m "Version bump to v6.1.0-beta.1."&&npm publish --access=public --tag beta&&git push --follow-tags.v6.1.0(rename the changelog heading,npm version minor,npm publish) once this PR and ras-rsc#449 are approved.