apiVersion: v1
data:
  components.yaml: |
    description: >-
      components.yaml lists the subsystems to collect for each AutoSupport call home
      event trigger that a given component can generate. The content collected for
      each subsystem is defined in the content files corresponding to each component.
      Supported components include:
        - storage: Represents node and FireTap container
        - controlplane: Represents Kubernetes control plane
        - vasaprovider: Represents VASA (vStorage APIs for Storage Awareness)
    storage:
      - name: manual
        description: The manual event is to perform collection that will include all firetap collection, kubernetes pods and kubernetes CRs
        subsystems:
          - bundle_max
          - bundle_kubernetes_pods
          - bundle_kubernetes_crs
      - name: debug
        description: The debug event is to perform collection that will include all firetap collection and kubernetes pods
        subsystems:
          - bundle_max
          - bundle_kubernetes_pods
      - name: performance
        description: The performance event is to perform collection for performance related information from firetap. This collection has all the performance related information from firetap.
        subsystems:
          - bundle_perf
      - name: daily
        description: The daily event is to perform collection for daily health information from firetap. This collection has limited performance, storage object and service-related information from firetap.
        subsystems:
          - bundle_daily
      - name: default
        description: The default event is to perform collection that will include the latest firetap collection. Also all kubernetes pods and kubernetes CRs
        subsystems:
          - bundle_latest
          - bundle_kubernetes_pods
          - bundle_kubernetes_crs
    controlplane:
      - name: manual
        description: The manual event is to perform collection for Kubernetes CRs and Pods
        subsystems:
          - astra.CRs
          - astra.Pods
          - astra.Nodes
          - astra.Events
      - name: adsclustercreatesuccess
        description: The adsclustercreatesuccess event is to perform collection for Kubernetes CRs and Pods
        subsystems:
          - astra.CRs
          - astra.Pods
          - astra.Nodes
          - astra.Events
      - name: debug
        description: The debug event is to perform collection for Kubernetes CRs and Pods
        subsystems:
          - astra.CRs
          - astra.Pods
          - astra.Nodes
          - astra.Events
      - name: daily
        description: The daily event is to perform collection for Kubernetes CRs and Pods
        subsystems:
          - astra.CRs
          - astra.Pods
          - astra.Nodes
          - astra.Events
    vasaprovider:
      - name: manual
        description: User Triggered support collection
        subsystems:
          - vasa.basic
      - name: debug
        description: Subsystems for debug call home event of vasa provider components
        subsystems:
          - vasa.basic
  controlplane-content.yaml: |
    description: >-
      The controlplane-content.yaml defines this list of commands, files and directories that the
      control plane AutoSupport collector can gather. They are grouped into subsystems.
      components.yaml defines which subsystems to collect for a given AutoSupport trigger
      Each group contains:
      - name: The name of the subsystem name
      - description: Optional description of the subsystem
      - subdir: Optional subdirectory in the autosupport bundle where the subsystem collection is to be placed
      - commands: List of command output to collect. If no command is to be executed, this list need not be populated
        - command: The command to run to collect the output
        - filename: Filename containing the command output in the support bundle
        - type: Type of command. For controlplane, the supported type in command are:
          - 'linux': Invokes Linux commands
      - files: List of files to collect. If no file is to be collected, this list need not be populated
        - source: Full path of the file to collect from the view point of the container (Autosupport controller)
        - filename: Destination filename in the support bundle
      - directories: List of directories to be compressed and collected. If no directory is to be collected, this list need not be populated
        - path: Directory path to be collected and compressed
      - kubernetes: List of namespaces and its resources information which we would want to collect.
        - namespace: The namespace from which we would want to collect.
        - resources: Information of the resources to collect.
          - kind: Kind of resource Eg. Pod, AstraDSCluster, Job, Deplopyments etc.
          - filter: The filter information for the resource.
            - name: The name of the resources we would want to collect. Eg. controlplane-autosupport-example for asup. cluster-multinode
                    for astradscluster.
            - labelSelector: The label selector for the resources. Eg. app=astrads-deployment-support for Pod etc.
                Note: It should follow all the rules laid out by "https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse"
            - fieldSelector: The field selector for resource. Eg. status.phase=Running for Pod . Note: For more information on field selector,
                 "https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/".
        - previousLogs: This option is for Pods. If specified to true it returns previous terminated container logs
    subsystems:
      - name: astra.CRs
        description: >-
          Collect the Astra DS custom resources
        kubernetes:
          - namespace: ""
            resources:
             - kind: AstraDSCluster
             - kind: AstraDSLicense
             - kind: AstraDSFailedDrive
             - kind: AstraDSAutoSupport
             - kind: AstraDSExportPolicy
             - kind: AstraDSVersion
             - kind: AstraDSNodeInfo
             - kind: AstraDSVolumeFiles
             - kind: AstraDSVolume
             - kind: AstraDSVolumeSnapshot
      - name: astra.Pods
        description: >-
          The Pods in the astrads-system. astrads-ds-support is filtered out for now
          because the fluentbit container is logging to the console and collecting
          its log is excessive
        kubernetes:
          - namespace: astrads-system
            resources:
              - kind: Pod
                previousLogs: true
      - name: astra.Nodes
        description: >-
          The Nodes in the Kubernetes Cluster.
        kubernetes:
          - namespace: astrads-system
            resources:
              - kind: Node
      - name: astra.Events
        description: >-
          The Events in the astrads-system.
        kubernetes:
          - namespace: astrads-system
            resources:
              - kind: Event
                filter:
                  fieldSelector: involvedObject.kind=AstraDSCluster
              - kind: Event
                filter:
                  fieldSelector: involvedObject.kind=AstraDSVolume
              - kind: Event
                filter:
                  fieldSelector: involvedObject.kind=AstraDSExportPolicy
  storage-content.yaml: |
    description: >-
      The storage-content.yaml defines this list of commands, files and directories that the
      storage AutoSupport collector can gather. They are grouped into subsystems.
      components.yaml defines which subsystems to collect for a given AutoSupport trigger
      Each group contains:
      - name: The name of the subsystem
      - description: Optional description of the subsystem
      - subdir: Optional subdirectory in the AutoSupport bundle where the subsystem collection is to be placed
      - commands: List of command output to collect. If no command is to be executed, this list need not be populated
        - command: The list of collections that need to be passed to the bundle_collector script.
        - filename: Filename containing the command output in the support bundle
        - type: Type of command. For storage, the supported type in command is
          - bundle_collect: Invokes the bundle_collector script which in-turn invokes linux/firestorm/firefly commands.
      - files: List of files to collect. If no file is to be collected, this list need not be populated
        - source: Full path of the file to collect from the view point of the container (Autosupport controller)
        - filename: Destination filename in the support bundle
      - directories: List of directories to be compressed and collected. If no directory is to be collected, this list need not be populated
        - path: Directory path to be collected and compressed
      - kubernetes: List of namespaces and its resources information which we would want to collect.
        - namespace: The namespace from which we would want to collect.
        - resources: Information of the resources to collect.
          - kind: Kind of resource Eg. Pod, AstraDSCluster, Job, Deplopyments etc.
          - filter: The filter information for the resource.
            - name: The name of the resources we would want to collect. Eg. controlplane-autosupport-example for asup. cluster-multinode
                    for astradscluster.
            - labelSelector: The label selector for the resources. Eg. app=astrads-deployment-support for Pod etc.
                Note: It should follow all the rules laid out by "https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse"
            - fieldSelector: The filed selector for resource. Eg. status.phase=Running for Pod . Note: For more information on field selector,
                 "https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/".
        - previousLogs: This option is for Pods. If specified to true it returns previous terminated container logs
    subsystems:
      - name: bundle_max
        description: >-
          The list of contents to collect for bundle_max subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'svc_logs mgmt_logs firestorm_logs firefly_logs event_logs netwd_logs config status status_large html_reports html_reports_large json_reports json_reports_large firegen_logs'
            type: bundle_collect
      - name: bundle_latest
        description: >-
          The list of contents to collect for bundle_latest subsystem in
          storage system. Only collects the latest version of the storage system log files, to reduce bundle size.
        subdir: firetap
        commands:
          - command: 'svc_logs_latest mgmt_logs_latest firestorm_logs_latest firefly_logs_latest netwd_logs_latest event_logs_latest config status html_reports json_reports firegen_logs' # Same as bundle_max, but with only "latest" logs and smaller reports
            type: bundle_collect
      - name: bundle_sms_logs
        description: >-
          The list of contents to collect for bundle_sms_logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'svc_logs event_logs firestorm_logs'
            type: bundle_collect
      - name: bundle_dms_logs
        description: >-
          The list of contents to collect for bundle_dms_logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'svc_logs event_logs firestorm_logs firefly_logs'
            type: bundle_collect
      - name: bundle_cluster_logs
        description: >-
          The list of contents to collect for bundle_cluster subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'mgmt_logs config firegen_logs'
            type: bundle_collect
      - name: bundle_svc_logs
        description: >-
          The list of contents to collect for service logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'svc_logs'
            type: bundle_collect
      - name: bundle_event_logs
        description: >-
          The list of contents to collect for event logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'event_logs'
            type: bundle_collect
      - name: bundle_mgmt_logs
        description: >-
          The list of contents to collect for management logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'mgmt_logs'
            type: bundle_collect
      - name: bundle_firestorm_logs
        description: >-
          The list of contents to collect for firestorm logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'firestorm_logs'
            type: bundle_collect
      - name: bundle_firefly_logs
        description: >-
          The list of contents to collect for firefly logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'firefly_logs'
            type: bundle_collect
      - name: bundle_netwd_logs
        description: >-
          The list of contents to collect for netwd logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'netwd_logs'
            type: bundle_collect
      - name: bundle_config_logs
        description: >-
          The list of contents to collect for config logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'config'
            type: bundle_collect
      - name: bundle_status
        description: >-
          The list of contents to collect for status of the host and storage system
        subdir: firetap
        commands:
          - command: 'status'
            type: bundle_collect
      - name: bundle_detailed_status
        description: >-
          The list of contents to collect for status of the host and storage system
          with more detailed information from the host.
        subdir: firetap
        commands:
          - command: 'status status_large'
            type: bundle_collect
      - name: bundle_perf
        description: >-
          The list of contents to collect for performance logs subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'perf'
            type: bundle_collect
      - name: bundle_daily
        description: >-
          The list of contents to collect for monitoring health of the storage system
        subdir: firetap
        commands:
          - command: 'perf-monitoring event_logs_latest html_reports json_reports'
            type: bundle_collect
      - name: bundle_html_reports
        description: >-
          The list of contents to collect for html reports subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'html_reports html_reports_large'
            type: bundle_collect
      - name: bundle_json_reports
        description: >-
          The list of contents to collect for json reports subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'json_reports json_reports_large'
            type: bundle_collect
      - name: bundle_kubernetes_pods
        description: >-
          The k8s collection corresponding to all the pods
        subdir: bundle_kubernetes_pods
        kubernetes:
          - namespace: astrads-system
            resources:
              - kind: Pod
                filter:
                  labelSelector: # Edit based on the label decided after consistent labeling.
                previousLogs: true
      - name: bundle_kubernetes_crs
        description: >-
          The k8s collection corresponding to all the crs
        subdir: bundle_kubernetes_crs
        kubernetes:
          - namespace: astrads-system
            resources:
              - kind: AstraDSCluster
              - kind: AstraDSVolume
                filter:
                  fieldSelector: # Edit based on certain field in AstraDSVolume CR.
              - kind: AstraDSExportPolicy
              - kind: AstraDSVersion
              - kind: AstraDSVolumeFiles
              - kind: AstraDSQosPolicy
              - kind: AstraDSNodeInfo
              - kind: AstraDSFailedDrive
              - kind: AstraDSVolumeSnapshot
  vasaprovider-content.yaml: |
    description: >-
      vasaprovider-content.yaml defines a list of commands, files and directories that the
      VASA provider AutoSupport collector can gather. They are grouped into subsystems.
      components.yaml defines which subsystems to collect for a given AutoSupport trigger
      Each group contains:
      - name: The name of the subsystem name
      - description: Optional description of the subsystem
      - subdir: Optional subdirectory in the AutoSupport bundle where the subsystem collection is to be placed.
      - commands: List of command output to collect. If no command is to be executed, this list need not be populated
        - command: The command to run to collect the output
        - filename: Filename containing the command output in the support bundle
        - type: Type of command. For vasaprovider, the supported type in command is:
          - 'linux': Invokes Linux commands
      - files: List of files to collect. If no file is to be collected, this list need not be populated
        - source: Full path of the file to collect from the view point of the container (AutoSupport controller)
        - filename: Destination filename in the support bundle
      - directories: List of directories to be compressed and collected. If no directory is to be collected, this list need not be populated
        - path: Directory path to be collected and compressed
      - kubernetes: List of namespaces and its resources information which we would want to collect.
        - namespace: The namespace from which we would want to collect.
        - resources: Information of the resources to collect.
          - kind: Kind of resource Eg. Pod, AstraDSCluster, Job, Deplopyments etc.
          - filter: The filter information for the resource.
            - name: The name of the resources we would want to collect. Eg. controlplane-autosupport-example for asup. cluster-multinode
                    for astradscluster.
            - labelSelector: The label selector for the resources. Eg. app=astrads-deployment-support for Pod etc.
                Note: It should follow all the rules laid out by "https://pkg.go.dev/k8s.io/apimachinery/pkg/labels#Parse"
            - fieldSelector: The filed selector for resource. Eg. status.phase=Running for Pod . Note: For more information on field selector,
                 "https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/".
        - previousLogs: This option is for Pods. If specified to true it returns previous terminated container logs
    subsystems:
      - name: vasa.basic
        description: >-
          Basic content for a generic VASA provider asup
          VASA provider
        commands:
          - command: df -h
            filename: df-h.txt
            type: linux
        files:
          - source: /proc/1/mountstats
            filename: proc-mountstats.txt
        directories:
          - path: /tmp
        kubernetes:
          - namespace: astrads-system
            resources:
              - kind: Pod
                filter:
                  labelSelector: # Edit based on the label decided after consistent labeling.
                previousLogs: true
              - kind: Deployment
              - kind: AutoSupport
                filter:
                 name: controlplane-autosupport-example
              - kind: AstraDSCluster
              - kind: AstraDSLicense
              - kind: AstraDSVolume
                filter:
                  fieldSelector: # Edit based on certain field in AstraDSVolume CR.
              - kind: AstraDSExportPolicy
              - kind: AstraDSVersion
              - kind: AstraDSNFSOption
              - kind: AstraDSCloudSnapshot
kind: ConfigMap
metadata:
  labels:
    product: astrads
  name: astrads-autosupport-cm
