blob: bb7b5d49dd2033bbb19c43bb1f6c42364847c8d1 [file] [log] [blame]
Woojoong Kimd3c132c2020-08-26 14:46:47 -07001{{- /*
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---
11apiVersion: apps/v1
12kind: Deployment
13metadata:
14 name: tb-http-transport
15spec:
16 replicas: 1
17 selector:
18 matchLabels:
19 app: tb-http-transport
20 template:
21 metadata:
22 labels:
23 app: tb-http-transport
24 spec:
25 serviceAccountName: thingsboard
26 volumes:
27 - name: tb-http-transport-config
28 configMap:
29 name: tb-http-transport-config
30 items:
31 - key: conf
32 path: tb-http-transport.conf
33 - key: logback
34 path: logback.xml
35 initContainers:
36 - name: tb-http-transport-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: server
62 imagePullPolicy: {{ .Values.images.pullPolicy }}
63 image: {{ .Values.images.tags.httpTransport }}
64 ports:
65 - containerPort: {{ .Values.config.transports.http.port }}
66 name: http
67 env:
68 - name: TB_SERVICE_ID
69 valueFrom:
70 fieldRef:
71 fieldPath: metadata.name
72 - name: TB_QUEUE_TYPE
73 value: "kafka"
74 - name: HTTP_BIND_ADDRESS
75 value: {{ .Values.config.transports.http.bindAddr | quote }}
76 - name: HTTP_BIND_PORT
77 value: {{ .Values.config.transports.http.port | quote }}
78 - name: HTTP_REQUEST_TIMEOUT
79 value: {{ .Values.config.transports.http.timeout | quote }}
80 - name: TB_KAFKA_SERVERS
81 value: "tb-kafka:{{ .Values.config.kafka.ports.outPort }}"
82 volumeMounts:
83 - mountPath: /config
84 name: tb-http-transport-config
85 readinessProbe:
86 periodSeconds: 20
87 tcpSocket:
88 port: {{ .Values.config.transports.http.port }}
89 livenessProbe:
90 initialDelaySeconds: 120
91 periodSeconds: 20
92 tcpSocket:
93 port: {{ .Values.config.transports.http.port }}
94 restartPolicy: Always