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)
      Notes:
        - name: Must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character.
        - description: lines cannot have additional colons in them.
    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
      - name: firestorm
        description: This event is to perform log collection for the FireStorm components on a FireTap node.
        subsystems:
          - bundle_firestorm_logs
      - name: firefly
        description: This event is to perform log collection for the FireFly components on a FireTap node.
        subsystems:
          - bundle_firefly_logs
      - name: dbs
        description: This event is to perform log collection for the Distributed Block Store (DBS) components on a FireTap node.
        subsystems:
          - bundle_element_logs
      - name: admin
        description: This event is to perform log collection for the configuration and admin components on a FireTap node.
        subsystems:
          - bundle_admin_logs
      - name: services
        description: This event is to perform collection of the services logs on a FireTap node.
        subsystems:
          - bundle_svc_logs
      - name: events
        description: This event is to perform collection of the event (EMS) logs on a FireTap node.
        subsystems:
          - bundle_event_logs
      - name: mgmt
        description: This event is to perform collection of the management logs on a FireTap node.
        subsystems:
          - bundle_mgmt_logs
      - name: netwd
        description: This event is to perform collection of the Network Watchdog logs on a FireTap node.
        subsystems:
          - bundle_netwd_logs
      - name: config
        description: This event is to perform collection of the configuration logs on a FireTap node.
        subsystems:
          - bundle_config_logs
      - name: status
        description: This event is to perform collection of the OS and Database logs on a FireTap node.
        subsystems:
          - bundle_status_logs
      - name: status-full
        description: This event is to perform collection of the full OS and Database logs on a FireTap node.
        subsystems:
          - bundle_status_full_logs
      - name: html-reports
        description: This event is to perform collection of the HTML report pages for the FireTap cluster.
        subsystems:
          - bundle_html_reports
      - name: json-reports
        description: This event is to perform collection of the JSON report pages for the FireTap cluster.
        subsystems:
          - bundle_json_reports
      - name: database
        description: This event is to perform log collection for the database component of a FireTap cluster.  Note, to be effective, this request must be directed to an Ensemble member node hosting the database service (see ensemble HTML and JSON reports for which nodes these are).
        subsystems:
          - bundle_zookeeper
    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: ""
            resources:
              - kind: Node
      - name: astra.Events
        description: >-
          The Events in the astrads-system.
        kubernetes:
          - namespace: ""
            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
      Notes:
        - description: lines cannot have additional colons in them.
    subsystems:
      - name: bundle_max
        description: >-
          The list of contents to collect for bundle_max subsystem in
          storage system. This basically collects everything FireTap related. Use time-range to control size.
        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_aux 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.
          Used for EMS callhome event collection and intended to be a general overview of recent node activity.
        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 json_reports_aux firegen_logs' # Same as bundle_max, but with only "latest" logs and smaller reports
            type: bundle_collect
      - name: bundle_firestorm_logs
        description: >-
          The list of contents to collect for bundle_firestorm_logs subsystem in
          storage system. These are FireStorm-only logs
        subdir: firetap
        commands:
          - command: 'fsm_svc_logs firestorm_event_logs firestorm_logs'
            type: bundle_collect
      - name: bundle_firefly_logs
        description: >-
          The list of contents to collect for bundle_firefly_logs subsystem in
          storage system. These are FireFly-only logs
        subdir: firetap
        commands:
          - command: 'ffm_svc_logs firefly_event_logs firefly_logs'
            type: bundle_collect
      - name: bundle_element_logs
        description: >-
          The list of contents to collect for bundle_element_logs subsystem in
          storage system. These are Element-only (DBS) only logs.
        subdir: firetap
        commands:
          - command: 'element_svc_logs element_event_logs'
            type: bundle_collect
      - name: bundle_admin_logs
        description: >-
          The list of contents to collect for bundle_admin_logs subsystem in
          storage system. This includes config, install and node management logs.
        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_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_logs
        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_status_full_logs
        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_aux json_reports_large'
            type: bundle_collect
      - name: bundle_zookeeper
        description: >-
          The list of contents to collect for the ZooKeeper database subsystem in
          storage system
        subdir: firetap
        commands:
          - command: 'zookeeper'
            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 custom resources (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
