{"id":16367633,"url":"https://github.com/mmontes11/echoperator","last_synced_at":"2025-03-21T01:31:09.067Z","repository":{"id":38978604,"uuid":"385345468","full_name":"mmontes11/echoperator","owner":"mmontes11","description":"🤖 Simple Kubernetes operator built from scratch with client-go","archived":false,"fork":false,"pushed_at":"2023-03-16T18:18:02.000Z","size":103,"stargazers_count":42,"open_issues_count":0,"forks_count":8,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-12T02:50:29.073Z","etag":null,"topics":["client-go","crd","custom-resource-definition","go","golang","high-availability","kubernetes","kubernetes-operator","leader-election","operator"],"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/mmontes11.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":"2021-07-12T18:28:05.000Z","updated_at":"2024-07-10T06:01:50.000Z","dependencies_parsed_at":"2024-06-19T00:19:50.550Z","dependency_job_id":"6660e940-b8df-45e8-ae19-ce0ee3bc2bc5","html_url":"https://github.com/mmontes11/echoperator","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fechoperator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fechoperator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fechoperator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mmontes11%2Fechoperator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mmontes11","download_url":"https://codeload.github.com/mmontes11/echoperator/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221810749,"owners_count":16884186,"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":["client-go","crd","custom-resource-definition","go","golang","high-availability","kubernetes","kubernetes-operator","leader-election","operator"],"created_at":"2024-10-11T02:50:26.478Z","updated_at":"2024-10-28T08:59:41.398Z","avatar_url":"https://github.com/mmontes11.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🤖 echoperator \n\n[![CI](https://github.com/mmontes11/echoperator/actions/workflows/ci.yml/badge.svg)](https://github.com/mmontes11/echoperator/actions/workflows/ci.yml)\n[![Release](https://github.com/mmontes11/echoperator/actions/workflows/release.yml/badge.svg)](https://github.com/mmontes11/echoperator/actions/workflows/release.yml)\n[![Go Report Card](https://goreportcard.com/badge/github.com/mmontes11/echoperator)](https://goreportcard.com/report/github.com/mmontes11/echoperator)\n[![Go Reference](https://pkg.go.dev/badge/github.com/mmontes11/echoperator.svg)](https://pkg.go.dev/github.com/mmontes11/echoperator)\n[![Artifact HUB](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/echoperator)](https://artifacthub.io/packages/helm/mmontes/echoperator)\n[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nSimple Kubernetes operator built from scratch with [client-go](https://github.com/kubernetes/client-go).\n\n[Kubernetes operator pattern](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/) implementation using the [client-go](https://github.com/kubernetes/client-go) library. Altough there are a bunch of frameworks for doing this ([kubebuilder](https://book.kubebuilder.io/), [operator framework](https://operatorframework.io/) ...), this example operator uses the tools provided by [client-go](https://github.com/kubernetes/client-go) for simplicity and flexibility reasons. \n\n[Medium article](https://betterprogramming.pub/building-a-highly-available-kubernetes-operator-using-golang-fe4a44c395c2) that explains how to build this operator step by step.\n\n### Features\n\n- Simple example to understand how a Kubernetes operator works.\n- Manages [Echo CRDs](https://github.com/mmontes11/charts/blob/main/charts/echoperator/crds/echo.yml) for executing an `echo` inside a pod.\n- Manages [ScheduledEcho CRDs](https://github.com/mmontes11/charts/blob/main/charts/echoperator/crds/scheduledecho.yml) for scheduling the execution of an `echo` inside a pod.\n- High Availability operator using Kubernetes [lease](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.20/#lease-v1-coordination-k8s-io) objects.\n- Prometheus metrics.\n- [Helm chart](https://github.com/mmontes11/charts/tree/main/charts/echoperator).\n\n\n### Versioning \n\n|Echo|ScheduledEcho|Job|CronJob|Lease|Kubernetes|\n|----|-------------|---|-------|-----|----------|\n|v1alpha1|v1alpha1|v1|v1|v1|v1.21.x|\n\n### Installation\n\n```bash\nhelm repo add mmontes https://mmontes11.github.io/charts\nhelm install echoperator mmontes/echoperator\n```\n\n### Custom Resource Definitions (CRDs)\n\nThe helm chart installs automatically the [Custom Resource Definitions](https://kubernetes.io/docs/concepts/extend-kubernetes/api-extension/custom-resources/) needed for this operator to work. However, if you wanted to install them manually, you can find them in the [helm chart repo](https://github.com/mmontes11/charts/tree/main/charts/echoperator/crds).\n\n### Example use cases\n\n###### Hello world\n\n- Client creates a [hello world Echo CRD](./manifests/examples/hello-world.yml).\n- Operator receives a `Echo` added event.\n- Operator reads the `message` property from the `Echo` and creates a `Job` resource.\n- The `Job` resource creates a `Pod` that performs a `echo` command with the `message` property.\n\n###### Scheduled hello world\n\n- Client creates a [hello world ScheduledEcho CRD](./manifests/examples/hello-world-scheduled.yml).\n- Operator receives a `ScheduledEcho` added event.\n- Operator reads the `message` and `schedule` property from the `ScheduledEcho` and creates a `CronJob`.\n- The `CronJob` schedules a `Job` creation using the `schedule` property.\n- When scheduled, the `Job` resource creates a `Pod` that performs a `echo` command with the `message` property. \n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmontes11%2Fechoperator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmmontes11%2Fechoperator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmmontes11%2Fechoperator/lists"}