{"id":17654194,"url":"https://github.com/phillebaba/kubernetes-generated-secret","last_synced_at":"2026-04-15T22:35:36.807Z","repository":{"id":57516643,"uuid":"237059229","full_name":"phillebaba/kubernetes-generated-secret","owner":"phillebaba","description":"Kubernetes controller to generate random secrets","archived":false,"fork":false,"pushed_at":"2020-03-30T08:36:03.000Z","size":81,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-05T11:48:56.774Z","etag":null,"topics":["crd","go","kubernetes","kubernetes-controller","random-secrets"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phillebaba.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-01-29T18:59:40.000Z","updated_at":"2025-04-21T14:09:06.000Z","dependencies_parsed_at":"2022-09-26T18:01:24.546Z","dependency_job_id":null,"html_url":"https://github.com/phillebaba/kubernetes-generated-secret","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/phillebaba/kubernetes-generated-secret","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillebaba%2Fkubernetes-generated-secret","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillebaba%2Fkubernetes-generated-secret/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillebaba%2Fkubernetes-generated-secret/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillebaba%2Fkubernetes-generated-secret/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phillebaba","download_url":"https://codeload.github.com/phillebaba/kubernetes-generated-secret/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phillebaba%2Fkubernetes-generated-secret/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31863495,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["crd","go","kubernetes","kubernetes-controller","random-secrets"],"created_at":"2024-10-23T12:08:58.528Z","updated_at":"2026-04-15T22:35:36.787Z","avatar_url":"https://github.com/phillebaba.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes Generated Secret\n[![GitHub](https://img.shields.io/github/license/phillebaba/kubernetes-generated-secret)](https://github.com/phillebaba/kubernetes-generated-secret)\n[![Travis (.org)](https://img.shields.io/travis/phillebaba/kubernetes-generated-secret)](https://travis-ci.org/phillebaba/kubernetes-generated-secret)\n[![Go Report Card](https://goreportcard.com/badge/github.com/phillebaba/kubernetes-generated-secret)](https://goreportcard.com/report/github.com/phillebaba/kubernetes-generated-secret)\n[![Docker Pulls](https://img.shields.io/docker/pulls/phillebaba/kubernetes-generated-secret)](https://hub.docker.com/r/phillebaba/kubernetes-generated-secret)\n\nKubernetes controller to easily generate random secrets inside your cluster. The project makes use of [`crypto/rand`](https://golang.org/pkg/crypto/rand/) to generate random values.\n\n## Install\nEasiest way is to add a git reference in your `kustomization.yaml` file.\n```yaml\napiVersion: kustomize.config.k8s.io/v1beta1\nkind: Kustomization\nresources:\n- github.com/phillebaba/kubernetes-generated-secret//config/default\n```\n\nOr you can add the CRD and Deploy the controller in your cluster manually.\n```bash\nkustomize build config/default | kubectl apply -f -\n```\n\n## How to use\nA `Secret` is generated from a `GeneratedSecret` that configures the length, character content, and additional metadata of the secret. The `GeneratedSecret` is the parent of the `Secret` it creates, meaning that the `Secret` will be deleted when the `GeneratedSecret` is deleted.\n\n### Simple random secret\nBelow is all you need to generate a `Secret` with a random value. The name and namespace will be inherited by the created `Secret`. The data field in the `GeneratedSecret` maps to the data field in the `Secret`, meaning that the specified key will be created.\n```yaml\napiVersion: core.phillebaba.io/v1alpha1\nkind: GeneratedSecret\nmetadata:\n  name: generatedsecret-sample\n  namespace: default\nspec:\n  data:\n  - key: test\n```\n\nThe resulting `Secret` will look like the one below.\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: generatedsecret-sample\n  namespace: default\nspec:\n  data:\n    test: \u003cRANDOM_VALUE\u003e\n```\n\n### Configuration\nThere is an optional `secretMetadata` that can be set. The metadata specified will propogate to the generated `Secret` with the exception of the name and namespace which is inherited by the parent `GeneratedSecret`. Additionally the length and characters used in the secret can also be set.\n```yaml\napiVersion: core.phillebaba.io/v1alpha1\nkind: GeneratedSecret\nmetadata:\n  name: generatedsecret-sample\nspec:\n  secretMetadata:\n    labels:\n      app: foobar\n  data:\n  - key: test\n    length: 100\n    exclude:\n    - Uppercase\n```\n\nThe metadata will be propogated to the `Secret`.\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: generatedsecret-sample\n  namespace: default\n  labels:\n    app: foobar\nspec:\n  data:\n    test: \u003cRANDOM_VALUE\u003e\n```\n\n### Multiple secrets\nIt is also possible to generate a `Secret` with multiple keys in it.\n```yaml\napiVersion: core.phillebaba.io/v1alpha1\nkind: GeneratedSecret\nmetadata:\n  name: generatedsecret-sample\nspec:\n  data:\n  - key: foo\n    length: 100\n    exclude:\n    - Uppercase\n    - Lowercase\n  - key: bar\n    length: 50\n    exclude:\n    - Numbers\n    - Symbols\n```\n\nEach key will receive a different random value.\n```yaml\napiVersion: v1\nkind: Secret\nmetadata:\n  name: generatedsecret-sample\n  labels:\n    app: foobar\nspec:\n  data:\n    foo: \u003cRANDOM_VALUE_1\u003e\n    bar: \u003cRANDOM_VALUE_2\u003e\n```\n\n## Development\nThe project is setup with [Kubebuilder](https://github.com/kubernetes-sigs/kubebuilder) so it is good to install it as the integration tests depend on it, follow the [installation instructions](https://book.kubebuilder.io/quick-start.html#installation).\n\nTo simplify development it helps to use a local cluster, [Kind](https://github.com/kubernetes-sigs/kind) is a good example of such a tool. Given that a cluster is configured in a kubeconfig file run the following command to install the CRD.\n```bash\nmake install\n```\n\nThen run the controller, the following command will run the controller binary.\n```bash\nmake run\n```\n\nOr you can run the controller inside of the cluster, like you would when actually deploying it.\n```bash\nmake deploy\n```\n\nRun the test rule to run the integration tests.\n```bash\nmake test\n```\n\n## License\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillebaba%2Fkubernetes-generated-secret","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphillebaba%2Fkubernetes-generated-secret","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphillebaba%2Fkubernetes-generated-secret/lists"}