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: PrefixApply with:
helm install miot-app microboxlabs/miot-app -f values.yamlMultiple 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.yamlLater 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-credentialsCreate the secret:
kubectl create secret docker-registry registry-credentials \
--docker-server=your-registry.com \
--docker-username=user \
--docker-password=password \
--namespace modulariotUsing GitHub Container Registry
image:
repository: ghcr.io/microboxlabs/miot-app
tag: "v1.0.0"
imagePullSecrets:
- name: ghcr-secretCreate GHCR secret:
kubectl create secret docker-registry ghcr-secret \
--docker-server=ghcr.io \
--docker-username=YOUR_GITHUB_USERNAME \
--docker-password=YOUR_GITHUB_PAT \
--namespace modulariotResource Management
Setting Resources
resources:
limits:
cpu: 1000m
memory: 1Gi
requests:
cpu: 250m
memory: 512MiResource Recommendations
| Component | Minimum | Recommended |
|---|---|---|
| miot-app | 256Mi / 100m | 512Mi / 250m |
| miot-docs | 128Mi / 50m | 256Mi / 100m |
| miot-web-site | 128Mi / 50m | 256Mi / 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.comTraefik 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: PrefixAWS 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: PrefixTLS/SSL Certificates
Using cert-manager
ingress:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
tls:
- secretName: app-tls
hosts:
- app.example.comUsing Existing Certificate
# Create TLS secret
kubectl create secret tls app-tls \
--cert=path/to/cert.pem \
--key=path/to/key.pem \
-n modulariotingress:
tls:
- secretName: app-tls
hosts:
- app.example.comEnvironment Variables
Direct Values
env:
- name: LOG_LEVEL
value: "info"
- name: FEATURE_FLAG
value: "true"From ConfigMap
envFrom:
- configMapRef:
name: app-configCreate ConfigMap:
kubectl create configmap app-config \
--from-literal=LOG_LEVEL=info \
--from-literal=API_URL=https://api.example.com \
-n modulariotFrom Secret
envFrom:
- secretRef:
name: app-secrets
env:
- name: DATABASE_PASSWORD
valueFrom:
secretKeyRef:
name: db-credentials
key: passwordAutoscaling
Horizontal Pod Autoscaler
autoscaling:
enabled: true
minReplicas: 2
maxReplicas: 10
targetCPUUtilizationPercentage: 70
targetMemoryUtilizationPercentage: 80Pod 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: 3Node Selection
Node Selector
nodeSelector:
node-type: application
kubernetes.io/arch: amd64Tolerations
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/hostnameService Account
Custom Service Account
serviceAccount:
create: true
name: "miot-app-sa"
annotations:
eks.amazonaws.com/role-arn: arn:aws:iam::123456789:role/miot-app-roleUsing Existing Service Account
serviceAccount:
create: false
name: "existing-sa"Last updated on