Skip to Content

Configuration

This guide covers common configuration patterns for ModularIoT Helm charts.

Values Files

Creating Values Files

Create a values.yaml file for your deployment:

# values.yaml replicaCount: 2 image: repository: ghcr.io/microboxlabs/miot-app tag: "v1.0.0" ingress: enabled: true hosts: - host: app.example.com paths: - path: / pathType: Prefix

Apply with:

helm install miot-app microboxlabs/miot-app -f values.yaml

Multiple Values Files

Use multiple files for environment-specific configuration:

# Base configuration + environment overrides helm install miot-app microboxlabs/miot-app \ -f values-base.yaml \ -f values-production.yaml

Later files override earlier ones.

Image Configuration

Using a Private Registry

image: repository: your-registry.com/miot-app tag: "v1.0.0" pullPolicy: Always imagePullSecrets: - name: registry-credentials

Create the secret:

kubectl create secret docker-registry registry-credentials \ --docker-server=your-registry.com \ --docker-username=user \ --docker-password=password \ --namespace modulariot

Using GitHub Container Registry

image: repository: ghcr.io/microboxlabs/miot-app tag: "v1.0.0" imagePullSecrets: - name: ghcr-secret

Create GHCR secret:

kubectl create secret docker-registry ghcr-secret \ --docker-server=ghcr.io \ --docker-username=YOUR_GITHUB_USERNAME \ --docker-password=YOUR_GITHUB_PAT \ --namespace modulariot

Resource Management

Setting Resources

resources: limits: cpu: 1000m memory: 1Gi requests: cpu: 250m memory: 512Mi

Resource Recommendations

ComponentMinimumRecommended
miot-app256Mi / 100m512Mi / 250m
miot-docs128Mi / 50m256Mi / 100m
miot-web-site128Mi / 50m256Mi / 100m

Ingress Configuration

NGINX Ingress

ingress: enabled: true className: nginx annotations: nginx.ingress.kubernetes.io/ssl-redirect: "true" nginx.ingress.kubernetes.io/proxy-body-size: "50m" hosts: - host: app.example.com paths: - path: / pathType: Prefix tls: - secretName: app-tls hosts: - app.example.com

Traefik Ingress

ingress: enabled: true className: traefik annotations: traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls: "true" hosts: - host: app.example.com paths: - path: / pathType: Prefix

AWS ALB Ingress

ingress: enabled: true className: alb annotations: alb.ingress.kubernetes.io/scheme: internet-facing alb.ingress.kubernetes.io/target-type: ip alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:... hosts: - host: app.example.com paths: - path: / pathType: Prefix

TLS/SSL Certificates

Using cert-manager

ingress: annotations: cert-manager.io/cluster-issuer: letsencrypt-prod tls: - secretName: app-tls hosts: - app.example.com

Using Existing Certificate

# Create TLS secret kubectl create secret tls app-tls \ --cert=path/to/cert.pem \ --key=path/to/key.pem \ -n modulariot
ingress: tls: - secretName: app-tls hosts: - app.example.com

Environment Variables

Direct Values

env: - name: LOG_LEVEL value: "info" - name: FEATURE_FLAG value: "true"

From ConfigMap

envFrom: - configMapRef: name: app-config

Create ConfigMap:

kubectl create configmap app-config \ --from-literal=LOG_LEVEL=info \ --from-literal=API_URL=https://api.example.com \ -n modulariot

From Secret

envFrom: - secretRef: name: app-secrets env: - name: DATABASE_PASSWORD valueFrom: secretKeyRef: name: db-credentials key: password

Autoscaling

Horizontal Pod Autoscaler

autoscaling: enabled: true minReplicas: 2 maxReplicas: 10 targetCPUUtilizationPercentage: 70 targetMemoryUtilizationPercentage: 80

Pod Disruption Budget

Add to your deployment:

podAnnotations: cluster-autoscaler.kubernetes.io/safe-to-evict: "true"

Health Checks

Custom Health Endpoints

livenessProbe: httpGet: path: /api/health/live port: http initialDelaySeconds: 30 periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 readinessProbe: httpGet: path: /api/health/ready port: http initialDelaySeconds: 10 periodSeconds: 5 timeoutSeconds: 3 failureThreshold: 3

Node Selection

Node Selector

nodeSelector: node-type: application kubernetes.io/arch: amd64

Tolerations

tolerations: - key: "dedicated" operator: "Equal" value: "app" effect: "NoSchedule"

Affinity

affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchLabels: app.kubernetes.io/name: miot-app topologyKey: kubernetes.io/hostname

Service Account

Custom Service Account

serviceAccount: create: true name: "miot-app-sa" annotations: eks.amazonaws.com/role-arn: arn:aws:iam::123456789:role/miot-app-role

Using Existing Service Account

serviceAccount: create: false name: "existing-sa"
Last updated on