apiVersion: apps/v1
kind: Deployment
metadata:
  name: starling-drones
  labels:
    app: starling
    platform: pixhawk
spec:
  selector: 
    matchLabels:
      app: starling
  template:
    metadata:
      name: starling-drone
      labels: 
        app: starling
        platform: pixhawk
    spec:
      hostNetwork: true
      shareProcessNamespace: true
      containers:
        - name: starling-mavros
          image: uobflightlabstarling/starling-mavros:latest
          imagePullPolicy: Always
          securityContext:
            privileged: true
          env:
          - name: VEHICLE_NAMESPACE
            valueFrom:
              fieldRef:
                fieldPath: metadata.name
          - name: MAVROS_TGT_FIRMWARE
            value: "px4"
          - name: MAVROS_TGT_SYSTEM
            value: "auto" # Look up on system /etc/drone.config
          - name: ROS_HOSTNAME # Required for ROS1 bridge in hostNetwork mode
            value: "localhost" # ROS1 will ping HOSTNAME, defaults to system hostname
          - name: ROS_MASTER_URI
            value: "http://localhost:11311"
          volumeMounts:
          - mountPath: /dev/px4fmu
            name: ttypx4
          - mountPath: /etc/starling/vehicle.config
            name: vehicleconfig
            readOnly: true
      volumes:
      - name: ttypx4
        hostPath:
          path: /dev/px4fmu
      - name: vehicleconfig
        hostPath:
          path: /etc/starling/vehicle.config
          type: File
      nodeSelector:
        kubernetes.io/arch: arm64
        # k3s.io/hostname: clover1