blob: 2142102e4d8df1b53fdfb85f8044c9866733cc8b [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-coap-transport
15spec:
16 replicas: 1
17 selector:
18 matchLabels:
19 app: tb-coap-transport
20 template:
21 metadata:
22 labels:
23 app: tb-coap-transport
24 spec:
25 serviceAccountName: thingsboard
26 volumes:
27 - name: tb-coap-transport-config
28 configMap:
29 name: tb-coap-transport-config
30 items:
31 - key: conf
32 path: tb-coap-transport.conf
33 - key: logback
34 path: logback.xml
35 initContainers:
36 - name: tb-coap-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.coapTransport }}
64 ports:
65 - containerPort: {{ .Values.config.transports.coap.port }}
66 name: coap
67 protocol: UDP
68 env:
69 - name: TB_SERVICE_ID
70 valueFrom:
71 fieldRef:
72 fieldPath: metadata.name
73 - name: TB_QUEUE_TYPE
74 value: "kafka"
75 - name: COAP_BIND_ADDRESS
76 value: {{ .Values.config.transports.coap.bindAddr | quote }}
77 - name: COAP_BIND_PORT
78 value: {{ .Values.config.transports.coap.port | quote }}
79 - name: COAP_TIMEOUT
80 value: {{ .Values.config.transports.coap.timeout | quote }}
81 - name: TB_KAFKA_SERVERS
82 value: "tb-kafka:{{ .Values.config.kafka.ports.outPort }}"
83 volumeMounts:
84 - mountPath: /config
85 name: tb-coap-transport-config
86 restartPolicy: Always