github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/deploy/tdengine/templates/clusterdefinition.yaml (about)

     1  apiVersion: apps.kubeblocks.io/v1alpha1
     2  kind: ClusterDefinition
     3  metadata:
     4    name: tdengine
     5    labels:
     6      {{- include "tdengine.labels" . | nindent 4 }}
     7  spec:
     8    type: tdengine
     9    connectionCredential:
    10      username: {{ .Values.defaultAuth.username }}
    11      password: {{ .Values.defaultAuth.password }}
    12      endpoint: "$(SVC_FQDN):$(SVC_PORT_tdengine)"
    13      host: "$(SVC_FQDN)"
    14      port: "$(SVC_PORT_tdengine)"
    15    componentDefs:
    16      - name: tdengine
    17        characterType: tdengine
    18        workloadType: Stateful
    19        service:
    20          ports:
    21            - name: taosd
    22              port: 6030
    23              protocol: TCP
    24              targetPort: taosd
    25            - name: taos-adapter
    26              port: 6041
    27              protocol: TCP
    28              targetPort: taos-adapter
    29        monitor:
    30          builtIn: false
    31          exporterConfig:
    32            scrapePath: /metrics
    33            scrapePort: {{ .Values.metrics.service.port }}
    34        configSpecs:
    35          - name: tdengine-taos-config
    36            templateRef: tdengine-config-template
    37            volumeName: taos-config
    38            namespace: {{ .Release.Namespace }}
    39          - name: metrics-configuration
    40            templateRef: metrics-configuration
    41            namespace: {{ .Release.Namespace }}
    42            volumeName: metrics-configuration
    43            defaultMode: 0444
    44        scriptSpecs:
    45          - name: taos-adapter-scripts
    46            templateRef: taos-adapter-scripts-template
    47            namespace: {{ .Release.Namespace }}
    48            volumeName: scripts
    49            defaultMode: 0555
    50        podSpec:
    51          containers:
    52            - name: tdengine
    53              imagePullPolicy: IfNotPresent
    54              ports:
    55                - name: taosd
    56                  containerPort: 6030
    57                - name: taos-adapter
    58                  containerPort: 6041
    59              env:
    60                - name: SVC_PORT
    61                  value: "6030"
    62                - name: TAOS_ADAPTER_PORT
    63                  value: "6041"
    64                - name: TZ
    65                  value: {{ .Values.timeZone }}
    66                - name: TAOS_FQDN
    67                  value: "$(KB_POD_FQDN).cluster.local"
    68                - name: TAOS_FIRST_EP
    69                  value: "$(KB_0_HOSTNAME).$(KB_NAMESPACE).svc.cluster.local:$(SVC_PORT)"
    70                - name: TAOS_ADAPTER_USERNAME
    71                  valueFrom:
    72                    secretKeyRef:
    73                      name: $(CONN_CREDENTIAL_SECRET_NAME)
    74                      key: username
    75                      optional: false
    76                - name: TAOS_ADAPTER_PASSWORD
    77                  valueFrom:
    78                    secretKeyRef:
    79                      name: $(CONN_CREDENTIAL_SECRET_NAME)
    80                      key: password
    81                      optional: false
    82              lifecycle:
    83                postStart:
    84                  exec:
    85                    command: ["/bin/sh", "-c", "/scripts/taos-adapter-check.sh"]
    86              readinessProbe:
    87                tcpSocket:
    88                  port: 6030
    89                initialDelaySeconds: 5
    90                timeoutSeconds: 60
    91              livenessProbe:
    92                tcpSocket:
    93                  port: 6030
    94                initialDelaySeconds: 15
    95                periodSeconds: 20
    96              volumeMounts:
    97                - name: taos-config
    98                  mountPath: /etc/taos
    99                - name: data
   100                  mountPath: /var/lib/taos
   101                - name: scripts
   102                  mountPath: /scripts
   103            - name: metrics
   104              image:  {{ .Values.metrics.image.registry | default "docker.io" }}/{{ .Values.metrics.image.repository }}:{{ .Values.metrics.image.tag }}
   105              imagePullPolicy: {{ .Values.metrics.image.pullPolicy | quote }}
   106              securityContext:
   107                runAsNonRoot: true
   108                runAsUser: 1001
   109              env:
   110                - name: TAOS_KEEPER_TDENGINE_USERNAME
   111                  valueFrom:
   112                    secretKeyRef:
   113                      name: $(CONN_CREDENTIAL_SECRET_NAME)
   114                      key: username
   115                      optional: false
   116                - name: TAOS_KEEPER_TDENGINE_PASSWORD
   117                  valueFrom:
   118                    secretKeyRef:
   119                      name: $(CONN_CREDENTIAL_SECRET_NAME)
   120                      key: password
   121                      optional: false
   122              command: ["taoskeeper"]
   123              args: ["-c", "/etc/taos/taoskeeper.toml"]
   124              ports:
   125                - name: http-metrics
   126                  containerPort: {{ .Values.metrics.service.port }}
   127              volumeMounts:
   128                - name: metrics-configuration
   129                  mountPath: /etc/taos/