EKS Controller And Agents

Deploy LoadStrike controller and agents on Amazon EKS with NATS coordination, optional Redis correlation store, and persistent report outputs.

When To Use EKS

Use EKS when a single machine cannot generate required load, when you need production-like multi-node traffic patterns, or when you want repeatable CI/CD load jobs.

Architecture

Run one coordinator pod (usually as a Job) and multiple agent pods (Deployment). Coordinator orchestrates scenarios and merges metrics; agents execute assigned workload and stream node stats back over NATS.

Dependencies

Required components are EKS, kubectl, AWS CLI, Docker, ECR, and a NATS endpoint reachable by all test pods. Optional components include Redis for correlation store persistence and S3 or PVC for report retention.

Container Image

Build a .NET 8 runtime image containing your test project and LoadStrike setup. Push the image to ECR and reference the image tag in both coordinator and agent manifests.

Runtime Configuration

Set LoadStrike keys such as NodeType, ClusterId, AgentGroup, AgentsCount, NatsServerUrl, AgentTargetScenarios, CoordinatorTargetScenarios, and ClusterCommandTimeoutMs through appsettings, env vars, or CLI args.

Kubernetes Manifests

Use Namespace, Secret, ConfigMap, NATS deployment/service, agent deployment, and coordinator job manifests. Keep the same ClusterId and AgentGroup values across all pods in one run.

Scaling Strategy

Scale agents by Deployment replicas and keep AgentsCount in coordinator config aligned with expected active agent pods. Scale gradually and monitor CPU, memory, and network saturation on worker nodes.

Security And IAM

Use Kubernetes Secrets for credentials, IRSA for AWS access, restricted RBAC for test namespaces, and NetworkPolicies to limit broker and target-system access to required paths only.

Reports And Artifacts

Write reports to /reports in the container and persist via PVC or push artifacts to object storage after coordinator completion. Agent reports are disabled in distributed mode by design.

Operational Checks

If coordinator waits too long, verify NATS connectivity, agent readiness, ClusterCommandTimeout value, scenario targeting alignment, and broker credentials.

Feature Usage Samples

How to use snippets for EKS Controller And Agents.

Switch between C#, Java, Python, TypeScript, and JavaScript to see the native SDK shape for this sample.

Licensing note: every runnable sample requires a valid runner key via WithRunnerKey("...") or config key LoadStrike:RunnerKey.

EKS Dependencies and Runtime Config

var coordinator = LoadStrikeRunner
    .RegisterScenarios(httpScenario, kafkaScenario)
    .WithNodeType(LoadStrikeNodeType.Coordinator)
    .WithClusterId("orders-cluster")
    .WithAgentGroup("perf-agents")
    .WithAgentsCount(3)
    .WithNatsServerUrl("nats://nats.loadstrike.svc.cluster.local:4222")
    .WithReportFolder("/reports")
    .WithRunnerKey("rkr_your_remote_runner_key");

EKS Manifests (NATS, Agents, Coordinator)

EKS cluster

Provides the Kubernetes control plane and worker capacity for coordinator and agent pods.

NATS

Provides the coordinator-agent messaging layer for distributed execution.

Redis (optional)

Adds durable correlation-store support when you do not want in-memory correlation only.

Coordinator job

Starts the orchestrator that assigns work, merges stats, and writes final artifacts.

Agent deployment

Starts the scalable workers that execute the assigned scenarios.

PVC or object storage

Keeps coordinator-generated reports and artifacts after the job has completed.

apiVersion: v1
kind: Namespace
metadata:
  name: loadstrike
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: nats
  namespace: loadstrike
spec:
  replicas: 1
  selector:
    matchLabels:
      app: nats
  template:
    metadata:
      labels:
        app: nats
    spec:
      containers:
      - name: nats
        image: nats:2.10-alpine
        args: ["-js"]
        ports:
        - containerPort: 4222
---
apiVersion: v1
kind: Service
metadata:
  name: nats
  namespace: loadstrike
spec:
  selector:
    app: nats
  ports:
  - name: client
    port: 4222
    targetPort: 4222
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: loadstrike-cluster
  namespace: loadstrike
data:
  LoadStrike__ClusterId: orders-cluster
  LoadStrike__AgentGroup: perf-agents
  LoadStrike__NatsServerUrl: nats://nats.loadstrike.svc.cluster.local:4222
  LoadStrike__AgentTargetScenarios: kafka-consumer
  LoadStrike__CoordinatorTargetScenarios: http-source
  LoadStrike__ClusterCommandTimeoutMs: "180000"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: loadstrike-agent
  namespace: loadstrike
spec:
  replicas: 3
  selector:
    matchLabels:
      app: loadstrike-agent
  template:
    metadata:
      labels:
        app: loadstrike-agent
    spec:
      containers:
      - name: agent
        image: <aws-account-id>.dkr.ecr.<region>.amazonaws.com/loadstrike-tests:latest
        envFrom:
        - configMapRef:
            name: loadstrike-cluster
        env:
        - name: LoadStrike__NodeType
          value: Agent
        - name: LoadStrike__TargetScenarios
          value: kafka-consumer
        resources:
          requests:
            cpu: "500m"
            memory: "512Mi"
          limits:
            cpu: "2"
            memory: "2Gi"
---
apiVersion: batch/v1
kind: Job
metadata:
  name: loadstrike-coordinator
  namespace: loadstrike
spec:
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      containers:
      - name: coordinator
        image: <aws-account-id>.dkr.ecr.<region>.amazonaws.com/loadstrike-tests:latest
        envFrom:
        - configMapRef:
            name: loadstrike-cluster
        env:
        - name: LoadStrike__NodeType
          value: Coordinator
        - name: LoadStrike__AgentsCount
          value: "3"
        - name: LoadStrike__RunnerKey
          value: rkr_your_remote_runner_key
        - name: LoadStrike__ReportFolder
          value: /reports
        volumeMounts:
        - name: reports
          mountPath: /reports
      volumes:
      - name: reports
        persistentVolumeClaim:
          claimName: loadstrike-reports-pvc