Skip to content

simple controller for kubernetes that generates Secret resources based off declarative blueprints

License

Notifications You must be signed in to change notification settings

mkmik/generated-secrets

Folders and files

NameName
Last commit message
Last commit date
Mar 19, 2025
Feb 25, 2022
Feb 26, 2022
Feb 28, 2022
Aug 11, 2020
Mar 7, 2022
Feb 25, 2022
Feb 25, 2022
Feb 26, 2022
Feb 25, 2022
Feb 28, 2022
May 21, 2024
May 21, 2024
Feb 25, 2022
Feb 28, 2022

Repository files navigation

Go Go Report Card

Generated Secrets

This project implements a small controller for Kubernetes that generates Secrets from a declarative blue print custom resource.

Documentation

Install

Simple install:

kubectl apply -f https://github.com/mkmik/generated-secrets/releases/download/${version}/controller.yaml

Use latest version for the latest unreleased build; otherwise look for the GitHub releases on the right sidebar ----->

Example

$ cat test-gen.yaml
apiVersion: mkm.pub/v1alpha1
kind: GeneratedSecret
metadata:
  name: test
spec:
  data:
    foo:
      length: 12

  template:
    metadata:
      labels:
        foo: bar

$ kubectl apply -f test-gen.yaml
generatedsecret.mkm.pub/test configured

$ kubectl get secret test -o yaml
apiVersion: v1
data:
  foo: MmEwOTQxNTZjYmE0ZDA5ZTM4Y2UwYzE0
kind: Secret
metadata:
  creationTimestamp: "2020-08-11T18:01:10Z"
  labels:
    foo: bar
  name: test
  namespace: default
  ownerReferences:
  - apiVersion: mkm.pub/v1alpha1
    kind: GeneratedSecret
    name: test
    uid: d98eab26-1a46-442f-b381-21276be65d64
  resourceVersion: "9029122"
  selfLink: /api/v1/namespaces/default/secrets/test
  uid: 7a1383db-0e4a-47f8-a446-a94c7bfb7a8e
type: Opaque

$ kubectl delete generatedsecret test
generatedsecret.mkm.pub "test" deleted

$ kubectl get secret test
Error from server (NotFound): secrets "test" not found

Contributing

The go-yaml-edit project team welcomes contributions from the community. Before you start working with generated-secrets, please read our Developer Certificate of Origin. All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. For more detailed information, refer to CONTRIBUTING.md.

License

generated-secrets is available under the BSD-2 license.