Skip to main content

CLI Reference

This document provides a complete reference for Stratos controller command-line flags.

Controller Flags

Core Flags

FlagTypeDefaultDescription
--cluster-namestringdefaultKubernetes cluster name. Used for cloud instance tagging. Can also be set via CLUSTER_NAME environment variable. Required for production.
--cloud-providerstringawsCloud provider to use. Options: aws, fake.
--sync-periodduration30sMinimum interval at which watched resources are reconciled.
--graceful-shutdown-timeoutduration30sTimeout for graceful shutdown of the manager.

Network Flags

FlagTypeDefaultDescription
--metrics-bind-addressstring:8080The address the metric endpoint binds to.
--health-probe-bind-addressstring:8081The address the probe endpoint binds to.

Zap Logger Flags

FlagTypeDefaultDescription
--zap-develbooltrueDevelopment mode. Sets encoder to console, time encoding to ISO8601.
--zap-log-levelstringinfoLog level. Options: debug, info, error.
--zap-encoderstringconsoleLog encoder. Options: console, json.
--zap-stacktrace-levelstringerrorLevel at which to print stack traces. Options: debug, info, error.
--zap-time-encodingstringiso8601Time encoding format. Options: epoch, millis, nano, iso8601, rfc3339, rfc3339nano.

Environment Variables

VariableCorresponding FlagDescription
CLUSTER_NAME--cluster-nameKubernetes cluster name
AWS_REGION-Default AWS region (can be overridden per NodePool)
AWS_ACCESS_KEY_ID-AWS access key (prefer IRSA instead)
AWS_SECRET_ACCESS_KEY-AWS secret key (prefer IRSA instead)
AWS_SESSION_TOKEN-AWS session token for temporary credentials

Usage Examples

Basic Usage

stratos \
--cluster-name=production \
--cloud-provider=aws

Local Development

go run ./cmd/stratos/main.go \
--cluster-name=dev \
--cloud-provider=fake \
--zap-log-level=debug

Production with HA

stratos \
--cluster-name=production \
--cloud-provider=aws \
--leader-elect=true \
--zap-encoder=json \
--zap-devel=false \
--zap-log-level=info

Custom Reconciliation Interval

stratos \
--cluster-name=production \
--sync-period=60s

Custom Ports

stratos \
--cluster-name=production \
--metrics-bind-address=:9090 \
--health-probe-bind-address=:9091

Kubernetes Deployment

Stratos is deployed via Helm. See Installation for full details.

Basic Deployment

helm install stratos oci://ghcr.io/stratos-sh/charts/stratos \
--namespace stratos-system --create-namespace \
--set clusterName=production

High Availability Deployment

helm install stratos oci://ghcr.io/stratos-sh/charts/stratos \
--namespace stratos-system --create-namespace \
--set clusterName=production \
--set replicaCount=2

Leader election is enabled by default (leaderElect: true).

Production Logging

helm install stratos oci://ghcr.io/stratos-sh/charts/stratos \
--namespace stratos-system --create-namespace \
--set clusterName=production \
--set extraArgs[0]=--zap-encoder=json \
--set extraArgs[1]=--zap-devel=false \
--set extraArgs[2]=--zap-log-level=info

Health Endpoints

The controller exposes health endpoints for Kubernetes probes:

EndpointPortDescription
/healthz8081Liveness probe - controller is running
/readyz8081Readiness probe - controller is ready

Probe Configuration

livenessProbe:
httpGet:
path: /healthz
port: 8081
initialDelaySeconds: 15
periodSeconds: 20

readinessProbe:
httpGet:
path: /readyz
port: 8081
initialDelaySeconds: 5
periodSeconds: 10

Metrics Endpoint

Prometheus metrics are exposed at the metrics address:

EndpointPortDescription
/metrics8080Prometheus metrics

ServiceMonitor

servicemonitor.yaml
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: stratos
namespace: stratos-system
spec:
selector:
matchLabels:
app.kubernetes.io/name: stratos
endpoints:
- port: metrics
interval: 30s

Next Steps