# kubernetes/sample-controller

Repository for sample controller. Complements sample-apiserver

Repository: https://github.com/kubernetes/sample-controller
Canonical: https://ross.abutalabs.com/products/sample-controller
Language: Go
License: Apache-2.0
License Family: permissive
Topics: k8s-staging
Last push: 2026-08-26T22:41:45+00:00

## Health v2 (maintenance only)
Score: 77/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 99, release rhythm 35, longevity 100
- inputs: {"age_days": 3240, "days_push": 7, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 3502, forks 1217 (observed 2026-08-28T04:08:07.571493+00:00)

## What it is
An official Kubernetes sample project demonstrating how to build a controller that watches and reconciles a custom resource type (Foo) defined via a CRD. It shows how to use client-go and code-generator to create typed clients, informers, and listers.

## Use cases
- learn how to write a kubernetes controller
- example of watching custom resources with client-go
- how to set up informers and listers for a CRD
- generate typed clients with kubernetes code-generator
- build a kube-style controller for a single resource type

## When to choose
- you are learning controller development patterns for Kubernetes
- you need a reference implementation for a CRD-based controller
- you want to see how client-go cache/informer machinery fits together

## When to avoid
- you need a production-ready controller framework (use controller-runtime/kubebuilder instead)
- you want a runnable application rather than example code
- you need direct contribution - this is a read-only staging mirror

## Facets
- artifact type: learning-resource
- maturity: active
- function: developer-tools, documentation
- domain: developer-tools, infrastructure-as-code
- platform: go, cross-platform
- tags: kubernetes, controller, crd, client-go, sample-code, code-generation, containers

## Member repositories
- kubernetes/sample-controller (main) score 77

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:07.571493+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:35:47.642756+00:00, confidence not recorded.
  - readme: https://github.com/kubernetes/sample-controller (fetched 2026-08-28T04:08:07.571493+00:00, sha 84ac3e97cce0)
- Data as of 2026-08-30T08:39:29.467469+00:00.
