groups:
  - name: "Container Image"
    description: "Image to be used for container"
  - name: "Controller"
    description: "Configure workload deployment"
  - name: "Container Configuration"
    description: "additional container configuration"
  - name: "App Configuration"
    description: "App specific config options"
  - name: "Networking and Services"
    description: "Configure Network and Services for container"
  - name: "Storage and Persistence"
    description: "Persist and share data that is separate from the container"
  - name: "Ingress"
    description: "Ingress Configuration"
  - name: "Security and Permissions"
    description: "Configure security context and permissions"
  - name: "Resources and Devices"
    description: "Specify resources/devices to be allocated to workload"
  - name: "Advanced"
    description: "Advanced Configuration"
portals:
  web_portal:
    protocols:
      - "$kubernetes-resource_configmap_portal_protocol"
    host:
      - "$kubernetes-resource_configmap_portal_host"
    ports:
      - "$kubernetes-resource_configmap_portal_port"
questions:
  - variable: portal
    group: "Container Image"
    label: "Configure Portal Button"
    schema:
      type: dict
      hidden: true
      attrs:
        - variable: enabled
          label: "Enable"
          description: "enable the portal button"
          schema:
            hidden: true
            editable: false
            type: boolean
            default: true

  - variable: hostNetwork
    group: "Networking and Services"
    label: "Enable Host Networking"
    schema:
      type: boolean
      default: false

  - variable: ports
    label: "(Advanced) Traefik Entrypoints"
    group: "Networking and Services"
    schema:
      type: dict
      attrs:
        - variable: traefik
          label: "traefik internal"
          schema:
            type: dict
            attrs:
              - variable: port
                label: "Internal Port"
                description: "(advanced) Port inside the container network"
                schema:
                  type: int
                  required: true
                  hidden: true
                  default: 9000
              - variable: expose
                label: "Expose to Outside"
                description: "Port to the outside of all(!) nodes"
                schema:
                  type: boolean
                  default: true
              - variable: exposedPort
                label: "Outside Port"
                description: "Port on the outside"
                schema:
                  type: int
                  show_if: [["expose", "=", true]]
                  default: 9000
              - variable: protocol
                label: "Protocol"
                description: "TCP or UDP reverse proxying?"
                schema:
                  type: string
                  default: "TCP"
        - variable: web
          label: "web"
          schema:
            type: dict
            attrs:
              - variable: port
                label: "Internal Port"
                description: "(advanced) Port inside the container network"
                schema:
                  type: int
                  required: true
                  hidden: true
                  default: 9080
              - variable: expose
                label: "Expose to Outside"
                description: "Port to the outside of all(!) nodes"
                schema:
                  type: boolean
                  default: true
              - variable: exposedPort
                label: "Outside Port"
                description: "Port to the outside of all(!) nodes"
                schema:
                  type: int
                  show_if: [["expose", "=", true]]
                  required: true
                  default: 9080
              - variable: protocol
                label: "Protocol"
                description: "TCP or UDP reverse proxying?"
                schema:
                  type: string
                  required: true
                  default: "TCP"
                  hidden: true
              - variable: redirectEnable
                label: "Enable Redirect"
                schema:
                  type: boolean
                  default: true
                  show_subquestions_if: true
                  subquestions:
                    - variable: redirectTo
                      label: "Target Entrypoint"
                      description: "Select the Target Entrypoint to redirect to"
                      schema:
                        type: string
                        required: true
                        default: "websecure"
        - variable: websecure
          label: "websecure"
          schema:
            type: dict
            attrs:
              - variable: port
                label: "Internal Port"
                description: "(advanced) Port inside the container network"
                schema:
                  type: int
                  required: true
                  hidden: true
                  default: 9443
              - variable: expose
                label: "Expose to Outside"
                description: "Port to the outside of all(!) nodes"
                schema:
                  type: boolean
                  default: true
              - variable: exposedPort
                label: "Outside Port"
                description: "Port to the outside of all(!) nodes"
                schema:
                  type: int
                  show_if: [["expose", "=", true]]
                  required: true
                  default: 9443
              - variable: protocol
                label: "Protocol"
                description: "TCP or UDP reverse proxying?"
                schema:
                  type: string
                  required: true
                  default: "TCP"
                  hidden: true

  ## TrueCharts Specific
  - variable: persistence
    label: "Integrated Persistent Storage"
    group: "Storage and Persistence"
    schema:
      type: dict
      attrs:
        - variable: config
          label: "App Config Storage"
          description: "Stores the Application Configuration."
          schema:
            type: dict
            attrs:
              - variable: enabled
                label: "Enable the storage"
                schema:
                  type: boolean
                  default: true
              - variable: storageClass
                label: "Type of Storage"
                description: " Warning: Anything other than SCALE-ZFS will break rollback!"
                schema:
                  type: string
                  default: "SCALE-ZFS"
              - variable: mountPath
                label: "mountPath"
                description: "Path inside the container the storage is mounted"
                schema:
                  type: string
                  default: "/data"
                  hidden: true
              - variable: emptyDir
                label: "EmptyDir Volume"
                schema:
                  type: dict
                  attrs:
                    - variable: enabled
                      label: "Use emptyDir volume"
                      schema:
                        type: boolean
                        default: false
                        show_subquestions_if: true
                        subquestions:
                          - variable: medium
                            label: "EmptyDir Medium"
                            schema:
                              type: string
                              default: ""
                              enum:
                                - value: ""
                                  description: "Default"
                                - value: "Memory"
                                  description: "Memory"
              - variable: accessMode
                label: "Access Mode (Advanced)"
                description: "Allow or disallow multiple PVC's writhing to the same PVC"
                schema:
                  type: string
                  default: "ReadWriteOnce"
                  enum:
                    - value: "ReadWriteOnce"
                      description: "ReadWriteOnce"
                    - value: "ReadOnlyMany"
                      description: "ReadOnlyMany"
                    - value: "ReadWriteMany"
                      description: "ReadWriteMany"
              - variable: size
                label: "Size quotum of storage"
                schema:
                  type: string
                  default: "1Gi"


  - variable: securityContext
    group: "Security and Permissions"
    label: "Security Context"
    schema:
      type: dict
      attrs:
        - variable: privileged
          label: "Enable privileged mode for Common-Chart based charts"
          schema:
            type: boolean
            default: false
        - variable: runAsNonRoot
          label: "runAsNonRoot"
          schema:
            type: boolean
            default: true
        - variable: runAsUser
          label: "runAsUser"
          description: "The UserID of the user running the application"
          schema:
            type: int
            default: 65532
        - variable: runAsGroup
          label: "runAsGroup"
          description: The groupID this App of the user running the application"
          schema:
            type: int
            default: 65532



  - variable: podSecurityContext
    group: "Security and Permissions"
    label: "Pod Security Context"
    schema:
      type: dict
      attrs:
        - variable: fsGroup
          label: "fsGroup"
          description: "The group that should own ALL storage."
          schema:
            type: int
            default: 65532
        - variable: fsGroupChangePolicy
          label: "When should we take ownership?"
          schema:
            type: string
            default: "OnRootMismatch"
            enum:
              - value: "OnRootMismatch"
                description: "OnRootMismatch"
              - value: "Always"
                description: "Always"

  - variable: resources
    group: "Resources and Devices"
    label: ""
    schema:
      type: dict
      attrs:
        - variable: limits
          label: "Advanced Limit Resource Consumption"
          schema:
            type: dict
            attrs:
              - variable: cpu
                label: "CPU"
                schema:
                  type: string
                  default: "2000m"
              - variable: memory
                label: "Memory RAM"
                schema:
                  type: string
                  default: "2Gi"
        - variable: requests
          label: "Advanced Request minimum resources required"
          schema:
            type: dict
            attrs:
              - variable: cpu
                label: "CPU"
                schema:
                  type: string
                  default: "10m"
              - variable: memory
                label: "Memory RAM"
                schema:
                  type: string
                  default: "50Mi"
