{"id":23455182,"url":"https://github.com/cloudnative-pg/cnpg-i-hello-world","last_synced_at":"2025-04-14T00:25:38.010Z","repository":{"id":235801588,"uuid":"783631016","full_name":"cloudnative-pg/cnpg-i-hello-world","owner":"cloudnative-pg","description":null,"archived":false,"fork":false,"pushed_at":"2024-10-24T14:59:52.000Z","size":112,"stargazers_count":1,"open_issues_count":5,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-25T09:12:40.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cloudnative-pg.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-08T09:11:56.000Z","updated_at":"2024-10-24T14:57:20.000Z","dependencies_parsed_at":"2024-04-24T16:25:40.732Z","dependency_job_id":"8ce38fa0-2063-41c9-b386-a928a8744df6","html_url":"https://github.com/cloudnative-pg/cnpg-i-hello-world","commit_stats":null,"previous_names":["cloudnative-pg/cnpg-i-hello-world"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnative-pg%2Fcnpg-i-hello-world","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnative-pg%2Fcnpg-i-hello-world/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnative-pg%2Fcnpg-i-hello-world/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cloudnative-pg%2Fcnpg-i-hello-world/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cloudnative-pg","download_url":"https://codeload.github.com/cloudnative-pg/cnpg-i-hello-world/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248800104,"owners_count":21163404,"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","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":[],"created_at":"2024-12-24T03:29:19.874Z","updated_at":"2025-04-14T00:25:37.994Z","avatar_url":"https://github.com/cloudnative-pg.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CNPG-I Hello World Plugin\n\nA [CNPG-I](https://github.com/cloudnative-pg/cnpg-i) plugin to add\nuser-defined labels, annotations and a specific `pause` sidecar\nto the pods of\n[CloudNativePG](https://github.com/cloudnative-pg/cloudnative-pg/) clusters.\n\nThis project serves as an introductory guide to bootstrapping\na [CNPG-I](https://github.com/cloudnative-pg/cnpg-i) plugin and leveraging\nlifecycle hooks within a development environment. While similar results can be\nachieved through simpler methods such as mutating webhooks or CNPG's built-in\nfeatures, this project is specifically designed to familiarize developers with\nthe plugin workflow. By understanding how lifecycle hooks interact with other\ninterfaces, developers can gain a deeper insight into implementing complex\nresource changes in real-world applications.\n\nThis plugin uses\nthe [pluginhelper](https://github.com/cloudnative-pg/cnpg-i-machinery/tree/main/pkg/pluginhelper)\nfrom [`cnpg-i-machinery`](https://github.com/cloudnative-pg/cnpg-i-machinery) to\nsimplify the plugin's implementation.\n\n## Running the plugin\n\nTo see the plugin in execution, you need to have a Kubernetes cluster running\n(we'll use [Kind](https://kind.sigs.k8s.io)) and the\n[CloudNativePG](https://github.com/cloudnative-pg/cloudnative-pg/) operator\ninstalled. The plugin also requires certificates to communicate with the\noperator, hence we are also installing [cert-manager](https://cert-manager.io/)\nto manage them.\n\n``` shell\nkind create cluster --name cnpg-i-hello-world\n# Choose the latest version of CloudNativePG (at least 1.24)\nkubectl apply --server-side -f \\\n  https://github.com/cloudnative-pg/cloudnative-pg/releases/download/vX.Y.Z/cnpg-X.Y.Z.yaml\n# Choose the latest version of cert-manager\nkubectl apply -f \\\n  https://github.com/cert-manager/cert-manager/releases/download/vX.Y.Z/cert-manager.yaml\n```\n\nThen install the plugin by applying the manifest.\nThe easiest way to obtain the manifest may be as an artifact created by the\n[`release-please` workflow](https://github.com/cloudnative-pg/cnpg-i-hello-world/actions/workflows/release-please.yml).\nYou can download it and apply it locally:\n\n``` shell\nkubectl apply -f LOCAL-FOLDER/manifest.yaml\n```\n\n\u003c!-- TODO: reevaluate on release and set release-please to automatically update it--\u003e\n\nFinally, create a cluster resource to see the plugin in action. There are three\nexamples in the `doc/examples` directory:\n\n1. [Cluster with labels and annotations](doc/examples/cluster-example.yaml):\n   adds the defined labels and annotations to the pods. Showcases the plugin\n   capability of altering the lifecycle of the CloudNativePG resources.\n2. [Cluster with no parameters](doc/examples/cluster-example-no-parameters.yaml):\n   defaults the plugin settings of the cluster. Showcases the plugin capability\n   of altering the defaulting webhook behavior.\n3. [Cluster with wrong parameters](doc/examples/cluster-example-with-mistake.yaml):\n   includes an error in the configuration. Showcases the plugin capability of\n   validating its own configuration.\n\n## Plugin development\n\nFor additional details on the plugin implementation refer to\nthe [development documentation](doc/development.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudnative-pg%2Fcnpg-i-hello-world","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcloudnative-pg%2Fcnpg-i-hello-world","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcloudnative-pg%2Fcnpg-i-hello-world/lists"}