# Specify your controller as a deployment
# If the controller dockerfile CMD completes succesfully the pod will automatically restart
# apiVersion: apps/v1
# kind: Deployment # Specifies that this container can be replicated automatically
# metadata:
#   name: s-example-controller-python # Unique name of deployment
#   labels: # labels to attach to this specific deployment
#     app: starling
#     function: controller
# spec:
#   selector: # specifies the labels of the pods which this deployment manages
#     matchLabels:
#       app: starling
#       function: controller
#   template: # template of the pod
#     metadata:
#       labels: # labels to attach to this pod
#         app: starling
#         function: controller
#     spec:
#       # sharing pid required to avoid ros2 guid conflicts
#       shareProcessNamespace: true
#       containers: # Add your containers here ot the pod
#       - name: s-example-controller-python # Name of container, must be unique.
#         image: example_controller_python # Name of the docker image of your container
#         imagePullPolicy: IfNotPresent # Required for local containers
#         env:
#           - name: TARGET_NAME
#             value: 'starling_px4_sitl_0'
#       nodeSelector:
#         kubernetes.io/arch: "amd64"
---
# Specifying controller as a single POD
# This runs without any replication or failure controller
# Completion will see the pod have status Completed and manual restart is required

apiVersion: v1
kind: Pod
metadata:
  name: s-example-controller-python
  labels: # labels to attach to this pod
    app: starling
    function: controller
spec:
  # sharing pid required to avoid ros2 guid conflicts
  hostNetwork: true
  shareProcessNamespace: true
  containers: # Add your containers here ot the pod
  - name: s-example-controller-python # Name of container, must be unique.
    image: uobflightlabstarling/example_controller_python # Name of the docker image of your container
    imagePullPolicy: Always # Use Always to ensure it is always pulling the most recent version of a repository container
    # env:
    # - name: TARGET_NAME
    #   value: 'starling_px4_sitl_0'
  nodeSelector:
    kubernetes.io/arch: "amd64"
  # restartPolicy: Never