Skip to content

Commit 36159b7

Browse files
committed
Fix KafkaConnector config.
1 parent 0a6d0ca commit 36159b7

File tree

4 files changed

+33
-32
lines changed

4 files changed

+33
-32
lines changed

charts/radar-fitbit-connector/templates/kafka-connect.yaml

Lines changed: 28 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ spec:
3535
value.converter.schema.registry.url: {{ .Values.schema_registry }}
3636
internal.key.converter: "org.apache.kafka.connect.json.JsonConverter"
3737
internal.value.converter: "org.apache.kafka.connect.json.JsonConverter"
38+
# CONNECTOR properties
39+
name: radar-fitbit-source
40+
fitbit.api.client: {{ .Values.fitbit_api_client }}
41+
fitbit.api.secret: {{ .Values.fitbit_api_secret }}
42+
fitbit.api.intraday: {{ .Values.includeIntradayData }}
43+
fitbit.user.repository.class: org.radarbase.connect.rest.fitbit.user.ServiceUserRepository
44+
fitbit.user.repository.url: {{ .Values.radar_rest_sources_backend_url }}
45+
fitbit.user.repository.client.id: {{ .Values.oauthClientId }}
46+
fitbit.user.repository.client.secret: {{ .Values.oauthClientSecret }}
47+
fitbit.user.repository.oauth2.token.url: {{ .Values.managementportal_url }}/oauth/token
48+
fitbit.user.poll.interval: {{ .Values.fitbit_user_poll_interval | int }}
49+
fitbit.user.dir: /mnt/users
3850
template:
3951
pod:
4052
metadata:
@@ -83,22 +95,22 @@ spec:
8395
name: {{ .Values.secret.jaas.name }}
8496
key: {{ .Values.secret.jaas.key }}
8597
{{- end }}
86-
- name: CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL
87-
value: "{{ .Values.schema_registry }}"
88-
- name: CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL
89-
value: "{{ .Values.schema_registry }}"
90-
- name: CONNECT_INTERNAL_KEY_CONVERTER
91-
value: "org.apache.kafka.connect.json.JsonConverter"
92-
- name: CONNECT_INTERNAL_VALUE_CONVERTER
93-
value: "org.apache.kafka.connect.json.JsonConverter"
98+
- name: CONNECT_APPLICATION_LOOP_INTERVAL_MS
99+
value: {{ .Values.application_loop_interval_ms | quote }}
100+
- name: CONNECT_USER_CACHE_REFRESH_INTERVAL_MS
101+
value: {{ .Values.user_cache_refresh_interval_ms | quote }}
102+
- name: CONNECT_REST_SOURCE_BASE_URL
103+
value: {{ .Values.fitbit_api_url }}
104+
- name: CONNECT_REST_SOURCE_POLL_INTERVAL_MS
105+
value: {{ .Values.rest_source_poll_interval_ms | quote }}
106+
- name: CONNECT_REST_SOURCE_REQUEST_GENERATOR_CLASS
107+
value: org.radarbase.connect.rest.fitbit.request.FitbitRequestGenerator
94108
- name: CONNECT_REST_ADVERTISED_HOST_NAME
95109
value: {{ include "radar-fitbit-connector.fullname" . }}
96110
{{- if .Values.zookeeper }}
97111
- name: CONNECT_ZOOKEEPER_CONNECT
98112
value: "{{ .Values.zookeeper }}"
99113
{{- end }}
100-
- name: CONNECTOR_PROPERTY_FILE_PREFIX
101-
value: "source-fitbit/source-fitbit"
102114
- name: KAFKA_HEAP_OPTS
103115
value: {{ .Values.heapOptions }}
104116
- name: KAFKA_BROKERS
@@ -114,12 +126,12 @@ spec:
114126
{{- with .Values.extraEnvVars }}
115127
{{- toYaml . | nindent 8 }}
116128
{{- end }}
117-
{{/* TODO container not starting with volume mounts */}}
118-
{{/* volumeMounts:*/}}
119-
{{/* - name: config-users*/}}
120-
{{/* mountPath: /opt/kafka/plugins/kafka-connect-fitbit-source/users*/}}
121-
{{/* - name: logs*/}}
122-
{{/* mountPath: /opt/kafka/plugins/kafka-connect-fitbit-source/logs*/}}
129+
volumeMounts:
130+
- name: config-users
131+
mountPath: /mnt/users
132+
{{/* TODO is logs mount needed or was it there only to store the offset file (CONNECT_OFFSET_STORAGE_FILE_FILENAME: "/var/lib/kafka-connect-fitbit-source/logs/connect.offsets) */}}
133+
- name: logs
134+
mountPath: /mnt/logs
123135
{{/* {{- if .Values.persistence.fsUserOverride }}*/}}
124136
{{/* TODO is this needed? Init container cannot be specified in the previous format (no matching specs) */}}
125137
{{/* initContainer:*/}}

