Migrating custom Support Bundle configuration


#1

Replicated built-in support bundles

Any Replicated installation has a built-in way to generate support bundles. These can include custom files collected from application containers and output from commands that also run in application containers. General format looks like this (starting at the root element)

support:
  timeout: 300
  files:
    - filename: ...
      source:
        replicated:
          component: Nginx
          container: my-nginx
....
  commands:
    - command: [tail, -n1000, /var/log/nginx/access.log]
      filename: ...
      source:
        replicated:
          component: Nginx
          container: my-nginx
...

More information can be found in Replicated Help Center for Native and Swarm schedulers.

Troubleshoot

The Troubleshoot product allows more flexibility in customizing support bundles. More information is available in Replicated Help Center, and full spec can be found here.

files:

Container files can be included by defining docker.container-cp item for each file or directory to be collected.

collect:
  v1:
    - docker.container-cp:
        timeout_seconds: 300
        src_path: /var/log/nginx/access.log
        container: supergoodtool-www
        output_dir: /www/access/

In this block:

  • timeout_seconds is equivalent to the global timeout value
  • src_path is equivalent to filename
  • container is the container name from which to collect logs. It replaces the source section which identifies the containers associated with the Replicated component/container YAML section. However this requires that container be named. As an alternative, the new support bundle allows selecting containers by labels. In case of Swarm, service names can also be specified.
  • output_dir has no equivalent in the original format. The value of src_path would be used to generate the path in the support bundle.

commands:

Commands can be executed in application containers and their output included in support bundle by defining docker.container-exec item for each command.

collect:
  v1:
    - docker.container-exec:
        timeout_seconds: 300
        exec_config:
          Cmd:
            - nginx
            - '-t'
        container: supergoodtool-www
        output_dir: /www/debug/

In this block:

  • timeout_seconds is equivalent to the global timeout value
  • exec_config is equivalent to command
  • container is the container name in which the command will be executed. It replaces the source section which identifies the containers associated with the Replicated component/container YAML section. However this requires that container be named. As an alternative, the new support bundle allows selecting containers by labels. In case of Swarm, service names can also be specified.
  • output_dir replaces filename

#2

Trying to use this for docker swarm did not help.

Followed the instructions here:
https://help.replicated.com/docs/swarm/packaging-an-application/support-bundle/

but could not manage to fetch an additional file from the container.

tried both:
support:
files:
- filename: /mnt/log_drive/jboss_logs/server.log
source:
swarm:
service: liveuluc

support:
files:
- filename: /mnt/log_drive/jboss_logs/server.log
swarm:
service: liveuluc


#3

Ohad,

I believe we need to update those docs a little! There are two different ways to set what files are collected depending on whether your customer is using the ‘external’ support bundle (also known as ‘V2’) or the built-in version. This can be set with a toggle on the license page:


If the toggle does not appear on the license page, external is enabled. External is what @dmitriy was referring to above as ‘Troubleshoot’.

Built-in support bundles are configured with the method you’ve described - a ‘support’ entry in the Replicated YAML.

support:
  timeout: 300
  files:
    - filename: /etc/os-release
      source:
        replicated:
          component: Nginx
          container: my-nginx

External bundles, which you are likely using, are configured slightly differently. Rather than being a part of the Replicated YAML, they are instead maintained separately in Replicated Console’s Troubleshoot page. The default spec there is what will be fetched when a customer generates a support bundle or an airgap license is produced.