6.4. Container Browser

The Container Browser shows the containers running in Docker or Kubernetes and starts a search or monitoring run on their log data. Open it from View ‣ Container Browser, with i-container-browser Container Browser on the main toolbar, or with Ctrl+G. On macOS, press Cmd+G. Only one Container Browser tab is open at a time.

The Container Browser reaches Docker and Kubernetes through the locally installed command-line interfaces docker and kubectl. Locate the containers you are interested in and create new search tabs from them. The browser has three panes, used left to right.

Note

The commands run on your own computer, but the containers they reach do not have to run there. Retrospective uses whatever those commands are configured to talk to; for kubectl this is normally a remote cluster. Containers need no entry in the Host Manager, and Retrospective keeps no credentials of its own for them. It uses the existing CLI configuration unchanged.

The Container Browser with its panes and toolbar controls called out

Fig. 6.20 The Container Browser, here showing a Kubernetes deployment.

  1. Subsystem list: choose the Docker or Kubernetes subsystem.

  2. i-container-configure-docker Configure Docker / i-container-configure-kubernetes Configure Kubernetes: set up the CLI when it cannot be found.

  3. Directory navigator: browse the container structure of the selected subsystem.

  4. Label selectors: for a Kubernetes deployment, the selectors that determine which pods belong to it.

  5. Container selection: check the containers to include.

  6. Selection mode and filter: select the containers individually or through a filter, and narrow the list by name.

  7. Start search or monitoring: the buttons that open a new search tab for the selected containers.

6.4.1. Choosing a Subsystem

Pick a subsystem in the list on the left. The list holds one Docker entry and one entry per context in the local kubectl configuration, for example K8s kind-kind. A single Kubernetes entry is shown in place of these contexts while they are being read. On selection, Retrospective reads the structure of the subsystem through its CLI and shows it in the directory navigator. If the CLI cannot be found, an error bar above the panes says why and offers a link to the setup. You can also click i-container-configure-docker Configure Docker or i-container-configure-kubernetes Configure Kubernetes above the list; each opens the matching page of the Preferences dialog. i-refresh Reload on the same toolbar reads the kubectl configuration again, so a cluster added later appears without a restart. The list is also read again whenever you return to the tab.

Navigate to the level that contains the containers you want to search or monitor. Double-click an entry to open it; the .. entry at the top navigates to the parent level.

The path bar above the directory navigator and the container selection pane shows the current location as clickable segments. Click a segment to go directly to that level. If the path is too long for the window, point to it to read it in full.

6.4.2. Filtering Pods with Label Selectors

In a Kubernetes subsystem, levels that list pods can be narrowed with label selectors. When the current listing carries labels, the Label selectors panel appears between the path bar and the list. Retrospective reads labels for Kubernetes only, so the panel never appears for Docker or on levels without labelled entries.

Each row of the panel is one selector with a Key, an Operator and, depending on the operator, the Value(s) column. The key and value cells offer the labels found in the current listing; you can also type your own. i-info-bullet next to the panel title summarizes the operators. Label selectors are currently supported for pods only.

Operator

Selects all resources …

equal

with the given key equal to the given value.

not equal

with the given key not equal to the given value.

in

with the given key equal to any of the given values.

not in

with the given key not equal to any of the given values.

exists

that include a label with the given key.

not exists

without a label with the given key.

For in and not in, the Value(s) cell opens the Choose Values chooser. Check the values you want, add one with i-label-selector-add Add value if needed, and confirm with i-label-selector-apply Accept.

The toolbar of the panel manages the selectors: i-label-selector-add Add new label selector, i-label-selector-delete Delete selected label selector, i-label-selector-move-up Move up and i-label-selector-move-down Move down. A new selector starts with equal, the first key not yet used by another selector, and its first value. Your edits take effect when you click i-label-selector-apply Apply label selectors: Retrospective reloads the listing and shows only the pods that match all selectors. If a selector is invalid, the Invalid Label Selector warning names the first invalid entry, and the listing stays unchanged.

Point to a cell to see in its tooltip which pods the selector matches. An invalid key or value shows an error icon in its cell, and the tooltip then names the problem in red.

Label selectors belong to the level you defined them on; navigating up to the parent level discards them. Inside a deployment, the deployment’s own selectors already determine its pods; selectors you add narrow that set further. Locations recorded in the directory history keep their label selectors; the Include label selectors in directories history option on the Kubernetes preferences page controls whether the history entries show them. A location you visit in two Kubernetes contexts has its own history entry for each context.

6.4.3. Selecting Containers

In the container selection pane you choose the containers and how they are matched. Select the check box in front of one or more containers, or right-click a container and choose Start searching or Start monitoring. If no container is checked, the container you right-clicked is checked for you. The tab opens in individual mode. i-sel-mode-item Choose container selection mode offers two ways of selecting:

Icon

Selection mode

i-sel-mode-item

Select items individually: lets you select individual containers from the open level. A filter narrows the list: a container appears only if its name matches the filter. The filter accepts the wildcards ? and *.

i-sel-mode-group

Select items using filter: selects every container in the open level whose name matches a filter expression. An empty filter or * selects all containers; *validator selects all whose name ends in validator; billing* selects all whose name starts with billing. The filter accepts the wildcards ? and *. Clicking a row copies its name into the filter.

When your selection is ready, click i-file-browser-search Create new tab for searching in selected data source(s) or i-file-browser-monitor Create new tab for monitoring selected data source(s). The buttons are available when at least one container is selected.

After working elsewhere in Retrospective you can return to the Container Browser at any time and find the context from which you last triggered a search or monitoring action.

The item table has the columns Name, ID, Created and Image; the directory navigator Name and Created. The check box in the header selects all containers, and clicking a row toggles its check box. The arrow in the path field, or ↓, lists previously visited locations.

6.4.4. Toolbar Controls

The toolbar above the panes gathers the configuration, navigation and selection controls.

The Container Browser toolbar with its controls called out

Fig. 6.21 The Container Browser toolbar: the subsystem and directory controls (top) and the container selection toolbar (bottom).

  1. i-container-add-timestamps / i-container-no-timestamps Docker timestamps: switch whether Docker adds its own timestamps to the log entries it delivers. The tooltip names the action, for example Let Docker add timestamps to delivered log entries of the selected data source(s). The setting is saved at once.

  2. i-container-configure-docker Configure Docker: open the Docker preferences to set up the docker CLI.

  3. i-container-configure-kubernetes Configure Kubernetes: open the Kubernetes preferences to set up the kubectl CLI.

  4. Current location: the path of the open level; type it or pick a previously visited location. Picking one also selects its subsystem in the list on the left. Its tooltip reads Directory path accepts wildcards (‘*’ and ‘?’).

  5. i-browser-home Navigate to home directory: return to the top of the selected subsystem, or for Kubernetes to the Preselected root directory when one is set.

  6. i-refresh Reload: reload the container structure of the open level.

  7. i-sel-mode-item Choose container selection mode.

  8. Name filter: limit the listed containers to those whose name matches the expression (wildcards ? and *); the drop-down lists previously used filters.

  9. Create new tab for searching in selected data source(s).

  10. Create new tab for monitoring selected data source(s).

Two further i-refresh Reload buttons carry no callout: the one left of the timestamp toggle reloads the subsystem list, and the one left of the start buttons reloads the containers of the open level.