charts/radar-fitbit-connector/templates/kafka-connector.yaml

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,10 @@ apiVersion: kafka.strimzi.io/v1beta2
22
kind: KafkaConnector
33
metadata:
44
name: radar-fitbit-source
5+
namespace: {{ include "common.names.namespace" . | quote }}
56
labels:
67
strimzi.io/cluster: {{ template "common.names.fullname" . }}
78
spec:
89
class: org.radarbase.connect.rest.fitbit.FitbitSourceConnector
910
tasksMax: 4
10-
config:
11-
rest.source.base.url: {{ .Values.fitbit_api_url }}
12-
rest.source.poll.interval.ms: {{ .Values.rest_source_poll_interval_ms | int }}
13-
rest.source.request.generator.class: org.radarbase.connect.rest.fitbit.request.FitbitRequestGenerator
14-
fitbit.api.client: {{ .Values.fitbit_api_client }}
15-
fitbit.api.secret: {{ .Values.fitbit_api_secret }}
16-
fitbit.api.intraday: {{ .Values.includeIntradayData }}
17-
fitbit.user.repository.class: org.radarbase.connect.rest.fitbit.user.ServiceUserRepository
18-
fitbit.user.repository.url: {{ .Values.radar_rest_sources_backend_url }}
19-
fitbit.user.repository.client.id: {{ .Values.oauthClientId }}
20-
fitbit.user.repository.client.secret: {{ .Values.oauthClientSecret }}
21-
fitbit.user.repository.oauth2.token.url: {{ .Values.managementportal_url }}/oauth/token
22-
fitbit.user.poll.interval: {{ .Values.fitbit_user_poll_interval | int }}
23-
application.loop.interval.ms: {{ .Values.application_loop_interval_ms | int }}
24-
user.cache.refresh.interval.ms: {{ .Values.user_cache_refresh_interval_ms | int}}
11+

charts/radar-fitbit-connector/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ heapOptions: "-Xms256m -Xmx768m"
6767

6868
persistence:
6969
# -- Enable persistence using PVC
70-
enabled: true
70+
enabled: false
7171
## If defined, storageClassName: <storageClass>
7272
## If set to "-", storageClassName: "", which disables dynamic provisioning
7373
## If undefined (the default) or set to null, no storageClassName spec is

charts/radar-kafka/templates/topics-schema-registry.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ metadata:
99
labels:
1010
strimzi.io/cluster: {{ template "common.names.fullname" . }}
1111
spec:
12+
{{/* TODO when changing partitions on this getting: "The schema topic registry-schemas should have only 1 partition but has 3" */}}
13+
{{/* According to https://stackoverflow.com/a/74777178 schema topic should not have more than 1 partition */}}
1214
partitions: {{ $context.partitions }}
1315
replicas: {{ $topicReplicationFactor }}
1416
config:

0 commit comments

Comments
 (0)