apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: loraserverio
  name: lora-gateway-bridge
  labels:
    component: lora-gateway-bridge
spec:
  replicas: 2
  selector:
    matchLabels:
      component: lora-gateway-bridge
  template:
    metadata:
      labels:
        component: lora-gateway-bridge
    spec:
      initContainers:
        - name: wait-services
          image: busybox
          command: ['sh', '-c', 'until nslookup postgres.loraserverio.svc.cluster.local; do echo waiting service start; sleep 2; done;']
      containers:
        - name: lora-gateway-bridge
          image: loraserver/lora-gateway-bridge:3
          ports:
            - containerPort: 1700
              name: udp
              protocol: UDP
          volumeMounts:
            - name: lora-gateway-bridge
              mountPath: /etc/lora-gateway-bridge
      volumes:
        - name: lora-gateway-bridge
          configMap:
            name: lora-gateway-bridge-config
