Skip to content

Instantly share code, notes, and snippets.

@ThomasBuchinger
Created November 29, 2021 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasBuchinger/16f34521f56e44b72647fb75dcabf348 to your computer and use it in GitHub Desktop.
Save ThomasBuchinger/16f34521f56e44b72647fb75dcabf348 to your computer and use it in GitHub Desktop.
Kubernetes Secret from Jinja2-Template
---
apiVersion: v1
kind: Secret
metadata:
name: regcred
data:
.dockerconfigjson: {{ ('{"auths":{"https://registry.gitlab.com":{"username":"'+ var_api_user +'","password":"'+ var_api_token +'","auth":"'+ ((var_api_user +':'+ var_api_token) | b64encode) +'"}}}') | b64encode }}
type: kubernetes.io/dockerconfigjson
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment