CLI Reference
Overview

Kubernetes Operator

When running SchemaHero as a Kubernetes operator, you can use kubectl schemahero commands to interact with the operator and manage schema migrations.

Prerequisites

  • SchemaHero operator installed in your cluster (see install)
  • kubectl configured to access your cluster
  • kubectl-schemahero plugin installed

Available Commands

CommandDescription
installInstall the SchemaHero operator
get tablesList tables managed by SchemaHero
get migrationsList pending and applied migrations
describe migrationShow details of a specific migration
approve migrationApprove a pending migration
reject migrationReject a pending migration
shellOpen a database shell

Workflow

The Kubernetes operator workflow differs from the CLI workflow:

  1. Deploy Table resources - Apply Table manifests to your cluster
  2. Review migrations - The operator generates Migration resources
  3. Approve or reject - Use kubectl schemahero approve or reject
  4. Operator applies - Approved migrations are executed automatically

For most use cases, we recommend the CLI workflow with schemahero plan and schemahero apply for simpler, more predictable deployments.