TB-58: k8s feature improvements
This commit is contained in:
parent
08e9e903f3
commit
3a1eef449b
@ -34,9 +34,6 @@ done
|
|||||||
# Copying env variables into conf files
|
# Copying env variables into conf files
|
||||||
printenv | awk -F "=" '{print "export " $1 "='\''" $2 "'\''"}' >> /usr/share/thingsboard/conf/thingsboard.conf
|
printenv | awk -F "=" '{print "export " $1 "='\''" $2 "'\''"}' >> /usr/share/thingsboard/conf/thingsboard.conf
|
||||||
|
|
||||||
# Set env variable for RPC address
|
|
||||||
echo "export RPC_HOST='"$(hostname -f)"'" | tee -a /usr/share/thingsboard/conf/thingsboard.conf
|
|
||||||
|
|
||||||
cat /usr/share/thingsboard/conf/thingsboard.conf
|
cat /usr/share/thingsboard/conf/thingsboard.conf
|
||||||
|
|
||||||
echo "Starting 'Thingsboard' service..."
|
echo "Starting 'Thingsboard' service..."
|
||||||
|
|||||||
@ -2,9 +2,9 @@
|
|||||||
apiVersion: v1
|
apiVersion: v1
|
||||||
kind: Service
|
kind: Service
|
||||||
metadata:
|
metadata:
|
||||||
name: tb-external-ip
|
name: tb-service
|
||||||
labels:
|
labels:
|
||||||
app: tb-external-ip
|
app: tb-service
|
||||||
spec:
|
spec:
|
||||||
ports:
|
ports:
|
||||||
- port: 8080
|
- port: 8080
|
||||||
@ -17,20 +17,6 @@ spec:
|
|||||||
app: tb
|
app: tb
|
||||||
type: LoadBalancer
|
type: LoadBalancer
|
||||||
---
|
---
|
||||||
apiVersion: v1
|
|
||||||
kind: Service
|
|
||||||
metadata:
|
|
||||||
name: tb-headless
|
|
||||||
labels:
|
|
||||||
app: tb-headless
|
|
||||||
spec:
|
|
||||||
ports:
|
|
||||||
- port: 9001
|
|
||||||
name: rpc
|
|
||||||
selector:
|
|
||||||
app: tb
|
|
||||||
clusterIP: None
|
|
||||||
---
|
|
||||||
apiVersion: policy/v1beta1
|
apiVersion: policy/v1beta1
|
||||||
kind: PodDisruptionBudget
|
kind: PodDisruptionBudget
|
||||||
metadata:
|
metadata:
|
||||||
@ -55,14 +41,13 @@ kind: StatefulSet
|
|||||||
metadata:
|
metadata:
|
||||||
name: tb
|
name: tb
|
||||||
spec:
|
spec:
|
||||||
serviceName: "tb-headless"
|
serviceName: "tb-service"
|
||||||
replicas: 2
|
replicas: 2
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
app: tb
|
app: tb
|
||||||
spec:
|
spec:
|
||||||
terminationGracePeriodSeconds: 10
|
|
||||||
affinity:
|
affinity:
|
||||||
podAntiAffinity:
|
podAntiAffinity:
|
||||||
requiredDuringSchedulingIgnoredDuringExecution:
|
requiredDuringSchedulingIgnoredDuringExecution:
|
||||||
@ -71,7 +56,7 @@ spec:
|
|||||||
- key: "app"
|
- key: "app"
|
||||||
operator: In
|
operator: In
|
||||||
values:
|
values:
|
||||||
- tb-headless
|
- tb-service
|
||||||
topologyKey: "kubernetes.io/hostname"
|
topologyKey: "kubernetes.io/hostname"
|
||||||
containers:
|
containers:
|
||||||
- name: tb
|
- name: tb
|
||||||
@ -109,19 +94,17 @@ spec:
|
|||||||
configMapKeyRef:
|
configMapKeyRef:
|
||||||
name: tb-config
|
name: tb-config
|
||||||
key: cassandra.url
|
key: cassandra.url
|
||||||
|
- name : RPC_HOST
|
||||||
|
valueFrom:
|
||||||
|
fieldRef:
|
||||||
|
fieldPath: status.podIP
|
||||||
command:
|
command:
|
||||||
- sh
|
- sh
|
||||||
- -c
|
- -c
|
||||||
- ./run_thingsboard.sh
|
- ./run_thingsboard.sh
|
||||||
# readinessProbe:
|
|
||||||
# httpGet:
|
|
||||||
# path: /login
|
|
||||||
# port: ui-port
|
|
||||||
# initialDelaySeconds: 30
|
|
||||||
# periodSeconds: 10
|
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /login
|
path: /login
|
||||||
port: ui-port
|
port: ui-port
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 120
|
||||||
periodSeconds: 10
|
timeoutSeconds: 10
|
||||||
Loading…
x
Reference in New Issue
Block a user