Katib
Basic information
Section titled “Basic information”| Item | Value |
|---|---|
| Version | Katib v0.19.0 |
| Official docs | Kubeflow Katib |
| Upstream source | applications/katib/upstream |
| Dev overlay | overlays/dev/kubeflow/overlays/katib |
Concepts and features
Section titled “Concepts and features”Katib is not a component that provides training code itself. It is the HPO control plane that explores parameter combinations and runs the training workload for each combination as a Trial. A user creates an Experiment in a Profile namespace and declares the objective metric, the parameter ranges, the trial template, and the algorithm. The Katib controller reconciles the Experiment to create a Suggestion resource and an algorithm Pod, and for each proposed parameter set it creates a Trial resource and a Job or Kubeflow training resource.

When the Trial workload records metrics to stdout, a file, or TensorFlow events, the Katib metrics collector collects them. The objective metric collected by the collector is stored in the katib logical database of the shared MySQL through the Katib database manager, and the controller uses the results to request the next parameter proposal or to complete the Experiment. The declarations and status of Experiment, Trial, and Suggestion are managed as Kubernetes CRs, and the database is used for metric observations and Katib internal persistence.
Core resources
Section titled “Core resources”| Resource | API | Role |
|---|---|---|
Experiment | kubeflow.org/v1beta1 | Declares the HPO goal, parameter space, algorithm, Trial template, and maximum Trial count. |
Trial | kubeflow.org/v1beta1 | Represents one parameter combination, its execution status, and its metric results. |
Suggestion | kubeflow.org/v1beta1 | Delivers the next parameter combinations generated by the algorithm Pod to the controller. |
| Trial workload | batch/v1 Job or training CR | Runs the actual training. Only resources allowed in KatibConfig are used. |
Experiment, Trial, and Suggestion are namespace-scoped CRDs. The user’s HPO definitions and Trial workloads therefore live in the Profile namespace that created the Experiment, not in kubeflow, the control plane namespace.
What the component establishes
Section titled “What the component establishes”- HPO control plane:
katib-controllerreconciles Experiment, Trial, and Suggestion and manages the Trial lifecycle. - Algorithm runtime: random, TPE, grid, Hyperband, Bayesian optimization, CMA-ES, Sobol, ENAS, DARTS, and PBT suggestion images are provided through
katib-config. - Metric collection: a Pod mutating webhook that targets a namespace label injects the collector sidecar.
- Result persistence:
katib-db-managerrecords Experiment and Trial results in thekatiblogical database. - Dashboard UI:
katib-uishows Experiment and Trial status on the/katib/route and checks requests with Kubernetes RBAC. - Admission protection: the Experiment validate/default webhooks and the metrics collector injection webhook are provided on a certificate basis.
Role in Kubeflow
Section titled “Role in Kubeflow”If Notebooks and Pipelines define training code and data flow, Katib explores the parameter combinations used for repeated training. For example, if learning rate, batch size, and optimizer momentum are declared as the search space, Katib creates several Trials and returns the best objective metric, without requiring the user to hand-author every run.
- Profile namespace isolation: Experiments and Trials are created in the requesting user’s namespace and do not mix with the HPO results or workloads of other Profiles.
- Workload type choice: besides the default
Job,TFJob,PyTorchJob,MPIJob,XGBoostJob, and TrainerTrainJobcan be used as the Trial template. The actual allowed list is determined bytrialResourcesinkatib-config. - Automated metric collection: the Profile controller gives the namespace the
katib.kubeflow.org/metrics-collector-injection=enabledlabel. Every Pod CREATE request in a namespace with this label goes through Katib mutating webhook admission, and the metrics collector settings are applied to Pods that match Katib Trial metadata. - Dashboard integration: the
/katib/route on the Kubeflow gateway connects tokatib-ui. The UI backend checks the user’s namespace permissions with SubjectAccessReview. - Training component integration: Katib only creates Trial resources and workloads and does not perform model serving or Model Registry registration. Training finalized with the best parameters and model registration are done separately in the Pipeline, Trainer, and Model Registry flows.
Deployment structure
Section titled “Deployment structure”Overlay layout
Section titled “Overlay layout”The dev overlay references the upstream katib-with-kubeflow variant. This variant includes the Katib control plane, the cert-manager webhook certificate, the Istio UI route and AuthorizationPolicy, and the Kubeflow UI RBAC patch.
overlays/dev/kubeflow/overlays/katib -> applications/katib/upstream/installs/katib-with-kubeflow -> katib-cert-manager -> controller / CRD / db-manager / mysql / UI / webhook -> kubeflow Katib roles -> katib-ui VirtualService + AuthorizationPolicy
overlay patch -> upstream katib-mysql Deployment / PVC / default Secret 제거 -> katib-mysql Service -> ps-db-haproxy.mysql.svc.cluster.local -> katib-db-manager -> mysql / katib database / local credential SecretKatib’s control plane Deployments are placed in the kubeflow namespace. katib-controller and katib-db-manager disable Istio sidecar injection, as in upstream. katib-ui, on the other hand, gets the Istio sidecar injected and allows only traffic from the gateway through an AuthorizationPolicy.
Shared MySQL connection contract
Section titled “Shared MySQL connection contract”Katib does not use its own database Deployment. It keeps the upstream resource name katib-mysql Service as a namespace-local ExternalName alias and connects it to the shared Percona MySQL HAProxy writer endpoint.
| Item | Current value | Meaning |
|---|---|---|
| Database driver | mysql | Database engine of katib-db-manager |
| Logical database | katib | Metric observations and Katib internal persistence |
| Alias Service | katib-mysql | Namespace-local hostname referenced by katib-db-manager |
| Real endpoint | ps-db-haproxy.mysql.svc.cluster.local:3306 | Shared Percona MySQL writer |
| Credential Secret | katib-mysql-secrets | Local-only Secret that provides DB_USER and DB_PASSWORD |
The actual values of katib-mysql-secrets are not included in the overlay. katib-db-manager reads both DB_USER and DB_PASSWORD from this Secret. The upstream default Secret, the in-cluster katib-mysql Deployment, and the PVC are all removed from the build output. Database creation, application role, grants, backup, and failover follow the platform contract in Shared data services (MySQL and Object Storage).
The Katib application role must be granted only the katib database. It does not share privileges on KFP’s mlpipeline, cachedb, and metadb or on Model Registry’s model_registry.
Controller, suggestion, and Trial flow
Section titled “Controller, suggestion, and Trial flow”katib-controller watches Experiments and reads the objective and algorithm settings. When the controller creates a Suggestion resource, the algorithm Pod generates parameter combinations. Based on that result, the controller creates a Trial and a workload based on the user-provided trial template in the corresponding Profile namespace.
Because the Profile namespace has the metrics collector injection label, every Pod CREATE request in that namespace goes through the Katib mutating webhook. The collector settings are applied to workload Pods that match Katib Trial metadata, and the collector sends the objective metric to the database manager API. The controller asks the algorithm for the next Suggestion based on the stored observations, and ends the Experiment when maxTrialCount, the number of successful Trials, or the objective condition is met.
katib-config is a ConfigMap mounted into the controller that defines the supported Trial resources, the collector image, the suggestion images, and the early stopping images. The PBT algorithm is defined to request a ReadWriteMany PVC for persistent state, so the cluster must have an RWX storage class when that algorithm is used. If the cluster has no RWX-capable StorageClass, PBT will not work correctly even if Katib itself is healthy.
Webhooks and certificates
Section titled “Webhooks and certificates”Katib provides a cluster-scoped ValidatingWebhookConfiguration and MutatingWebhookConfiguration.
| Webhook | Target | Role |
|---|---|---|
validator.experiment.katib.kubeflow.org | Experiment CREATE, UPDATE | Validates the search space, objective, and Trial template settings. |
defaulter.experiment.katib.kubeflow.org | Experiment CREATE, UPDATE | Fills in default values. |
mutator.pod.katib.kubeflow.org | Pod CREATE in labeled namespaces | Injects the metrics collector sidecar. |
All webhooks call the TLS endpoint of the katib-controller.kubeflow Service. cert-manager creates the katib-webhook-cert Certificate and Secret, and fills the webhook caBundle through the CA injection annotation. If an Experiment or Trial Pod is created before the certificate or controller readiness is in place, admission requests can fail, so control plane health must be checked first. In other words, cert-manager health is not optional: a broken certificate, controller readiness, or CA bundle injection can fail admission before any search even begins.
Deployment view
Section titled “Deployment view”Resource Placement
Section titled “Resource Placement”| Namespace | Resource | Name | Purpose |
|---|---|---|---|
kubeflow | Deployment + Service | katib-controller | HPO reconcile, webhook, Prometheus metrics endpoint |
kubeflow | Deployment + Service | katib-db-manager | Katib database API and MySQL persistence |
kubeflow | ExternalName Service | katib-mysql | Shared Percona MySQL writer alias |
kubeflow | Deployment + Service | katib-ui | /katib/ UI and user RBAC checks |
kubeflow | ConfigMap | katib-config, trial-templates | Supported Trial resources, algorithms, collector, and default templates |
kubeflow | Certificate + Secret | katib-webhook-cert | Controller webhook TLS certificate |
kubeflow | VirtualService + AuthorizationPolicy | katib-ui | Gateway route and UI inbound access control |
| cluster | CRD | experiments.kubeflow.org, trials.kubeflow.org, suggestions.kubeflow.org | HPO declaration and status API |
| cluster | webhook configuration | katib.kubeflow.org | Experiment validation/defaulting and metrics collector injection |
| Profile namespace | Experiment, Trial, Suggestion | Created dynamically per user | Parameter search, Trial status, suggestion results |
| Profile namespace | Job or training resource Pod | Created dynamically per Trial | Actual training and metric output |
mysql | Percona MySQL Cluster + Service | ps-db, ps-db-haproxy | Provides the katib logical database |
Diagram
Section titled “Diagram”PlantUML source:
Request flow
Section titled “Request flow”From Experiment to selecting the best parameters
Section titled “From Experiment to selecting the best parameters”- A user creates an Experiment in a Profile namespace through the Dashboard UI, the SDK, or
kubectl. - The Kubernetes API server calls the Experiment validating/defaulting webhook on
katib-controller. - The controller reconciles the Experiment and creates a Suggestion for which the algorithm Pod provides parameter combinations.
- Based on the Suggestion, the controller creates a Trial and the Job or training resource from the trial template in the same namespace.
- The CREATE request for the Trial Pod goes through Katib Pod mutating webhook admission, and the metrics collector settings are applied if it matches the Trial metadata. The trial emits metrics to stdout, a file, or TensorFlow event format.
- The collector sends the objective metric to the database manager, and the manager records it in the
katibdatabase of the shared MySQL. - The controller creates the next Trial based on the observations, or records the best result in the Experiment status when the goal and Trial count conditions are met.
PlantUML source:
Dependencies and interactions
Section titled “Dependencies and interactions”Prerequisites / downstream
Section titled “Prerequisites / downstream”- Prerequisite: cert-manager and
katib-webhook-certmust be Ready for Experiment and Trial Pod admission to work. - Prerequisite: the shared Percona MySQL writer endpoint, the
katibdatabase, the Katib application role, andkatib-mysql-secretsmust be Ready forkatib-db-managerto start. - Prerequisite: the Profile controller must prepare the namespace label and Kubeflow RBAC for multi-user metrics collection and per-user Experiment access.
- Downstream: to use Trainer’s
TrainJobas a Trial template, the Trainer CRDs and controller must be ready first.
Runtime interactions
Section titled “Runtime interactions”kubeflow-gatewayand thekatib-uiAuthorizationPolicy protect/katib/UI traffic.- The Kubernetes API server calls the controller’s TLS webhook endpoint for Experiment and Pod admission.
- Only
katib-db-managerconnects to the shared MySQL through thekatib-mysqlalias. The controller and UI do not connect to the database directly. - The Trial template determines the image, ServiceAccount, Secret, PVC, and GPU resources. Katib does not automatically synchronize these with Notebook or Pipeline settings. Notebook, Pipeline, storage, dataset access, GPU quota, Secrets, and PVC mounting are all outside Katib’s control and must be defined in the trial template or namespace policy.
Core resources
Section titled “Core resources”katib-config: defines the allowed Trial resources, metrics collector, suggestion, and early stopping images.trial-templates: provides example default Job-based Trial templates. An actual Experiment can declare its own template.katib-webhook-cert: provides the TLS certificate for the Experiment validation/defaulting and Pod mutation webhooks.katib-mysql: an ExternalName Service that keeps the application hostname while pointing to the shared Percona MySQL writer endpoint.katib-mysql-secrets: a namespace-local Secret that providesDB_USERandDB_PASSWORDtokatib-db-manager.
Operational boundary and verification criteria
Section titled “Operational boundary and verification criteria”The Katib control plane manages the Experiment and Trial lifecycle, but the Trial container image, dataset access, GPU quota, network access, and output model registration are determined by the Experiment’s trial template and the Profile namespace policy. In particular, a Trial does not automatically receive SeaweedFS artifact credentials or Notebook PVCs. The required Secrets, ServiceAccount, and volume mounts must be specified in the Trial template. Katib manages the experiment lifecycle, not the full environment lifecycle, and it does not synchronize serving registration.
After switching to shared MySQL, verify the following lifecycle on the actual cluster.
- Experiment creation and webhook defaulting/validation succeed in a Profile namespace.
- The algorithm Pod creates Suggestions, and a Trial Job or TrainJob is created.
- The metrics collector is injected into the Trial Pod, and the objective metric is recorded in the
katibdatabase. - The Experiment and Trial can be viewed in the Katib UI with that user’s permissions.
- Previous Experiment and Trial results are preserved even after
katib-db-managerand the MySQL Pod are restarted. - If PBT is used, RWX PVC provisioning and the algorithm Pod mount succeed.
Katib is the HPO search layer for Kubeflow, not the training engine itself. In this repository it is wired for multi-user namespaces, shared MySQL persistence, webhook-based validation and metric collection, and Dashboard access. When it is healthy, users can express search intent declaratively and let Katib drive repeated training workloads until the best result emerges.
References
Section titled “References”- overlay:
overlays/dev/kubeflow/overlays/katib - database: Shared data services (MySQL and Object Storage)
- Multi-user namespaces and RBAC: User Profile
- Dashboard route and Profile namespace label: Dashboard