robolaunch / robot-operator

Kubernetes Robot Operator for ROS/2 Based Robots
https://robolaunch.github.io/robot-operator/
Apache License 2.0
24 stars 3 forks source link

PR: Manage Lifecycle of StatefulSet(s) of ROS2Workload #238

Closed tunahanertekin closed 8 months ago

tunahanertekin commented 8 months ago

:herb: PR: Manage Lifecycle of StatefulSet(s) of ROS2Workload

Description

Closes #230

Type of change

How can it be tested?

Can be tested with a sample manifest such as below:

apiVersion: robot.roboscale.io/v1alpha2
kind: ROS2Workload
metadata:
  name: ros2-workload
  namespace: test
  labels:
    robolaunch.io/cloud-instance: org-development-16891285
    robolaunch.io/cloud-instance-alias: dev-ci-076
    robolaunch.io/domain: robolaunch.cloud
    robolaunch.io/organization: org_development
    robolaunch.io/platform: 0.1.2-prerelease.10
    robolaunch.io/region: eu-central-1
    robolaunch.io/team: org-development-16891285
    robolaunch.io/robot-image-registry: docker.io
spec:
  discoveryServerTemplate:
    type: Server
    hostname: "zzz"
    subdomain: "ttt"
    domainID: 0
  ros2BridgeTemplate:
    distro: humble
    discoveryServerRef:
      name: ros2-workload-discovery
      namespace: test
    serviceType: NodePort
    ingress: true
    tlsSecretName: prod-tls
  containers:
  - replicas: 1
    container:
      name: slam
      image: ubuntu:focal
      command: ["/bin/bash", "-c", "sleep infinity"]
      volumeMounts:
      - name: ros2-workload-pvc-0
        mountPath: /testing-mount
  - replicas: 1
    container:
      name: nav
      image: ubuntu:focal
      command: ["/bin/bash", "-c", "sleep infinity"]
      volumeMounts:
      - name: ros2-workload-pvc-0
        mountPath: /testing-mount
      resources:
        requests:
          memory: "64Mi"
          cpu: "250m"
        limits:
          memory: "128Mi"
          cpu: "500m"
      securityContext:
        privileged: true
  volumeClaimTemplates:
  - spec:
      accessModes:
      - ReadWriteOnce
      resources:
        limits:
          storage: 1Gi
        requests:
          storage: 1Gi