Commit 3a1eef449b024747dc271b361d8af5a31d89ff3b

Authored by volodymyr-babak
1 parent 08e9e903

TB-58: k8s feature improvements

... ... @@ -34,9 +34,6 @@ done
34 34 # Copying env variables into conf files
35 35 printenv | awk -F "=" '{print "export " $1 "='\''" $2 "'\''"}' >> /usr/share/thingsboard/conf/thingsboard.conf
36 36
37   -# Set env variable for RPC address
38   -echo "export RPC_HOST='"$(hostname -f)"'" | tee -a /usr/share/thingsboard/conf/thingsboard.conf
39   -
40 37 cat /usr/share/thingsboard/conf/thingsboard.conf
41 38
42 39 echo "Starting 'Thingsboard' service..."
... ...
... ... @@ -2,9 +2,9 @@
2 2 apiVersion: v1
3 3 kind: Service
4 4 metadata:
5   - name: tb-external-ip
  5 + name: tb-service
6 6 labels:
7   - app: tb-external-ip
  7 + app: tb-service
8 8 spec:
9 9 ports:
10 10 - port: 8080
... ... @@ -17,20 +17,6 @@ spec:
17 17 app: tb
18 18 type: LoadBalancer
19 19 ---
20   -apiVersion: v1
21   -kind: Service
22   -metadata:
23   - name: tb-headless
24   - labels:
25   - app: tb-headless
26   -spec:
27   - ports:
28   - - port: 9001
29   - name: rpc
30   - selector:
31   - app: tb
32   - clusterIP: None
33   ----
34 20 apiVersion: policy/v1beta1
35 21 kind: PodDisruptionBudget
36 22 metadata:
... ... @@ -55,14 +41,13 @@ kind: StatefulSet
55 41 metadata:
56 42 name: tb
57 43 spec:
58   - serviceName: "tb-headless"
  44 + serviceName: "tb-service"
59 45 replicas: 2
60 46 template:
61 47 metadata:
62 48 labels:
63 49 app: tb
64 50 spec:
65   - terminationGracePeriodSeconds: 10
66 51 affinity:
67 52 podAntiAffinity:
68 53 requiredDuringSchedulingIgnoredDuringExecution:
... ... @@ -71,7 +56,7 @@ spec:
71 56 - key: "app"
72 57 operator: In
73 58 values:
74   - - tb-headless
  59 + - tb-service
75 60 topologyKey: "kubernetes.io/hostname"
76 61 containers:
77 62 - name: tb
... ... @@ -109,19 +94,17 @@ spec:
109 94 configMapKeyRef:
110 95 name: tb-config
111 96 key: cassandra.url
  97 + - name : RPC_HOST
  98 + valueFrom:
  99 + fieldRef:
  100 + fieldPath: status.podIP
112 101 command:
113 102 - sh
114 103 - -c
115 104 - ./run_thingsboard.sh
116   -# readinessProbe:
117   -# httpGet:
118   -# path: /login
119   -# port: ui-port
120   -# initialDelaySeconds: 30
121   -# periodSeconds: 10
122 105 livenessProbe:
123 106 httpGet:
124 107 path: /login
125 108 port: ui-port
126   - initialDelaySeconds: 30
127   - periodSeconds: 10
\ No newline at end of file
  109 + initialDelaySeconds: 120
  110 + timeoutSeconds: 10
\ No newline at end of file
... ...