diff --git a/deploy/templates/configmap.yaml b/deploy/templates/configmap.yaml index 682b3fa..e008d47 100644 --- a/deploy/templates/configmap.yaml +++ b/deploy/templates/configmap.yaml @@ -4,21 +4,24 @@ metadata: name: {{ include "mittaridatapumppu.fullname" . }}-configmap data: ALLOWED_IP_ADDRESSES: "{{ .Values.endpoint.allowedIpAddresses }}" - AUTH_TOKEN: "{{ .Values.endpoint.authToken }}" - DATA_SOURCE_NAME: "{{ .Values.endpoint.dataSourceName }}" - ENDPOINT_PATH: "{{ .Values.endpoint.endpointPath }}" - HTTP_REQUESTHANDLER: "{{ .Values.endpoint.httpRequestHandler }}" - KAFKA_HOST: "{{ .Values.kafka.kafkaHost }}" - KAFKA_PORT: "{{ .Values.kafka.kafkaPort }}" + ENDPOINT_CONFIG_URL: "{{ .Values.endpoint.endpointConfigUrl }}" KAFKA_BOOTSTRAP_SERVERS: "{{ .Values.kafka.kafkaBootstrapServers }}" KAFKA_GROUP_ID: "{{ .Values.kafka.kafkaGroupId }}" KAFKA_PARSED_DATA_TOPIC_NAME: "{{ .Values.kafka.kafkaParsedDataTopicName }}" KAFKA_RAW_DATA_TOPIC_NAME: "{{ .Values.kafka.kafkaRawDataTopicName }}" DEVICE_REGISTRY_URL: "{{ .Values.parser.deviceRegistryUrl }}" DEVICE_REGISTRY_TOKEN: "{{ .Values.parser.deviceRegistryToken }}" + DJANGO_SETTINGS_MODULE: "{{ .Values.deviceregistry.djangoSettingsModule }}" DJANGO_DB_HOST: "{{ .Release.Name }}-{{ .Values.deviceregistry.databaseHost }}" DJANGO_DB_USER: "{{ .Values.deviceregistry.databaseUser }}" DJANGO_DB_PASSWORD: "{{ .Values.deviceregistry.databasePassword }}" DJANGO_DB_PORT: "{{ .Values.deviceregistry.databasePort }}" + DJANGO_DB_NAME: "{{ .Values.deviceregistry.databaseName }}" ALLOWED_HOSTS: "{{ .Values.deviceregistry.allowedHosts | toStrings }}" SECRET_KEY: "{{ .Values.deviceregistry.secretKey }}" + INFLUX_BUCKET: "{{ .Values.persister.influxBucket }}" + INFLUX_HOST: "{{ .Values.persister.influxHost }}" + INFLUX_ORG: "{{ .Values.persister.influxOrg }}" + INFLUX_TOKEN: "{{ .Values.persister.influxToken }}" + DEBUG: 1 + UVICORN_LOG_LEVEL: "debug" diff --git a/deploy/templates/endpoint-deployment.yaml b/deploy/templates/endpoint-deployment.yaml index 99edbee..3149630 100644 --- a/deploy/templates/endpoint-deployment.yaml +++ b/deploy/templates/endpoint-deployment.yaml @@ -35,7 +35,7 @@ spec: imagePullPolicy: {{ .Values.endpoint.image.pullPolicy }} ports: - name: http - containerPort: {{ .Values.parser.service.port }} + containerPort: {{ .Values.endpoint.service.port }} protocol: TCP # livenessProbe: # httpGet: diff --git a/deploy/templates/persister-deployment.yaml b/deploy/templates/persister-deployment.yaml new file mode 100644 index 0000000..afe8804 --- /dev/null +++ b/deploy/templates/persister-deployment.yaml @@ -0,0 +1,64 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "mittaridatapumppu.fullname" . }}-persister + labels: + {{- include "mittaridatapumppu.labels" . | nindent 4 }} +spec: + {{- if not .Values.autoscaling.enabled }} + replicas: {{ .Values.replicaCount }} + {{- end }} + selector: + matchLabels: + {{- include "mittaridatapumppu.selectorLabels" . | nindent 6 }} + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "mittaridatapumppu.selectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "mittaridatapumppu.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.persister.image.repository }}:{{ .Values.persister.image.tag | default .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.persister.image.pullPolicy }} + ports: + - name: http + containerPort: {{ .Values.persister.service.port }} + protocol: TCP + # livenessProbe: + # httpGet: + # path: / + # port: http + # readinessProbe: + # httpGet: + # path: / + # port: http + resources: + {{- toYaml .Values.resources | nindent 12 }} + envFrom: + - configMapRef: + name: {{ include "mittaridatapumppu.fullname" . }}-configmap + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/deploy/templates/persister-service.yaml b/deploy/templates/persister-service.yaml new file mode 100644 index 0000000..a4ab4ad --- /dev/null +++ b/deploy/templates/persister-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "mittaridatapumppu.fullname" . }}-persister + labels: + {{- include "mittaridatapumppu.labels" . | nindent 4 }} +spec: + type: {{ .Values.persister.service.type }} + ports: + - port: {{ .Values.persister.service.port }} + targetPort: http + protocol: TCP + name: http + selector: + {{- include "mittaridatapumppu.selectorLabels" . | nindent 4 }} diff --git a/deploy/values.yaml b/deploy/values.yaml index dd3c876..7db0e69 100644 --- a/deploy/values.yaml +++ b/deploy/values.yaml @@ -15,10 +15,7 @@ endpoint: type: ClusterIP port: 80 allowedIpAddresses: 127.0.0.1 - authToken: abcd1234 - dataSourceName: "digita.thingpark.http" - endpointPath: "/digita/v2" - httpRequestHandler: "endpoints.digita.aiothingpark" + endpointConfigUrl: http://deviceregistry:8000/api/v1/hosts/localhost/ deviceregistry: replicaCount: 1 @@ -31,6 +28,7 @@ deviceregistry: service: type: ClusterIP port: 80 + djangoSettingsModule: "deviceregistry.settings" databaseHost: "postgresql" databaseUser: "postgres" databasePassword: "postgres" @@ -53,6 +51,24 @@ parser: deviceRegistryUrl: "http://deviceregistry/api/v1" deviceRegistryToken: "1e172012b4404fc4b3d051710f8232a422fa8eaa" +persister: + replicaCount: 1 + image: + repository: ghcr.io/city-of-helsinki/mittaridatapumppu-persister + # pullPolicy: IfNotPresent + pullPolicy: Always + # Overrides the image tag whose default is the chart appVersion. + tag: "v0.1.1" + service: + type: ClusterIP + port: 80 + deviceRegistryUrl: "http://deviceregistry/api/v1" + deviceRegistryToken: "1e172012b4404fc4b3d051710f8232a422fa8eaa" + influxBucket: "devbucket" + influxHost: "http://influxdb2:8086" + influxOrg: "Development" + influxToken: "insercure-token-for-development-and-testing-purposes-only-KxU4jAU23H3vTk" + kafka: kafkaHost: "kafka-kafka-bootstrap" kafkaPort: "9092"