{"id":27329576,"url":"https://github.com/sky-big/kubernetes-crd-controller","last_synced_at":"2026-07-01T23:32:27.545Z","repository":{"id":117456397,"uuid":"232017243","full_name":"sky-big/kubernetes-crd-controller","owner":"sky-big","description":"Kubernetes CRD Controller Framework","archived":false,"fork":false,"pushed_at":"2020-02-20T03:22:03.000Z","size":7127,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-28T10:28:16.536Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/sky-big/kubernetes-crd-controller","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sky-big.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null}},"created_at":"2020-01-06T03:31:09.000Z","updated_at":"2020-02-20T03:22:06.000Z","dependencies_parsed_at":null,"dependency_job_id":"14e20c0c-5635-4a08-8896-699aedc67967","html_url":"https://github.com/sky-big/kubernetes-crd-controller","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/sky-big/kubernetes-crd-controller","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-big%2Fkubernetes-crd-controller","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-big%2Fkubernetes-crd-controller/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-big%2Fkubernetes-crd-controller/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-big%2Fkubernetes-crd-controller/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sky-big","download_url":"https://codeload.github.com/sky-big/kubernetes-crd-controller/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sky-big%2Fkubernetes-crd-controller/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35027341,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"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":[],"created_at":"2025-04-12T12:58:49.372Z","updated_at":"2026-07-01T23:32:27.527Z","avatar_url":"https://github.com/sky-big.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Kubernetes CRD Controller\n\n## Overview\n\nKubernetes CRD Controller is to manage custom resources on the Kubernetes cluster.\n\n## Quick Start\n\n### Deploy Kubernetes CRD Controller\n\n1. Clone the project on your Kubernetes cluster master node:\n```\n$ git clone https://github.com/sky-big/kubernetes-crd-controller\n$ cd kubernetes-crd-controller\n```\n\n2. To deploy the Kubernetes CRD Controller on your Kubernetes cluster, please run the following script:\n```\n$ make install\n```\n\n3. Use command ```kubectl get pods``` to check Kubernetes CRD Operator deploy status like:\n```\n$ kubectl get pods\nNAME                                         READY   STATUS    RESTARTS   AGE\nkubernetes-crd-controller-86d5f5cbd7-6kq2x   1/1     Running   0          40m\n```\n\nNow you can use the CRDs provide by Kubernetes CRD Controller to deploy your Pulsar Cluster.\n\n### Define Custom Resource\n\n1. example [define crd1 custom resource](./pkg/apis/example/v1alpha1/crd1_types.go)\n\n```\n// +genclient\n// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\ntype CRD1 struct {\n\tmetav1.TypeMeta `json:\",inline\"`\n\t// +optional\n\tmetav1.ObjectMeta `json:\"metadata,omitempty\"`\n\t// +optional\n\tSpec CRD1Spec `json:\"spec,omitempty\"`\n\t// +optional\n\tStatus CRD1Status `json:\"status,omitempty\"`\n}\n\ntype CRD1Spec struct {\n\t// +optional\n\tGeneration int64 `json:\"generation,omitempty\"`\n\n\t// +optional\n\tV1alpha1 int64 `json:\"v1alpha1,omitempty\"`\n}\n\ntype CRD1Status struct {\n\t// +optional\n\tPhase int64 `json:\"phase,omitempty\"`\n}\n\n// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\ntype CRD1List struct {\n\tmetav1.TypeMeta `json:\",inline\"`\n\tmetav1.ListMeta `json:\"metadata\"`\n\n\tItems []CRD1 `json:\"items\"`\n}\n```\n\n2. example [define crd2 custom resource](./pkg/apis/example/v1alpha1/crd2_types.go)\n\n```\n// +genclient\n// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\ntype CRD2 struct {\n\tmetav1.TypeMeta `json:\",inline\"`\n\t// +optional\n\tmetav1.ObjectMeta `json:\"metadata,omitempty\"`\n\t// +optional\n\tSpec CRD2Spec `json:\"spec,omitempty\"`\n\t// +optional\n\tStatus CRD2Status `json:\"status,omitempty\"`\n}\n\ntype CRD2Spec struct {\n\t// +optional\n\tGeneration int64 `json:\"generation,omitempty\"`\n\n\t// +optional\n\tV1alpha1 int64 `json:\"v1alpha1,omitempty\"`\n}\n\ntype CRD2Status struct {\n\t// +optional\n\tPhase int64 `json:\"phase,omitempty\"`\n}\n\n// +k8s:deepcopy-gen:interfaces=k8s.io/apimachinery/pkg/runtime.Object\ntype CRD2List struct {\n\tmetav1.TypeMeta `json:\",inline\"`\n\tmetav1.ListMeta `json:\"metadata\"`\n\n\tItems []CRD2 `json:\"items\"`\n}\n```\n\n### Create Custom Resource\n\n1. example [create custom resource](./deploy/crds/crs.yaml):\n\n```\napiVersion: example.dev/v1alpha1\nkind: CRD1\nmetadata:\n  name: test-crd1\nspec:\n  v1alpha1: 1\n\n---\n\napiVersion: example.dev/v1alpha1\nkind: CRD2\nmetadata:\n  name: test-crd2\nspec:\n  v1alpha1: 2\n```\n\n2. create in kubernetes\n\n```\n$ kubectl apply -f deploy/crds/crs.yaml\n```\n\n3. kubernetes crd controller logs\n\n```\n{\"level\":\"info\",\"ts\":1578450836.597406,\"logger\":\"fallback\",\"caller\":\"crd1/controller.go:25\",\"msg\":\"CRD1 Controller Started\"}\n{\"level\":\"info\",\"ts\":1578450836.5974965,\"logger\":\"fallback\",\"caller\":\"crd2/controller.go:27\",\"msg\":\"CRD2 Controller Started\"}\n{\"level\":\"info\",\"ts\":1578450836.5975108,\"logger\":\"fallback\",\"caller\":\"sharemain/main.go:50\",\"msg\":\"Starting informers.\"}\n{\"level\":\"info\",\"ts\":1578450836.7009065,\"logger\":\"fallback\",\"caller\":\"sharemain/main.go:56\",\"msg\":\"Starting controllers.\"}\n{\"level\":\"info\",\"ts\":1578450836.7011466,\"logger\":\"fallback\",\"caller\":\"controller/controller.go:282\",\"msg\":\"Starting controller and workers\"}\n{\"level\":\"info\",\"ts\":1578450836.7011998,\"logger\":\"fallback\",\"caller\":\"controller/controller.go:292\",\"msg\":\"Started workers\"}\n{\"level\":\"info\",\"ts\":1578450836.7011847,\"logger\":\"fallback\",\"caller\":\"controller/controller.go:282\",\"msg\":\"Starting controller and workers\"}\n{\"level\":\"info\",\"ts\":1578450836.7013545,\"logger\":\"fallback\",\"caller\":\"controller/controller.go:292\",\"msg\":\"Started workers\"}\n{\"level\":\"info\",\"ts\":1578450872.271796,\"logger\":\"fallback\",\"caller\":\"crd1/crd1.go:36\",\"msg\":\"Reconcile CRD1 Resource \u0026{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:test-crd1 GenerateName: Namespace:default SelfLink:/apis/example.dev/v1alpha1/namespaces/default/crd1s/test-crd1 UID:7f085e03-d75f-4821-a967-775188e23e0d ResourceVersion:26823628 Generation:1 CreationTimestamp:2020-01-08 02:34:32 +0000 UTC DeletionTimestamp:\u003cnil\u003e DeletionGracePeriodSeconds:\u003cnil\u003e Labels:map[] Annotations:map[kubectl.kubernetes.io/last-applied-configuration:{\\\"apiVersion\\\":\\\"example.dev/v1alpha1\\\",\\\"kind\\\":\\\"CRD1\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"test-crd1\\\",\\\"namespace\\\":\\\"default\\\"},\\\"spec\\\":{\\\"v1alpha1\\\":1}}\\n] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[]} Spec:{Generation:0 V1alpha1:1} Status:{Phase:0}}\",\"traceid\":\"b721879e-2518-465a-aedc-8efb57fe21d8\",\"key\":\"default/test-crd1\"}\n{\"level\":\"info\",\"ts\":1578450872.2721462,\"logger\":\"fallback\",\"caller\":\"controller/controller.go:338\",\"msg\":\"Reconcile succeeded. Time taken: 652.085µs.\",\"traceid\":\"b721879e-2518-465a-aedc-8efb57fe21d8\",\"key\":\"default/test-crd1\"}\n{\"level\":\"info\",\"ts\":1578450872.2769606,\"logger\":\"fallback\",\"caller\":\"crd2/crd2.go:36\",\"msg\":\"Reconcile CRD2 Resource \u0026{TypeMeta:{Kind: APIVersion:} ObjectMeta:{Name:test-crd2 GenerateName: Namespace:default SelfLink:/apis/example.dev/v1alpha1/namespaces/default/crd2s/test-crd2 UID:2982e467-14d8-4147-9922-e6509f427aea ResourceVersion:26823629 Generation:1 CreationTimestamp:2020-01-08 02:34:32 +0000 UTC DeletionTimestamp:\u003cnil\u003e DeletionGracePeriodSeconds:\u003cnil\u003e Labels:map[] Annotations:map[kubectl.kubernetes.io/last-applied-configuration:{\\\"apiVersion\\\":\\\"example.dev/v1alpha1\\\",\\\"kind\\\":\\\"CRD2\\\",\\\"metadata\\\":{\\\"annotations\\\":{},\\\"name\\\":\\\"test-crd2\\\",\\\"namespace\\\":\\\"default\\\"},\\\"spec\\\":{\\\"v1alpha1\\\":2}}\\n] OwnerReferences:[] Finalizers:[] ClusterName: ManagedFields:[]} Spec:{Generation:0 V1alpha1:2} Status:{Phase:0}}\",\"traceid\":\"f4dbd50f-bd97-45b8-80c1-c36d4ef6f890\",\"key\":\"default/test-crd2\"}\n{\"level\":\"info\",\"ts\":1578450872.2770426,\"logger\":\"fallback\",\"caller\":\"controller/controller.go:338\",\"msg\":\"Reconcile succeeded. Time taken: 246.213µs.\",\"traceid\":\"f4dbd50f-bd97-45b8-80c1-c36d4ef6f890\",\"key\":\"default/test-crd2\"}\n```\n\n## Generate Custom Resource SDK\n\n```\n$ make generate\n```\n\n## Generate Image\n\n```\n$ make image\n```\n\n## Push Image\n\n```\n$ make push\n```\n\n## Generate Project Vendor\n\n```\n$ make vendor\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky-big%2Fkubernetes-crd-controller","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsky-big%2Fkubernetes-crd-controller","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsky-big%2Fkubernetes-crd-controller/lists"}