3.2 KiB
3.2 KiB
Zastava CLI Commands
Module
Cli
Status
IMPLEMENTED
Description
Zastava CLI commands backed by dedicated Zastava module with agent, observer, and webhook components for Kubernetes admission controller management. Provides install, configure, status, logs, and uninstall operations for the admission webhook.
Implementation Details
- Command Group:
src/Cli/StellaOps.Cli/Commands/ZastavaCommandGroup.cs--ZastavaCommandGroup(static class)- Sprint: SPRINT_20260117_020_CLI_zastava_webhooks (ZAS-001 through ZAS-005)
- Backend Module:
src/Zastava/-- Zastava Kubernetes admission controller - DTOs:
ZastavaConfig(Namespace, Policy, AllowedRegistries, BlockUnsigned, BlockCritical),ZastavaStatus(Namespace, WebhookRegistered, WebhookMode, PodStatus, Replicas, CertificateExpires, Statistics),AdmissionStats(TotalRequests, Allowed, Denied, Errors, Since) - Commands:
stella zastava install [--namespace <ns>] [--mode validating|mutating|both] [--output <path>] [--apply] [--dry-run]-- install admission webhook with manifest generation. Generates: Namespace, ServiceAccount, RBAC, TLS Certificate Secret, Deployment, Service, WebhookConfigurationstella zastava configure [--policy <id>] [--allow-registries <list>] [--block-unsigned] [--block-critical] [--namespace <ns>] [--format text|json]-- configure enforcement rules persisted to ConfigMapstella zastava status [--namespace <ns>] [--format table|json]-- show webhook status including registration, pod status, replicas, certificate expiry, and admission statistics (total/allowed/denied/errors)stella zastava logs [--follow] [--since <duration>] [--decision allowed|denied|error] [--image <pattern>] [--namespace <ns>]-- show webhook admission logs with streaming and filteringstella zastava uninstall --confirm [--namespace <ns>] [--remove-secrets]-- remove webhook (requires confirmation); optionally removes TLS secrets
E2E Test Plan
- Run
stella zastava install --dry-runand verify manifest preview without cluster changes - Run
stella zastava install --namespace test-ns --mode validating --applyand verify all resources created - Run
stella zastava install --mode mutating --output ./manifestsand verify manifest files written - Run
stella zastava configure --policy prod-policy --block-unsigned --block-criticaland verify configuration update - Run
stella zastava configure --allow-registries ghcr.io,registry.example.com --format jsonand verify JSON config - Run
stella zastava statusand verify table with Webhook Registered, Mode, Pod Status, Replicas, Certificate Expires - Run
stella zastava status --format jsonand verify JSON with admission statistics - Run
stella zastava logs --decision deniedand verify only denied admission logs shown - Run
stella zastava logs --image "docker.io/*" --since 1hand verify image and time filtering - Run
stella zastava logs --followand verify streaming mode indicator - Run
stella zastava uninstallwithout--confirmand verify error requiring confirmation - Run
stella zastava uninstall --confirm --remove-secretsand verify all resources plus TLS secrets removed