From 5e6d5f5c48a9bde90453c2dd67a1573376fdefd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=20=E6=89=BF=E6=B5=A9?= Date: Thu, 11 May 2023 14:00:10 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E4=B8=8B?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=B0=86=E9=85=8D=E7=BD=AE=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=BF=9B=E8=A1=8C=E6=8C=82=E8=BD=BD=EF=BC=8C=E6=84=9F?= =?UTF-8?q?=E8=A7=89=E9=83=A8=E7=BD=B2=E7=9A=84=E6=97=B6=E5=80=99=E4=BC=9A?= =?UTF-8?q?=E6=9B=B4=E5=8A=A0=E7=81=B5=E6=B4=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm/tdengine/templates/configmap.yaml | 132 ++++++++++++++++++++++- helm/tdengine/templates/statefulset.yaml | 20 +++- 2 files changed, 145 insertions(+), 7 deletions(-) diff --git a/helm/tdengine/templates/configmap.yaml b/helm/tdengine/templates/configmap.yaml index db94b1e..a0e8091 100644 --- a/helm/tdengine/templates/configmap.yaml +++ b/helm/tdengine/templates/configmap.yaml @@ -1,11 +1,135 @@ --- +#taos配置文件 apiVersion: v1 kind: ConfigMap metadata: name: {{ include "tdengine.fullname" . }}-taoscfg labels: - {{- include "tdengine.labels" . | nindent 4 }} + name: {{ include "tdengine.fullname" . }}-taoscfg data: -{{- with .Values.taoscfg }} - {{- toYaml . | nindent 2 }} -{{- end }} + taos.cfg: |- + monitor 1 // start monitor + monitorInterval 30 // send log interval (s) + monitorFqdn localhost + monitorPort 6043 // taosKeeper port + monitorMaxLogs 100 + + keeper.toml: |- + # Start with debug middleware for gin + debug = false + # Listen port, default is 6043 + port = 6043 + # log level + loglevel = "info" + # go pool size + gopoolsize = 50000 + # interval for TDengine metrics + RotationInterval = "15s" + [tdengine] + host = "127.0.0.1" + port = 6041 + username = "root" + password = "taosdata" + # list of taosAdapter that need to be monitored + [taosAdapter] + address = ["127.0.0.1:6041"] + [metrics] + # metrics prefix in metrics names. + prefix = "taos" + # database for storing metrics data + database = "log" + # export some tables that are not super table + tables = [] + [environment] + # Whether running in cgroup. + + taosadapter.toml: |- + debug = true + taosConfigDir = "" + port = 6041 + logLevel = "info" + [cors] + allowAllOrigins = true + #[pool] + #maxConnect = 0 + #maxIdle = 0 + #idleTimeout = 0 + [ssl] + enable = false + certFile = "" + keyFile = "" + [log] + #path = "/var/log/taos" + rotationCount = 30 + rotationTime = "24h" + rotationSize = "1GB" + enableRecordHttpSql = false + sqlRotationCount = 2 + sqlRotationTime = "24h" + sqlRotationSize = "1GB" + [monitor] + disable = false + collectDuration = "3s" + disableCollectClientIP = false + incgroup = false + pauseQueryMemoryThreshold = 70 + pauseAllMemoryThreshold = 80 + identity = "" + writeToTD = false + user = "root" + password = "taosdata" + writeInterval = "30s" + [opentsdb] + enable = true + [influxdb] + enable = true + [statsd] + enable = false + port = 6044 + db = "statsd" + user = "root" + password = "taosdata" + worker = 10 + gatherInterval = "5s" + protocol = "udp" + maxTCPConnections = 250 + tcpKeepAlive = false + allowPendingMessages = 50000 + deleteCounters = true + deleteGauges = true + deleteSets = true + deleteTimings = true + [collectd] + enable = false + port = 6045 + db = "collectd" + user = "root" + password = "taosdata" + worker = 10 + [opentsdb_telnet] + enable = false + maxTCPConnections = 250 + tcpKeepAlive = false + dbs = ["opentsdb_telnet", "collectd", "icinga2", "tcollector"] + ports = [6046, 6047, 6048, 6049] + user = "root" + password = "taosdata" + batchSize = 1 + flushInterval = "0s" + [node_exporter] + enable = false + db = "node_exporter" + user = "root" + password = "taosdata" + urls = ["http://localhost:9100"] + responseTimeout = "5s" + httpUsername = "" + httpPassword = "" + httpBearerTokenString = "" + caCertFile = "" + certFile = "" + keyFile = "" + insecureSkipVerify = true + gatherDuration = "5s" + [prometheus] + enable = true diff --git a/helm/tdengine/templates/statefulset.yaml b/helm/tdengine/templates/statefulset.yaml index 875463b..7005d81 100644 --- a/helm/tdengine/templates/statefulset.yaml +++ b/helm/tdengine/templates/statefulset.yaml @@ -74,10 +74,9 @@ spec: - name: TAOS_FQDN value: '$(POD_NAME).$(SERVICE_NAME).$(STS_NAMESPACE).svc.{{ .Values.clusterDomainSuffix | default "cluster.local" }}' - envFrom: - - configMapRef: - name: {{ include "tdengine.fullname" . }}-taoscfg volumeMounts: + - name: {{ include "tdengine.fullname" . }}-taoscfg + mountPath: /etc/taos - name: {{ include "tdengine.fullname" . }}-taosdata mountPath: /var/lib/taos - name: {{ include "tdengine.fullname" . }}-taoslog @@ -114,6 +113,21 @@ spec: # readOnly: true # 仅允许只读模式挂载 resources: {{- toYaml .Values.resources | nindent 12 }} + volumes: + - name: {{ include "tdengine.fullname" . }}-taoscfg + configMap: + name: {{ include "tdengine.fullname" . }}-taoscfg + items: + - key: taos.cfg + path: taos.cfg + - key: keeper.toml + path: keeper.toml + - key: taosadapter.toml + path: taosadapter.toml + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} From f87805352f25cf1f97f5520af729786a1357eba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=20=E6=89=BF=E6=B5=A9?= Date: Thu, 11 May 2023 14:14:59 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=B0=86=E9=85=8D=E7=BD=AE=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E8=BF=9B=E8=A1=8C=E6=8C=82=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- helm/tdengine/templates/configmap.yaml | 2 +- helm/tdengine/templates/statefulset.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/helm/tdengine/templates/configmap.yaml b/helm/tdengine/templates/configmap.yaml index a0e8091..8dcdd52 100644 --- a/helm/tdengine/templates/configmap.yaml +++ b/helm/tdengine/templates/configmap.yaml @@ -1,5 +1,5 @@ --- -#taos配置文件 +#taos 配置文件 apiVersion: v1 kind: ConfigMap metadata: diff --git a/helm/tdengine/templates/statefulset.yaml b/helm/tdengine/templates/statefulset.yaml index 7005d81..3042f8b 100644 --- a/helm/tdengine/templates/statefulset.yaml +++ b/helm/tdengine/templates/statefulset.yaml @@ -75,6 +75,7 @@ spec: value: '$(POD_NAME).$(SERVICE_NAME).$(STS_NAMESPACE).svc.{{ .Values.clusterDomainSuffix | default "cluster.local" }}' volumeMounts: + # this is config dir - name: {{ include "tdengine.fullname" . }}-taoscfg mountPath: /etc/taos - name: {{ include "tdengine.fullname" . }}-taosdata