blob: 71e6a2afa5c18dd556d2563b054d20833f918f87 [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: batch/v1
12kind: Job
13metadata:
14 name: job-tb-db-setup
15spec:
16 template:
17 metadata:
18 name: job-tb-db-setup
19 spec:
20 restartPolicy: OnFailure
21 serviceAccountName: thingsboard
22 initContainers:
23 - name: job-tb-db-setup-dep-check
24 image: {{ .Values.images.tags.depCheck }}
25 imagePullPolicy: {{ .Values.images.pullPolicy }}
26 env:
27 - name: POD_NAME
28 valueFrom:
29 fieldRef:
30 apiVersion: v1
31 fieldPath: metadata.name
32 - name: NAMESPACE
33 valueFrom:
34 fieldRef:
35 apiVersion: v1
36 fieldPath: metadata.namespace
37 - name: PATH
38 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
39 - name: COMMAND
40 value: "echo done"
41 - name: DEPENDENCY_POD_JSON
42 value: '[{"labels": {"app": "postgres"}, "requireSameNode": false}]'
43 command:
44 - kubernetes-entrypoint
45 volumeMounts:
46 []
47 containers:
48 - name: job-tb-db-setup
49 image: {{ .Values.images.tags.tbDbSetup }}
50 imagePullPolicy: {{ .Values.images.pullPolicy }}
51 envFrom:
52 - configMapRef:
53 name: tb-node-db-config
54 volumeMounts:
55 - mountPath: /config
56 name: tb-node-config
57 command: ['sh', '-c', 'export INSTALL_TB=true; export LOAD_DEMO=true; start-tb-node.sh;']
58 volumes:
59 - name: tb-node-config
60 configMap:
61 name: tb-node-config
62 items:
63 - key: conf
64 path: thingsboard.conf
65 - key: logback
66 path: logback.xml