Kubernetes Manifests
Manifests
All manifests live in services/orchestrator/k8s/ and are referenced by kustomization.yaml.
Deployment
3 replicas by default, with resource limits, health probes, and pod anti-affinity:
1apiVersion: apps/v12kind: Deployment3metadata:4 name: orchestrator5 namespace: orcher6spec:7 replicas: 38 selector:9 matchLabels:10 app: orchestrator11 template:12 metadata:13 labels:14 app: orchestrator15 component: coordination16 annotations:17 prometheus.io/scrape: "true"18 prometheus.io/port: "8080"19 prometheus.io/path: "/metrics"20 spec:21 serviceAccountName: orchestrator22 securityContext:23 runAsNonRoot: true24 runAsUser: 100025 fsGroup: 100026 containers:27 - name: orchestrator28 image: orcher/orchestrator:latest29 ports:30 - name: grpc31 containerPort: 5005132 - name: http33 containerPort: 808034 env:35 - name: DATABASE_URL36 valueFrom:37 secretKeyRef:38 name: orcher-secrets39 key: database-url40 - name: REDIS_URL41 valueFrom:42 secretKeyRef:43 name: orcher-secrets44 key: redis-url45 optional: true46 - name: LOG_LEVEL47 value: "info"48 - name: LOG_FORMAT49 value: "json"50 resources:51 requests:52 memory: "512Mi"53 cpu: "500m"54 limits:55 memory: "2Gi"56 cpu: "2000m"57 livenessProbe:58 httpGet:59 path: /health/live60 port: 808061 initialDelaySeconds: 1062 periodSeconds: 3063 readinessProbe:64 httpGet:65 path: /health/ready66 port: 808067 initialDelaySeconds: 568 periodSeconds: 1069 volumeMounts:70 - name: config71 mountPath: /etc/orchestrator72 readOnly: true73 volumes:74 - name: config75 configMap:76 name: orchestrator-config77 affinity:78 podAntiAffinity:79 preferredDuringSchedulingIgnoredDuringExecution:80 - weight: 10081 podAffinityTerm:82 labelSelector:83 matchExpressions:84 - key: app85 operator: In86 values:87 - orchestrator88 topologyKey: kubernetes.io/hostnameServices
Two Service definitions — a standard ClusterIP for normal access and a headless service for direct pod addressing:
1# Standard service for gRPC + HTTP2apiVersion: v13kind: Service4metadata:5 name: orchestrator6 namespace: orcher7spec:8 type: ClusterIP9 ports:10 - name: grpc11 port: 5005112 targetPort: grpc13 - name: http14 port: 808015 targetPort: http16 selector:17 app: orchestrator18---19# Headless service for direct pod access20apiVersion: v121kind: Service22metadata:23 name: orchestrator-headless24 namespace: orcher25spec:26 type: ClusterIP27 clusterIP: None28 ports:29 - name: grpc30 port: 5005131 targetPort: grpc32 - name: http33 port: 808034 targetPort: http35 selector:36 app: orchestratorSDK workers connect to the orchestrator via the standard service at orchestrator.orcher.svc.cluster.local:50051.
ConfigMap
TOML configuration mounted at /etc/orchestrator/config.toml:
1apiVersion: v12kind: ConfigMap3metadata:4 name: orchestrator-config5 namespace: orcher6data:7 config.toml: |8 [server]9 grpc_addr = "0.0.0.0:50051"10 http_addr = "0.0.0.0:8080"11 max_concurrent_streams = 10001213 [orchestrator]14 max_workers = 10015 max_concurrent_tasks = 100016 heartbeat_timeout_secs = 901718 [storage]19 database_url = "${DATABASE_URL}"20 redis_url = "${REDIS_URL}"2122 [logging]23 level = "info"24 format = "json"2526 [health]27 readiness_enabled = true28 liveness_enabled = trueNote: DATABASE_URL and REDIS_URL in the ConfigMap are overridden by the environment variables from the Secret, which take precedence.
RBAC
ServiceAccount, Role, and RoleBinding with minimal permissions:
1apiVersion: v12kind: ServiceAccount3metadata:4 name: orchestrator5 namespace: orcher6---7apiVersion: rbac.authorization.k8s.io/v18kind: Role9metadata:10 name: orchestrator11 namespace: orcher12rules:13 - apiGroups: [""]14 resources: ["configmaps"]15 verbs: ["get", "list", "watch"]16 - apiGroups: [""]17 resources: ["secrets"]18 verbs: ["get"]19 - apiGroups: [""]20 resources: ["pods"]21 verbs: ["get", "list", "watch"]22 - apiGroups: [""]23 resources: ["services"]24 verbs: ["get", "list"]25---26apiVersion: rbac.authorization.k8s.io/v127kind: RoleBinding28metadata:29 name: orchestrator30 namespace: orcher31roleRef:32 apiGroup: rbac.authorization.k8s.io33 kind: Role34 name: orchestrator35subjects:36 - kind: ServiceAccount37 name: orchestrator38 namespace: orcherNext Steps
- Autoscaling — HPA, PDB, and Kustomize configuration
- Production — Monitoring, scaling, security, and troubleshooting
- Kubernetes Overview — Prerequisites and quick start