{"id":13742404,"url":"https://github.com/paulczar/gcp-cloud-compute-operator","last_synced_at":"2025-06-12T05:08:14.774Z","repository":{"id":144202455,"uuid":"157909552","full_name":"paulczar/gcp-cloud-compute-operator","owner":"paulczar","description":"gcp operator for kubernetes","archived":false,"fork":false,"pushed_at":"2021-02-12T17:03:59.000Z","size":14028,"stargazers_count":30,"open_issues_count":1,"forks_count":9,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-12T05:08:13.866Z","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/paulczar.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}},"created_at":"2018-11-16T19:00:22.000Z","updated_at":"2025-05-25T19:01:18.000Z","dependencies_parsed_at":"2023-06-18T15:15:45.950Z","dependency_job_id":null,"html_url":"https://github.com/paulczar/gcp-cloud-compute-operator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paulczar/gcp-cloud-compute-operator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulczar%2Fgcp-cloud-compute-operator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulczar%2Fgcp-cloud-compute-operator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulczar%2Fgcp-cloud-compute-operator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulczar%2Fgcp-cloud-compute-operator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paulczar","download_url":"https://codeload.github.com/paulczar/gcp-cloud-compute-operator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paulczar%2Fgcp-cloud-compute-operator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259402147,"owners_count":22851878,"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-08-03T05:00:31.542Z","updated_at":"2025-06-12T05:08:14.753Z","avatar_url":"https://github.com/paulczar.png","language":"Go","funding_links":[],"categories":["Repository is obsolete","Go"],"sub_categories":["Awesome Operators in the Wild"],"readme":"# Google Cloud Platform Operator\n\nThis is a demo operator for the [Google Cloud Platform](https://cloud.google.com) which simplifies requesting google cloud resources in the form on Kubernetes Manifests.\n\nThe goal of the Operator is to provide a bare minimum set of Kubernetes CRDs to enable provisioning GCP services. To enable this the manifest Specs are generally a 1:1 mapping to the GCP API objects.\n\nCurrently supports creating and destroying the following GCP Services:\n\n\u003e Note: the Kubernetes resource spec for your requests should match the GCP Go SDK\nstructures.\n\n* [Compute](https://godoc.org/google.golang.org/api/compute/v1)\n  * [Addresses](https://godoc.org/google.golang.org/api/compute/v1#Address)\n  * [Images](https://godoc.org/google.golang.org/api/compute/v1#Image)\n  * [Firewalls](https://godoc.org/google.golang.org/api/compute/v1#Firewall)\n  * [Networks](https://godoc.org/google.golang.org/api/compute/v1#Network)\n  * [Subnetworks](https://godoc.org/google.golang.org/api/compute/v1#Subnetwork)\n  * [Forwarding Rules](https://godoc.org/google.golang.org/api/compute/v1#ForwardingRule)\n  * [Target Pools](https://godoc.org/google.golang.org/api/compute/v1#TargetPool)\n  * [Instances](https://godoc.org/google.golang.org/api/compute/v1#Instance)\n* [IAM](https://godoc.org/google.golang.org/api/iam/v1)\n  * [Service Accounts](https://godoc.org/google.golang.org/api/iam/v1#ServiceAccount)\n* [DNS](https://godoc.org/google.golang.org/api/dns/v1)\n  * [ManagedZone](https://godoc.org/google.golang.org/api/iam/v1/#ManagedZone)\n  * [RecordSet](https://godoc.org/google.golang.org/api/iam/v1/#RecordSet)\n\n\n## Add new gcp compute service\n\n```\nAPI=dns.google.golang.org/v1 KIND=Record\noperator-sdk add api --api-version=$API --kind=$KIND\noperator-sdk add controller --api-version=$API --kind=$KIND\n```\n\n## Annotations\n\nYou can set the following Annotations:\n\n| Annotation | Description |\n| ---------- | ----------- |\n| `compute.gce/project-id` | Sets the GCP Project ID if different to that used in operator service account |\n| `iam.gce/serviceAccountName` | Sets the service account name for service account keys |\n| `iam.gce/secretName` | Sets the secret name for service account keys |\n| `iam.gce/secretNamespace` | Sets the secret namespace for service account keys |\n\n\n## Example Usage\n\nCreate a namespace to run the operator in:\n\n```bash\nkubectl create namespace gcp-operator\n```\n\nCreate a secret containing your GCP account credentials:\n\n```bash\nkubectl -n gcp-operator create secret \\\n    generic gcp-operator \\\n  --from-file=google.json=/path/to/credentials.json\n```\n\nIf using GKE you need to ensure your user has the cluster admin role binding:\n\n```bash\nkubectl create clusterrolebinding cluster-admin-binding \\\n    --clusterrole=cluster-admin --user=\u003cyour gcp account email address\u003e\nclusterrolebinding.rbac.authorization.k8s.io/cluster-admin-binding created\n```\n\nDeploy the GCP Operator:\n\n```bash\nkubectl -n gcp-operator apply -f deploy/service_account.yaml\nkubectl -n gcp-operator apply -f deploy/role.yaml\nkubectl -n gcp-operator apply -f deploy/role_binding.yaml\nkubectl -n gcp-operator apply -f deploy/operator.yaml\n```\n\nDeploy the CRDs:\n```bash\nkubectl apply -f deploy/crds/compute_v1_address_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_firewall_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_forwardingrule_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_image_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_instance_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_network_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_subnetwork_crd.yaml\nkubectl apply -f deploy/crds/compute_v1_targetpool_crd.yaml\n```\n\n### Create GCP Address\n\nEdit `deploy/examples/address.yaml` replacing the project ID placeholders with your GCP project.\n\nOnce the GCP Operator is deployed you can create a GCP instance:\n\n```bash\nkubectl -n gcp-operator apply -f deploy/examples/address.yaml\n```\n\nAfter a few minutes check to see if the new instance exists:\n\n```bash\ngcloud compute addresses list\nNAME                   REGION       ADDRESS          STATUS\nexample                us-central1  35.226.61.203    RESERVED\n\n```\n\n### Create GCP Instance\n\nOnce the GCP Operator is deployed you can create a GCP instance:\n\n\u003e Note: you'll need to edit this file first\n\n```bash\nkubectl -n gcp-operator apply -f deploy/examples/instance.yaml\n```\n\nAfter a few minutes check to see if the new instance exists:\n\n```bash\ngcloud compute instances list\nNAME                                     ZONE           MACHINE_TYPE               PREEMPTIBLE  INTERNAL_IP  EXTERNAL_IP     STATUS\ntest                                     us-central1-a  custom (2 vCPU, 4.00 GiB)               10.128.0.2                   RUNNING\n```\n\nCleanup:\n\n```\nkubectl delete -f deploy\nkubectl delete -f deploy/crds\nkubectl delete -f deploy/examples\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulczar%2Fgcp-cloud-compute-operator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaulczar%2Fgcp-cloud-compute-operator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaulczar%2Fgcp-cloud-compute-operator/lists"}