Add Container Registry Credentials

To enable registry authentication create a Secret and apply it.

create base64 encoded credentials:

> echo "oauth2:xxxxxxxxxxx" | base64
>> b2F1dGgyOnh4eHh4eHh4eHh4Cg==

create a config.json file:

config.json
{
 "auths": {
  "registry.x33u.org:443": {
   "auth": "b2F1dGgyOnh4eHh4eHh4eHh4Cg=="
  }
 }
}

encode the json file:

config.json
> cat config.json | base64 -w 0
>> ewogImF1dGhzIjogewogICJyZWdpc3RyeS54MzN1Lm9yZzo0NDMiOiB7CiAgICJhdXRoIjogImIyRjFkR2d5T25oNGVIaDRlSGg0ZUhoNENnPT0iCiAgfQogfQp9Cg==

create a kubernetes secret:

registry-secret.yml
---
apiVersion: v1
kind: Secret
metadata:
  name: registry-credentials
  namespace: default
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: ewogImF1dGhzIjogewogICJyZWdpc3RyeS54MzN1Lm9yZzo0NDMiOiB7CiAgICJhdXRoIjogImIyRjFkR2d5T25oNGVIaDRlSGg0ZUhoNENnPT0iCiAgfQogfQp9Cg==

encrypt secret using Sealed Secrets as an example

registry-secret-sealed.yml
> kubeseal --format=yaml \
  --cert=pub-sealed-secrets.pem \
  < registry-secret.yml > registry-secret-sealed.yml