Skip to Content

miot-app Chart

The miot-app chart deploys the main ModularIoT application - a Next.js application with authentication, maps, and IoT management capabilities.

Installation

helm install miot-app microboxlabs/miot-app \ --namespace modulariot \ --create-namespace

Parameters

Image Parameters

ParameterDescriptionDefault
image.repositoryImage repositoryghcr.io/microboxlabs/miot-app
image.tagImage tagChart appVersion
image.pullPolicyPull policyIfNotPresent
imagePullSecretsPull secrets[]

Deployment Parameters

ParameterDescriptionDefault
replicaCountNumber of replicas1
podAnnotationsPod annotations{}
podLabelsPod labels{}
nodeSelectorNode selector{}
tolerationsTolerations[]
affinityAffinity rules{}

Service Parameters

ParameterDescriptionDefault
service.typeService typeClusterIP
service.portService port3000

Ingress Parameters

ParameterDescriptionDefault
ingress.enabledEnable ingressfalse
ingress.classNameIngress class name""
ingress.annotationsIngress annotations{}
ingress.hostsIngress hostsSee values.yaml
ingress.tlsTLS configuration[]

Authentication Parameters

ParameterDescriptionDefault
auth.secretAuth secret for JWT signing""
auth.existingSecretUse existing secret""
auth.existingSecretKeyKey in existing secretauth-secret
auth.providers.google.enabledEnable Google OAuthfalse
auth.providers.google.clientIdGoogle client ID""
auth.providers.google.clientSecretGoogle client secret""

Resource Parameters

ParameterDescriptionDefault
resources.limits.cpuCPU limitNot set
resources.limits.memoryMemory limitNot set
resources.requests.cpuCPU requestNot set
resources.requests.memoryMemory requestNot set

Autoscaling Parameters

ParameterDescriptionDefault
autoscaling.enabledEnable HPAfalse
autoscaling.minReplicasMinimum replicas1
autoscaling.maxReplicasMaximum replicas10
autoscaling.targetCPUUtilizationPercentageTarget CPU80

Authentication

The application uses NextAuth.js for authentication. Configure it properly for production:

Using Auth Secret

Generate a secure secret:

openssl rand -base64 32

Set it in your values:

auth: secret: "your-generated-secret-here"

Using Existing Secret

Create a Kubernetes secret:

kubectl create secret generic miot-auth \ --from-literal=auth-secret="your-secret" \ --from-literal=google-client-id="your-google-id" \ --from-literal=google-client-secret="your-google-secret" \ -n modulariot

Reference it in values:

auth: existingSecret: miot-auth providers: google: enabled: true

Google OAuth Setup

  1. Create OAuth credentials in Google Cloud Console 
  2. Set authorized redirect URI: https://app.yourdomain.com/api/auth/callback/google
  3. Configure in values:
auth: secret: "your-jwt-secret" providers: google: enabled: true clientId: "your-client-id.apps.googleusercontent.com" clientSecret: "your-client-secret"

Environment Variables

Add custom environment variables:

env: - name: NEXTAUTH_URL value: "https://app.modulariot.example.com" - name: NEXT_TELEMETRY_DISABLED value: "1" envFrom: - configMapRef: name: app-config - secretRef: name: app-secrets

Health Checks

The chart configures liveness and readiness probes:

livenessProbe: httpGet: path: / port: http initialDelaySeconds: 10 periodSeconds: 10 readinessProbe: httpGet: path: / port: http initialDelaySeconds: 5 periodSeconds: 10

Customize if your app has specific health endpoints:

livenessProbe: httpGet: path: /api/health port: http

Example Values

Development

replicaCount: 1 image: tag: "latest" service: type: NodePort auth: secret: "dev-secret-change-in-production"

Production

replicaCount: 3 image: tag: "v1.0.0" resources: limits: cpu: 1000m memory: 1Gi requests: cpu: 250m memory: 512Mi autoscaling: enabled: true minReplicas: 3 maxReplicas: 10 targetCPUUtilizationPercentage: 70 ingress: enabled: true className: nginx annotations: cert-manager.io/cluster-issuer: letsencrypt-prod hosts: - host: app.modulariot.example.com paths: - path: / pathType: Prefix tls: - secretName: app-tls hosts: - app.modulariot.example.com auth: existingSecret: miot-auth-production providers: google: enabled: true
Last updated on