apiVersion: apps/v1
kind: Deployment
metadata:
  name: turtlebot3-operator
  labels:
    app: turtlebot3-operator
    report: "true"
spec:
  replicas: 1
  selector:
    matchLabels:
      app: turtlebot3-operator
  template:
    metadata:
      labels:
        app: turtlebot3-operator
    spec:
      containers:
      - name: turtlebot3-operator
        image: "${EXTERNAL_HOST_IPADDR}:5000/tech-sketch/fiware-ros-turtlebot3-operator:0.2.0"
        imagePullPolicy: Always
        command:
        - "/opt/kube_entrypoint.sh"
        lifecycle:
          postStart:
            exec:
              command: ["/bin/sh", "-c", "sleep 5"]
          preStop:
            exec:
              command: ["/bin/sh", "-c", "sleep 5"]
        env:
        - name: ROS_HOSTNAME
          value: turtlebot3-operator
        - name: ROS_MASTER_URI
          value: http://ros-master:11311
        - name: CIRCLE_VELOCITIES_X
          value: '0.1'
        - name: CIRCLE_VELOCITIES_Z
          value: '0.4'
        - name: POLYGON_VELOCITIES_X
          value: '0.2'
        - name: POLYGON_VELOCITIES_Z
          value: '0.3'
        - name: POLYGON_EDGE_LENGTH
          value: '0.4'
        volumeMounts:
        - mountPath: "/etc/fiware_ros_turtlebot3_operator/configmaps"
          name: turtlebot3-operator-configmaps
          readOnly: true
        - mountPath: "/usr"
          name: usr
          readOnly: true
        - mountPath: "/lib"
          name: lib
          readOnly: true
        - mountPath: "/lib64"
          name: lib64
          readOnly: true
        - mountPath: "/etc/alternatives"
          name: etc-alternatives
          readOnly: true
        - mountPath: "/opt/ros"
          name: opt-ros
          readOnly: true
      volumes:
      - name: turtlebot3-operator-configmaps
        configMap:
          name: turtlebot3-operator-configmaps
      - name: usr
        hostPath:
          path: "/usr"
          type: Directory
      - name: lib
        hostPath:
          path: "/lib"
          type: Directory
      - name: lib64
        hostPath:
          path: "/lib64"
          type: Directory
      - name: etc-alternatives
        hostPath:
          path: "/etc/alternatives"
          type: Directory
      - name: opt-ros
        hostPath:
          path: "/opt/ros"
          type: Directory
