{"id":15161353,"url":"https://github.com/devops-360-online/k8s-secret-expiry-controller","last_synced_at":"2025-07-31T13:12:35.779Z","repository":{"id":175410468,"uuid":"653857525","full_name":"devops-360-online/k8s-secret-expiry-controller","owner":"devops-360-online","description":"K8s-Secret-Expiry-Controller is a Kubernetes operator that manages and tracks the lifespan of Kubernetes secrets.","archived":false,"fork":false,"pushed_at":"2023-06-20T11:37:33.000Z","size":79,"stargazers_count":14,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T03:41:30.412Z","etag":null,"topics":["kubernetes","operator-sdk","secret-management"],"latest_commit_sha":null,"homepage":"","language":"Makefile","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/devops-360-online.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-14T22:29:12.000Z","updated_at":"2024-02-04T13:59:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"ac6e911c-3939-46ed-9eb3-99ae82fb5c06","html_url":"https://github.com/devops-360-online/k8s-secret-expiry-controller","commit_stats":null,"previous_names":["devops-360-online/k8s-secret-expiry-controller"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devops-360-online/k8s-secret-expiry-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-360-online%2Fk8s-secret-expiry-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-360-online%2Fk8s-secret-expiry-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-360-online%2Fk8s-secret-expiry-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-360-online%2Fk8s-secret-expiry-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devops-360-online","download_url":"https://codeload.github.com/devops-360-online/k8s-secret-expiry-controller/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devops-360-online%2Fk8s-secret-expiry-controller/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268045135,"owners_count":24186741,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-31T02:00:08.723Z","response_time":66,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["kubernetes","operator-sdk","secret-management"],"created_at":"2024-09-27T00:04:52.206Z","updated_at":"2025-07-31T13:12:35.760Z","avatar_url":"https://github.com/devops-360-online.png","language":"Makefile","funding_links":["https://www.buymeacoffee.com/ladibnasr","https://img.buymeacoffee.com/button-api/?text=Buy"],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"https://www.buymeacoffee.com/ladibnasr\"\u003e\u003cimg src=\"https://img.buymeacoffee.com/button-api/?text=Buy me a coffee\u0026emoji=\u0026slug=ladibnasr\u0026button_colour=FFDD00\u0026font_colour=000000\u0026font_family=Comic\u0026outline_colour=000000\u0026coffee_colour=ffffff\" /\u003e\u003c/a\u003e\n\n# k8s-secret-expiry-controller\n\nA Kubernetes controller that watches for the expiration of Kubernetes Secrets and raises events accordingly.\n\n## Description\n\nThis project is a Kubernetes Operator built with Kubebuilder. It introduces a new Custom Resource Definition (CRD) `SecretWithExpiry` into the Kubernetes API, which is like a regular Secret but with an added expiry date.\n\n## Getting Started\n\nYou’ll need a Kubernetes cluster to run against. You can use [KIND](https://sigs.k8s.io/kind) to get a local cluster for testing, or run against a remote cluster.\n\n**Note:** Your controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster `kubectl cluster-info` shows).\n\n### Installing the CRDs into the Cluster\n\nInstall the CRDs into a cluster:\n\n```sh\ngit clone https://github.com/devops-360-online/k8s-secret-expiry-controller.git\ncd k8s-secret-expiry-controller\nkubectl apply -k config/crd\nkubectl apply -k config/default\n```\n\n### Creating a SecretWithExpiry Object\n\nCreate a new file named `secretWithExpiry.yaml` with the following contents:\n\n```yaml\napiVersion: expiry.devops-360.online/v1\nkind: SecretWithExpiry\nmetadata:\n  name: example-secretwithexpiry\nspec:\n  secretName: my-secret\n  expiryDate: \"2023-06-30T00:00:00Z\"\n```\n\nReplace `\"2023-06-30T00:00:00Z\"` with the actual expiry date you want for your secret. The date must be in the format `YYYY-MM-DDTHH:MM:SSZ`.\n\nThen, apply this file:\n\n```sh\nkubectl apply -f secretWithExpiry.yaml\n```\n\n### Viewing SecretWithExpiry Events\n\nTo view the events associated with a SecretWithExpiry object:\n\n```sh\nkubectl describe secretwithexpiry example-secretwithexpiry\n```\n\nThis command will output a description of the SecretWithExpiry object, including a list of recent events. The events will show if the secret has expired, is about to expire in less than 7 days, or if the expiry date has been updated.\n\nOr\n\n```sh\nkubectl get events\n```\n\n![warn_expiring_secret_event](images/warn_expiring_secret_event.png)\n\n## Build and push your image to the location specified by IMG\n\n```sh\nmake docker-build docker-push IMG=\u003csome-registry\u003e/k8s-secret-expiry-controller:tag\n```\n\n## Deploy the controller to the cluster with the image specified by IMG\n\n```sh\nkubectl apply -k config/default\n```\n\n## Uninstall CRDs\n\nTo delete the CRDs from the cluster:\n\n```sh\nmake uninstall\n```\n\n## Undeploy Controller\n\nUnDeploy the controller from the cluster:\n\n```sh\nmake undeploy\n```\n\n## Contributing\n\nThis project welcomes contributions. Please feel free to submit pull requests for bug fixes, improvements or new features.\n\n## How It Works\n\nThis project aims to follow the Kubernetes Operator pattern. It uses Controllers, which provide a reconcile function responsible for synchronizing resources until the desired state is reached on the cluster.\n\n## Test It Out\n\nInstall the CRDs into the cluster:\n\n```sh\nmake install\n```\n\nRun your controller (this will run in the foreground, so switch to a new terminal if you want to leave it running):\n\n```sh\nmake run\n```\n\nNOTE: You can also run this in one step by running: make install run\n\n## Modifying the API Definitions\n\nIf you are editing the API definitions, generate the manifests such as CRs or CRDs using:\n\n```sh\nmake manifests\n```\n\nNOTE: Run `make --help` for more information on all potential make targets.\n\nMore information can be found via the [Kubebuilder Documentation](https://book.kubebuilder.io/introduction.html).\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-360-online%2Fk8s-secret-expiry-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevops-360-online%2Fk8s-secret-expiry-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevops-360-online%2Fk8s-secret-expiry-controller/lists"}