sample-controller VS kubebuilder

Compare sample-controller vs kubebuilder and see what are their differences.

sample-controller

Repository for sample controller. Complements sample-apiserver (by kubernetes)

kubebuilder

Kubebuilder - SDK for building Kubernetes APIs using CRDs (by kubernetes-sigs)
Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
sample-controller kubebuilder
7 45
3,022 7,407
1.6% 2.1%
0.0 9.3
3 days ago 1 day ago
Go Go
Apache License 2.0 Apache License 2.0
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.

sample-controller

Posts with mentions or reviews of sample-controller. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2022-11-25.
  • Is there a tutorial on how to write an Operator in Go?
    4 projects | /r/kubernetes | 25 Nov 2022
    - Sample controller: https://github.com/kubernetes/sample-controller
  • Writing an Operator from scratch
    7 projects | /r/kubernetes | 5 Nov 2022
    The most low-level approach I have seen is using the client-go package. Both kubebuilder and controller-runtime are based on this package. You can see an official example here: https://github.com/kubernetes/sample-controller/blob/master/docs/controller-client-go.md But even that sample requires some code generation on top of it https://cloud.redhat.com/blog/kubernetes-deep-dive-code-generation-customresources
  • Container in cluster which can control cluster
    1 project | /r/kubernetes | 21 Dec 2021
    I would still recommend gitOps tools or if you want to create your own abstraction (CRD) that encapsulates whatever behaviour you want to watch/act upon, take a look into kubernetes sample controller (https://github.com/kubernetes/sample-controller) or the kubernetes operator pattern https://kubernetes.io/docs/concepts/extend-kubernetes/operator/
  • Anybody use both kubebuilder and operator-sdk to create controllers/operators?
    1 project | /r/kubernetes | 20 Dec 2021
    Either should be fine. In case though you want something more basic then consider sample-controller: https://github.com/kubernetes/sample-controller
  • How to get to the next Level in Kubernetes?
    3 projects | /r/kubernetes | 31 Aug 2021
    As far as Operator development goes, if you are comfortable with golang then I would recommend checking out sample-controller https://github.com/kubernetes/sample-controller It does not abstract the underlying client-go machinery and so provides a good way to understand how various parts of an Operator come together. On the other hand, if you don't want to get exposed to that much details then either Operator SDK or Kubebuilder will be good options. In case you are not into golang then there are SDKs for other languages as well (Python, Java, etc.).
  • Opensource K8s operator developed in Go to contribute
    4 projects | /r/kubernetes | 18 Jun 2021
    Cool! Given that you mention you are a beginner in K8s operator development, here is a plan that I would like to suggest. 1. Get basic understanding of Kubernetes custom controllers first. The sample controller repo is a good place to start. https://github.com/kubernetes/sample-controller
  • How to start combining kubernetes and go knowledge
    5 projects | /r/kubernetes | 17 Mar 2021
    the sample controller using client-go to learn about informers: https://github.com/kubernetes/sample-controller

kubebuilder

Posts with mentions or reviews of kubebuilder. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2024-03-14.
  • SpinKube: Orchestrating light, fast and efficient WebAssembly (Wasm) workloads in Kubernetes (k8s)
    5 projects | dev.to | 14 Mar 2024
    The Spin operator uses the Kubebuilder framework and contains a Spin App Custom Resource Definition (CRD) and controller. It watches Spin App Custom Resources and realizes the desired state in the K8s cluster. Aside from the immediate benefits gained by running Wasm workloads in k8s, additional optimizations such as Horizontal Pod Scaling (HPA) and k8s Event-driven Autoscaling (KEDA) can be achieved in a pinch.
  • Building a Kubernetes Operator with the Operator Framework
    10 projects | dev.to | 7 Jan 2024
    kubebuilder: brew install kubebuilder
  • Annotations in Kubernetes Operator Design
    4 projects | dev.to | 26 Nov 2023
    The operator that I've been working on is designed to manage the full lifecycle of a QuestDB database instance, including version and hardware upgrades, config changes, backups, and (eventually) recovery from node failure. I used the Operator SDK and kubebuilder frameworks to provide scaffolding and API support.
  • Kubebuilder Tips and Tricks
    2 projects | dev.to | 22 Aug 2023
    Recently, I've been spending a lot of time writing a Kubernetes operator using the go operator-sdk, which is built on top of the Kubebuilder framework. This is a list of a few tips and tricks that I've compiled over the past few months working with these frameworks.
  • We moved our Cloud operations to a Kubernetes Operator
    3 projects | dev.to | 15 Aug 2023
    Since we built our operator using the Kubebuilder framework, most standard monitoring tasks were handled for us out-of-the-box. Our operator automatically exposes a rich set of Prometheus metrics that measure reconciliation performance, the number of k8s API calls, workqueue statistics, and memory-related metrics. We we were able to ingest these metrics into pre-built dashboards by leveraging the grafana/v1-alpha plugin, which scaffolds two Grafana dashboards to monitor Operator resource usage and performance. All we had to do was add these to our existing Grafana manifests and we were good to go!
  • Has anyone ever tried to learn how k8s works?
    4 projects | /r/golang | 11 Jul 2023
    I wrote a CSI driver and some operators. I admire K8s, because you can find solution to almost any problem in the source code - API versioning, load balancing, request throttling, optimistic concurrency, security, and much much more. I recommend https://book.kubebuilder.io/ It is similar to Operator SDK, but without Openshift-specific stuff. It gradually introduces you to many k8s concepts, and follows design patterns that k8s uses internally.
  • What Is A Kubernetes Operator?
    3 projects | dev.to | 7 Jul 2023
  • If you write a Kubernetes Operator: Events vs Conditions?
    1 project | /r/kubernetes | 5 Jun 2023
    Do you mean this: https://book.kubebuilder.io/ ?
  • Kubernetes Operators
    1 project | /r/kubernetes | 27 Mar 2023
    https://book.kubebuilder.io/ all you need to know
  • Writing a Kubernetes Operator
    11 projects | news.ycombinator.com | 9 Mar 2023
    A better way to write an operator these days is to use kubebuilder [1].

    My complaint is that I have seen orgs write operators for random stuff, often reinventing the wheel. Lot of operators in orgs are result of resume driven development. Having said that it often comes handy for complex orchestration.

    [1]https://github.com/kubernetes-sigs/kubebuilder

What are some alternatives?

When comparing sample-controller and kubebuilder you can also consider the following projects:

percona-xtradb-cluster-operator - Percona Operator for MySQL based on Percona XtraDB Cluster

helm-operator - Successor: https://github.com/fluxcd/helm-controller — The Flux Helm Operator, once upon a time a solution for declarative Helming.

kubeplus - Kubernetes Operator to create multi-instance SaaS from Helm charts using Kubernetes-native APIs

client-go - Go client for Kubernetes.

percona-server-mongodb-operator - Percona Operator for MongoDB

operator-sdk - SDK for building Kubernetes applications. Provides high level APIs, useful abstractions, and project scaffolding.

controller-runtime - Repo for the controller-runtime subproject of kubebuilder (sig-apimachinery)

crossplane - The Cloud Native Control Plane

metacontroller - Writing kubernetes controllers can be simple

kubegres - Kubegres is a Kubernetes operator allowing to deploy one or many clusters of PostgreSql instances and manage databases replication, failover and backup.

python - Official Python client library for kubernetes

spark-operator - Kubernetes operator for managing the lifecycle of Apache Spark applications on Kubernetes.