# Default values for meep-iot.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.

deployment:
  replicas: 1
  port: 80
  protocol: TCP
  dependencies:
    system:
      {{- if not .IsMepService }}
      - kube-dns
      {{- end }}
    namespace:

image:
  repository: meep-docker-registry:30001/meep-iot
  tag: latest
  pullPolicy: Always
  env:
    MEEP_INSTANCE_ID: {{.InstanceId}}
    MEEP_SANDBOX_NAME: {{.SandboxName}}
    MEEP_SVC_PATH: /iots/v1
    MEEP_HOST_URL: {{.HostUrl}}
    {{- if .IsMepService }}
    MEEP_MEP_NAME: {{.MepName}}
    {{- end }}
    {{- if eq .AppEnablement "local" }}
    MEEP_APP_ENABLEMENT: {{.MepName}}-meep-app-enablement
    {{- else if eq .AppEnablement "global" }}
    MEEP_APP_ENABLEMENT: meep-app-enablement
    {{- end }}
    {{- range .Env}}
    {{.}}
    {{- end}}

service:
  {{- if .IsMepService }}
  name: {{.MepName}}-meep-iot
  {{- else }}
  name: meep-iot
  {{- end }}
  type: ClusterIP
  port: 80

ingress:
  enabled: true
  hosts:
    - name: ''
      paths:
        {{- if .IsMepService }}
        - /{{.SandboxName}}/{{.MepName}}/iots
        {{- else }}
        - /{{.SandboxName}}/iots
        {{- end }}
  annotations:
    kubernetes.io/ingress.class: nginx
    nginx.ingress.kubernetes.io/force-ssl-redirect: {{ .HttpsOnly }}
    {{- if .IsMepService }}
    nginx.ingress.kubernetes.io/configuration-snippet: |
      rewrite ^/{{.SandboxName}}/{{.MepName}}/iots(/|$)(.*)$ /iots/$2 break;
    {{- else }}
    nginx.ingress.kubernetes.io/configuration-snippet: |
      rewrite ^/{{.SandboxName}}/iots(/|$)(.*)$ /iots/$2 break;
    {{- end }}
    {{- if .AuthEnabled }}
    nginx.ingress.kubernetes.io/auth-url: https://$http_host/auth/v1/authenticate?svc=meep-iot&sbox={{.SandboxName}}&mep={{.MepName}}
    {{- end }}
  labels: {}
  tls:

prometheus:
  monitor:
    enabled: true
    port: 9000
    interval: 10s
    additionalLabels: {}
    relabelings: []
    scrapeTimeout: 5s

codecov:
  enabled: false
  location: "<WORKDIR>/codecov/meep-iot"

meepOrigin: core
