Woojoong Kim | d3c132c | 2020-08-26 14:46:47 -0700 | [diff] [blame] | 1 | {{- /* |
| 2 | |
| 3 | # Copyright 2020-present Open Networking Foundation |
| 4 | # |
| 5 | # SPDX-License-Identifier: Apache-2.0 |
| 6 | # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| 7 | |
| 8 | */ -}} |
| 9 | |
| 10 | --- |
| 11 | apiVersion: apps/v1 |
| 12 | kind: Deployment |
| 13 | metadata: |
| 14 | name: tb-node |
| 15 | spec: |
| 16 | replicas: 1 |
| 17 | selector: |
| 18 | matchLabels: |
| 19 | app: tb-node |
| 20 | template: |
| 21 | metadata: |
| 22 | labels: |
| 23 | app: tb-node |
| 24 | spec: |
| 25 | serviceAccountName: thingsboard |
| 26 | volumes: |
| 27 | - name: tb-node-config |
| 28 | configMap: |
| 29 | name: tb-node-config |
| 30 | items: |
| 31 | - key: conf |
| 32 | path: thingsboard.conf |
| 33 | - key: logback |
| 34 | path: logback.xml |
| 35 | initContainers: |
| 36 | - name: tb-node-dep-check |
| 37 | image: {{ .Values.images.tags.depCheck }} |
| 38 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 39 | env: |
| 40 | - name: POD_NAME |
| 41 | valueFrom: |
| 42 | fieldRef: |
| 43 | apiVersion: v1 |
| 44 | fieldPath: metadata.name |
| 45 | - name: NAMESPACE |
| 46 | valueFrom: |
| 47 | fieldRef: |
| 48 | apiVersion: v1 |
| 49 | fieldPath: metadata.namespace |
| 50 | - name: PATH |
| 51 | value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| 52 | - name: COMMAND |
| 53 | value: "echo done" |
| 54 | - name: DEPENDENCY_POD_JSON |
| 55 | value: '[{"labels": {"app": "tb-kafka"}, "requireSameNode": false}]' |
| 56 | command: |
| 57 | - kubernetes-entrypoint |
| 58 | volumeMounts: |
| 59 | [] |
| 60 | containers: |
| 61 | - name: node-server |
| 62 | imagePullPolicy: {{ .Values.images.pullPolicy }} |
| 63 | image: {{ .Values.images.tags.tbNode }} |
| 64 | ports: |
| 65 | - containerPort: {{ .Values.config.tbNode.ports.http }} |
| 66 | name: http |
| 67 | - containerPort: {{ .Values.config.tbNode.ports.rpc }} |
| 68 | name: rpc |
| 69 | env: |
| 70 | - name: TB_SERVICE_ID |
| 71 | valueFrom: |
| 72 | fieldRef: |
| 73 | fieldPath: metadata.name |
| 74 | - name: TB_SERVICE_TYPE |
| 75 | value: {{ .Values.config.tbNode.serviceType | quote }} |
| 76 | - name: TB_QUEUE_TYPE |
| 77 | value: "kafka" |
| 78 | - name: ZOOKEEPER_ENABLED |
| 79 | value: {{ .Values.config.zookeeper.enabled | quote }} |
| 80 | - name: ZOOKEEPER_URL |
| 81 | value: "zookeeper:{{ .Values.config.zookeeper.port }}" |
| 82 | - name: TB_KAFKA_SERVERS |
| 83 | value: "tb-kafka:{{ .Values.config.kafka.ports.outPort }}" |
| 84 | - name: JS_EVALUATOR |
| 85 | value: {{ .Values.config.tbNode.jsEvaluator | quote }} |
| 86 | - name: TRANSPORT_TYPE |
| 87 | value: {{ .Values.config.tbNode.transportType | quote }} |
| 88 | - name: HTTP_LOG_CONTROLLER_ERROR_STACK_TRACE |
| 89 | value: {{ .Values.config.tbNode.httpLogCtrlErrStackTrace | quote }} |
| 90 | envFrom: |
| 91 | - configMapRef: |
| 92 | name: tb-node-db-config |
| 93 | - configMapRef: |
| 94 | name: tb-node-cache-config |
| 95 | volumeMounts: |
| 96 | - mountPath: /config |
| 97 | name: tb-node-config |
| 98 | livenessProbe: |
| 99 | httpGet: |
| 100 | path: /login |
| 101 | port: http |
| 102 | initialDelaySeconds: 300 |
| 103 | timeoutSeconds: 10 |
| 104 | restartPolicy: Always |