Skip to main content

Quick start with Docker

docker run -p 8080:8080 \
  -e PROVIDER__TYPE=Filesystem \
  -e PROVIDER__ROOT_DIR=/data \
  -v ./rules:/data \
  gorules/agent:latest

Docker Compose

version: '3.8'

services:
  gorules-agent:
    image: gorules/agent:latest
    ports:
      - "8080:8080"
    environment:
      PROVIDER__TYPE: S3
      PROVIDER__BUCKET: my-rules-bucket
      PROVIDER__PREFIX: production/
      POLL_INTERVAL: 10000
    # For AWS credentials, use IAM roles or mount credentials
    # volumes:
    #   - ~/.aws:/root/.aws:ro

With local filesystem

version: '3.8'

services:
  gorules-agent:
    image: gorules/agent:latest
    ports:
      - "8080:8080"
    environment:
      PROVIDER__TYPE: Filesystem
      PROVIDER__ROOT_DIR: /data
    volumes:
      - ./rules:/data:ro

With MinIO

version: '3.8'

services:
  gorules-agent:
    image: gorules/agent:latest
    ports:
      - "8080:8080"
    environment:
      PROVIDER__TYPE: S3
      PROVIDER__BUCKET: rules
      PROVIDER__FORCE_PATH_STYLE: "true"
      PROVIDER__ENDPOINT: http://minio:9000
      AWS_ACCESS_KEY_ID: minioadmin
      AWS_SECRET_ACCESS_KEY: minioadmin
    depends_on:
      - minio

  minio:
    image: minio/minio:latest
    command: server /data --console-address ":9001"
    ports:
      - "9000:9000"
      - "9001:9001"
    environment:
      MINIO_ROOT_USER: minioadmin
      MINIO_ROOT_PASSWORD: minioadmin
    volumes:
      - minio-data:/data

volumes:
  minio-data:

Kubernetes

Basic deployment

apiVersion: apps/v1
kind: Deployment
metadata:
  name: gorules-agent
spec:
  replicas: 3
  selector:
    matchLabels:
      app: gorules-agent
  template:
    metadata:
      labels:
        app: gorules-agent
    spec:
      containers:
      - name: agent
        image: gorules/agent:latest
        ports:
        - containerPort: 8080
        env:
        - name: PROVIDER__TYPE
          value: S3
        - name: PROVIDER__BUCKET
          value: my-rules-bucket
        - name: PROVIDER__PREFIX
          value: production/
        - name: POLL_INTERVAL
          value: "10000"
        resources:
          requests:
            memory: "128Mi"
            cpu: "100m"
          limits:
            memory: "512Mi"
            cpu: "1000m"
        livenessProbe:
          httpGet:
            path: /api/health
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /api/health
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 10
---
apiVersion: v1
kind: Service
metadata:
  name: gorules-agent
spec:
  selector:
    app: gorules-agent
  ports:
  - port: 80
    targetPort: 8080

With ConfigMap for environment

apiVersion: v1
kind: ConfigMap
metadata:
  name: gorules-agent-config
data:
  PROVIDER__TYPE: "S3"
  PROVIDER__BUCKET: "my-rules-bucket"
  PROVIDER__PREFIX: "production/"
  POLL_INTERVAL: "10000"
  OTEL_ENABLED: "true"
  OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gorules-agent
spec:
  replicas: 3
  selector:
    matchLabels:
      app: gorules-agent
  template:
    metadata:
      labels:
        app: gorules-agent
    spec:
      serviceAccountName: gorules-agent
      containers:
      - name: agent
        image: gorules/agent:latest
        ports:
        - containerPort: 8080
        envFrom:
        - configMapRef:
            name: gorules-agent-config
        resources:
          requests:
            memory: "128Mi"
            cpu: "100m"
          limits:
            memory: "512Mi"
            cpu: "1000m"
        livenessProbe:
          httpGet:
            path: /api/health
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /api/health
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 10

With AWS IAM Roles for Service Accounts (IRSA)

apiVersion: v1
kind: ServiceAccount
metadata:
  name: gorules-agent
  annotations:
    eks.amazonaws.com/role-arn: arn:aws:iam::123456789012:role/gorules-agent-role
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: gorules-agent
spec:
  replicas: 3
  selector:
    matchLabels:
      app: gorules-agent
  template:
    metadata:
      labels:
        app: gorules-agent
    spec:
      serviceAccountName: gorules-agent
      containers:
      - name: agent
        image: gorules/agent:latest
        ports:
        - containerPort: 8080
        env:
        - name: PROVIDER__TYPE
          value: S3
        - name: PROVIDER__BUCKET
          value: my-rules-bucket
        livenessProbe:
          httpGet:
            path: /api/health
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 10
        readinessProbe:
          httpGet:
            path: /api/health
            port: 8080
          initialDelaySeconds: 3
          periodSeconds: 10

Horizontal Pod Autoscaler

apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
  name: gorules-agent
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: gorules-agent
  minReplicas: 2
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 70

Platform guides

For detailed platform-specific instructions, see: