Skip to content

generate dockerconfigjson from 1password entry #197

@martinscholz-mediatis

Description

@martinscholz-mediatis

Summary

Support for different Secret types

Use cases

We'd like to be able to set the dockerconfigjson in one password as a secret, so it would be awesome that one could enter the parameters like:

  • docker-server,
  • docker-username,
  • docker-password and
  • docker-email

in the secret and this will generate an entry for the secrets in the form of:

apiVersion: v1
kind: Secret
metadata:
  ...
  name: regcred
  ...
data:
  .dockerconfigjson: eyJodHRwczovL2luZGV4L ... J0QUl6RTIifX0=
type: kubernetes.io/dockerconfigjson

with the .data..dockerconfigjson in the form of:

{"auths":{"docker-server-value":{"username":"docker-username-value","password":"docker-password-value","email":"docker-email-value","auth":"base64encoded(docker-username-value:docker-password-value)"}}}

Proposed solution

it would be awesome if one could add a special flag to an secret like an text entry that would handle the type setting, like:
.dockerconfigjson as name and kubernetes.io/dockerconfigjson as value or type and the kubernetes.io/dockerconfigjson as value and then let the operator generate the secret out of the box from this. that way also key-rollovers for the config would be pretty straightforward.

Is there a workaround to accomplish this today?

the only workaround to do so is the following to directly interact with the kubernetes cluster and set the secret by hand in the form of:

kubectl create secret docker-registry regcred --docker-server=<your-registry-server> --docker-username=<your-name> --docker-password=<your-pword> --docker-email=<your-email>

this will generate a regard secret of the form above, with the suitable values generated.

References & Prior Work

The official documentation about it is here:
https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions