Docker Images And EKS Deployment

Build and publish LoadStrike test images, then run coordinator and agent pods on EKS using repeatable deployment patterns.

Goal

This workflow standardizes container image creation and distributed execution so every load run uses the same runtime, dependencies, and test binaries.

Image Strategy

Package your test harness into one immutable image. Use runtime settings (NodeType, targets, group, and cluster id) to switch between coordinator and agent behavior without rebuilding images.

Build Prerequisites

Use Docker, AWS CLI, kubectl, and access to ECR and EKS. Build against .NET 8 and keep image tags tied to commit sha or release version.

Registry Flow

Build locally or in CI, tag for ECR, push image, and deploy coordinator/agent manifests referencing the same image tag.

Runtime Inputs

Configure NodeType, ClusterId, AgentGroup, AgentsCount, NatsServerUrl, AgentTargetScenarios, CoordinatorTargetScenarios, and ClusterCommandTimeoutMs via env vars or appsettings.

Kubernetes Objects

Typical objects are Namespace, ConfigMap, Secret, optional ServiceAccount+IRSA, Agent Deployment, Coordinator Job, and optional PVC for report outputs.

Rolling And Scale

Increase agent replicas incrementally and align coordinator AgentsCount to expected active agents. Use versioned tags to avoid mixed binary versions during a run.

Security Controls

Use imagePullSecrets or node IAM permissions for ECR pull, IRSA for AWS API access, and namespace-scoped RBAC and NetworkPolicy for least-privilege operation.

Artifacts

Store final reports from coordinator in /reports and copy to S3/PVC. Keep metadata (cluster id, image tag, commit sha) alongside artifacts for traceability.

Troubleshooting

If agents are not discovered, validate NATS DNS/service reachability, matching ClusterId/AgentGroup, agent readiness, and coordinator timeout settings.

Feature Usage Samples

How to use snippets for Docker Images And EKS Deployment.

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.

Docker Build, Push, and Runtime Settings

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");

Kubernetes Manifests (Image Pull + Agents + Coordinator)

Single image strategy

Build one immutable test image and switch behavior at runtime with NodeType and related settings.

Registry flow

Build, tag, and push the same image to ECR so coordinator and agents run the same binaries.

Image pull settings

Configure pull credentials or IAM so the cluster can retrieve the image.

Coordinator and agent manifests

Deploy the coordinator as a job and the agents as a scalable deployment.

Versioned tags

Use commit or release based tags so one distributed run does not mix binaries from different builds.

apiVersion: v1
kind: Secret
metadata:
  name: ecr-cred
  namespace: loadstrike
type: kubernetes.io/dockerconfigjson
data:
  .dockerconfigjson: <base64-docker-config>
---
apiVersion: v1
kind: ServiceAccount
metadata:
  name: loadstrike-runner
  namespace: loadstrike
  annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::<aws-account-id>:role/loadstrike-eks-runner
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: loadstrike-runtime
  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-agents
  namespace: loadstrike
spec:
  replicas: 4
  selector:
    matchLabels:
      app: loadstrike-agent
  template:
    metadata:
      labels:
        app: loadstrike-agent
    spec:
      serviceAccountName: loadstrike-runner
      imagePullSecrets:
      - name: ecr-cred
      containers:
      - name: agent
        image: <aws-account-id>.dkr.ecr.<region>.amazonaws.com/loadstrike-tests:v1.0.0
        envFrom:
        - configMapRef:
            name: loadstrike-runtime
        env:
        - name: LoadStrike__NodeType
          value: Agent
        - name: LoadStrike__TargetScenarios
          value: kafka-consumer
        resources:
          requests:
            cpu: "750m"
            memory: "768Mi"
          limits:
            cpu: "2"
            memory: "2Gi"
---
apiVersion: batch/v1
kind: Job
metadata:
  name: loadstrike-coordinator
  namespace: loadstrike
spec:
  backoffLimit: 0
  template:
    spec:
      restartPolicy: Never
      serviceAccountName: loadstrike-runner
      imagePullSecrets:
      - name: ecr-cred
      containers:
      - name: coordinator
        image: <aws-account-id>.dkr.ecr.<region>.amazonaws.com/loadstrike-tests:v1.0.0
        envFrom:
        - configMapRef:
            name: loadstrike-runtime
        env:
        - name: LoadStrike__NodeType
          value: Coordinator
        - name: LoadStrike__AgentsCount
          value: "4"
        - 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