Skip to content

Commit 1813c59

Browse files
authored
Complete removal of shipper support along with documentation (#5308)
* Complete removal of shipper support. * Fix imports. * Add changelog entry. * Remove createProcessorsForJSONInput
1 parent 3349a8f commit 1813c59

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+230
-4318
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -57,5 +57,4 @@ fleet.yml
5757
fleet.yml.lock
5858
fleet.yml.old
5959
pkg/component/fake/component/component
60-
pkg/component/fake/shipper/shipper
6160
internal/pkg/agent/install/testblocking/testblocking
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Kind can be one of:
2+
# - breaking-change: a change to previously-documented behavior
3+
# - deprecation: functionality that is being removed in a later release
4+
# - bug-fix: fixes a problem in a previous version
5+
# - enhancement: extends functionality but does not break or fix existing behavior
6+
# - feature: new functionality
7+
# - known-issue: problems that we are aware of in a given version
8+
# - security: impacts on the security of a product or a user’s deployment.
9+
# - upgrade: important information for someone upgrading from a prior version
10+
# - other: does not fit into any of the other categories
11+
kind: feature
12+
13+
# Change summary; a 80ish characters long description of the change.
14+
summary: Remove experimental support for shippers
15+
16+
# Long description; in case the summary is not enough to describe the change
17+
# this field accommodate a description without length limits.
18+
# NOTE: This field will be rendered only for breaking-change and known-issue kinds at the moment.
19+
#description:
20+
21+
# Affected component; usually one of "elastic-agent", "fleet-server", "filebeat", "metricbeat", "auditbeat", "all", etc.
22+
component:
23+
24+
# PR URL; optional; the PR number that added the changeset.
25+
# If not present is automatically filled by the tooling finding the PR where this changelog fragment has been added.
26+
# NOTE: the tooling supports backports, so it's able to fill the original PR number instead of the backport PR number.
27+
# Please provide it if you are adding a fragment for a different PR.
28+
pr: https://github.com/elastic/elastic-agent/pull/5308
29+
30+
# Issue URL; optional; the GitHub issue related to this changeset (either closes or is part of).
31+
# If not present is automatically filled by the tooling with the issue linked to the PR number.
32+
#issue: https://github.com/owner/repo/1234

dev-tools/packaging/templates/docker/Dockerfile.elastic-agent.tmpl

-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ RUN true && \
3434
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/cloud-defend || true) && \
3535
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/endpoint-security || true) && \
3636
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/fleet-server || true) && \
37-
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/elastic-agent-shipper || true) && \
3837
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/pf-elastic-collector || true) && \
3938
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/pf-elastic-symbolizer || true) && \
4039
(chmod 0755 {{ $beatHome }}/data/elastic-agent-*/components/pf-host-agent || true) && \

docs/agent-policy.md

+2-64
Original file line numberDiff line numberDiff line change
@@ -42,37 +42,12 @@ inputs:
4242
use_output: elasticsearch2
4343
```
4444
45-
![Example deployment without shipper](images/components-example.svg)
45+
![Example deployment](images/components-example.svg)
4646
4747
In this example, we have defined three outputs: `elasticsearch1`, `elasticsearch2`, and `logstash`. We have also defined 6 total inputs, four writing to `elasticsearch1` and one each writing to `elasticsearch2` and `logstash`.
4848

4949
Agent has divided these inputs among four __components__ (running processes) according to their `type`. Each component is broken up into multiple __units__, an output unit that sends its data to the appropriate destination, and some number of input units that provide data to the output. For example the `filebeat1` component has three, two input and one output.
5050

51-
Now let's look at the same setup with the shipper enabled. The output configuration becomes:
52-
53-
```yml
54-
outputs:
55-
elasticsearch1:
56-
type: "elasticsearch"
57-
shipper.enabled: true
58-
elasticsearch2:
59-
type: "elasticsearch"
60-
shipper.enabled: true
61-
logstash:
62-
type: "logstash"
63-
shipper.enabled: true
64-
```
65-
66-
and the rest of the configuration is unchanged.
67-
68-
![Example deployment with shipper](images/components-shipper-example.svg)
69-
70-
This is the same as the previous scenario, but all outputs are configured to use the shipper. In this setup, there are shipper components whose job is to send the data upstream, and input components that send their data to a local shipper rather than managing their own independent queue and network connections.
71-
72-
A shipper component also has one output unit and one or more input units, but its input units correspond to the components that write to it rather than to individual data sources.
73-
74-
In this example there are _seven_ components, as Agent has created three shippers to manage the connections to each of the three outputs. The `shipper1` component has two input units, since it receives data from both `filebeat1` and `metricbeat` (with two individual data sources each). All this data is queued by the shipper and forwarded upstream to `elasticsearch1`.
75-
7651
## Agent policy format
7752

7853
The policy is specified in YML, and the basic layout is:
@@ -136,15 +111,7 @@ If present, this field determines whether the output is active. Defaults to true
136111

137112
#### `type` (string, required)
138113

139-
The output type. If `shipper.enabled: true` isn't set, this value must match one of the entries in the `outputs` field for its inputs' spec files. Otherwise, the `shippers` field for its inputs' spec file must include a shipper type that supports this output. See [Component Specs](component-specs.md) for more details.
140-
141-
#### `shipper.enabled` (boolean, removed)
142-
143-
If present, this field determines whether this output should be implemented by a Shipper component. Defaults to false. If `shipper.enabled` is `true` and some inputs targeting this output don't support the shipper, a warning should be displayed in the logs and in Fleet UI.
144-
145-
#### `shipper.*` (removed)
146-
147-
All configuration fields under `shipper` except `enabled` are reserved for possible future use, and cannot appear in output configurations. In the future, shipper outputs will be the default, and should be presented to the user as just "the output configuration," so the preference with new shipper features should be to evolve configurations by adding unique top-level fields as with any new output feature, rather than exposing the implementation. (However, this configuration subtree is reserved specifically so that we can revisit this policy if our needs change in the future.)
114+
The output type.
148115

149116
#### `log_level` (string, removed)
150117

@@ -158,32 +125,3 @@ The log level for this component. This field is removed from the raw configurati
158125
#### `headers` (`map[string]string`)
159126

160127
Agent does not use this field itself, however if the output's `type` is `elasticsearch` then Agent will insert any headers it acquired during Fleet enrollment into this field.
161-
162-
163-
### Shipper-specific fields
164-
165-
When components use the shipper, it results in units that don't correspond directly to a configuration entry in the policy. A component that writes to the shipper will be given an output unit that targets the shipper, and a shipper component will be given input units detailing the components that will connect to it.
166-
167-
#### Shipper output fields
168-
169-
The output unit of a component that writes to a shipper is given the following configuration:
170-
171-
- `type` (string): the shipper type
172-
- `server` (string): the connection address of the shipper (a named socket on Darwin/Linux, a named pipe on Windows)
173-
- `ssl.certificate_authorities` (string list): a list consisting of one element, which is the certificate authority the shipper will use to verify clients that connect to it. Each shipper instance is assigned its own unique certificate authority on startup.
174-
- `ssl.certificate` (string): the certificate to present when connecting to the shipper, signed by the CA in `ssl.certificate_authorities`.
175-
- `ssl.key` (string): the key for `ssl.certificate`
176-
177-
#### Shipper input fields
178-
179-
For each component that writes to a shipper, the shipper will be given an input unit with the following configuration:
180-
181-
- `id` (string): the id of the input unit, which is also the id of the originating component.
182-
- `type` (string): the shipper type.
183-
- `units` (list): a list of all configuration units in the originating component, with each containing:
184-
* `id` (string): the unit id
185-
* `config`: the full configuration tree for that unit
186-
- `server` (string): the address the server should listen on for connections from this component (a named socket on Darwin/Linux, a named pipe on Windows). This value is the same for all units.
187-
- `ssl.certificate_authorities` (string list): a list with one entry, which is this shipper's assigned certificate authority. This value is the same for all units. Clients connecting to the shipper will present certificates signed by this CA.
188-
- `ssl.certificate` (string): the certificate this client will present when connecting to the shipper.
189-
- `ssl.key` (string): the client's private key.

docs/architecture.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Elastic Agent V2 Architecture
22

33
## Overview
4-
The Elastic Agent V2 architecture was introduced in the 8.6 version of the Elastic Agent. It was a large internal change of how the Elastic Agent was designed and how it operated. The change was performed to allow better status reporting of each running input, enabled support for shippers, improved the specification definition, and allowed for better parallel change actions.
4+
The Elastic Agent V2 architecture was introduced in the 8.6 version of the Elastic Agent. It was a large internal change of how the Elastic Agent was designed and how it operated. The change was performed to allow better status reporting of each running input, improved the specification definition, and allowed for better parallel change actions.
55
## Component Model
66
The entire logic of the Elastic Agent V2 architecture works with what is called the Component Model. The Elastic Agent uses policy to generate a Component Model and then that Component Model is used to ensure a consistency between the currently observed state and the expected state (which is the Component Model).
77
### Component
8-
A component to Elastic Agent is anything that the Elastic Agent must run, operate, and observe during the life of the Elastic Agent. Component is a rather generic term for a good reason. A component can be multiple different types of running code that works with the Elastic Agent. The first example of this is the elastic-agent-shipper which is not an input. A component also always has units, see units below for description of a unit.
8+
A component to Elastic Agent is anything that the Elastic Agent must run, operate, and observe during the life of the Elastic Agent. Component is a rather generic term for a good reason. A component can be multiple different types of running code that works with the Elastic Agent. A component also always has units, see units below for description of a unit.
99
### Unit
1010
A unit to Elastic Agent is a unique block of configuration that is passed to a component over the control protocol. The block of configuration only represents either one input or one output. It is possible for a component to be multiple units of inputs (aka. running multiple filestream inputs), or currently only one output, but designed to support the possibility of multiple outputs. Using multiple blocks of configuration into a set of units allows the Elastic Agent control protocol and the spawned component’s to communicate a unique set of changes as well as the status of each unit.
1111

docs/component-specs.md

+10-19
Original file line numberDiff line numberDiff line change
@@ -13,34 +13,29 @@ inputs:
1313
...
1414
- name: <input name 2>
1515
...
16-
shippers:
17-
- name: <shipper name 1>
18-
...
1916
```
2017
2118
The `version` key must be present and must equal 2 (to distinguish from the older version 1 schema that is no longer supported).
2219

23-
`inputs` is a list of input types this component can run, and `shippers` is a list of shipper types this component can run. Each configured input and shipper also has its own list of `outputs` that it supports, but the spec file only tracks the list of supported types, and the rest comes from the [Agent policy](agent-policy.md).
24-
25-
Most configuration fields are shared between inputs and shippers. The next section lists all valid fields, noting where there are differences between the two cases.
20+
`inputs` is a list of input types this component can run. Each configured input also has its own list of `outputs` that it supports, but the spec file only tracks the list of supported types, and the rest comes from the [Agent policy](agent-policy.md).
2621

27-
## Input / Shipper configuration fields
22+
## Input configuration fields
2823

2924
### `name` (string, required)
3025

31-
The name of this input or shipper. This name must be unique for each platform, however two inputs or shippers that support different platforms can have the same name. This allows the configuration to vary between platforms.
26+
The name of this input. This name must be unique for each platform, however two inputs that support different platforms can have the same name. This allows the configuration to vary between platforms.
3227

3328
### `aliases` (list of strings, input only)
3429

3530
Inputs may specify a list of alternate names that policies can use to refer to them. Any occurrence of these aliases in a policy configuration will be replaced with the value of `name`.
3631

3732
### `description` (string, required)
3833

39-
A short description of this input or shipper.
34+
A short description of this input.
4035

4136
### `platforms` (list of strings, required)
4237

43-
The platforms this input or shipper supports. Must contain one or more of the following:
38+
The platforms this input supports. Must contain one or more of the following:
4439
- `container/amd64`
4540
- `container/arm64`
4641
- `darwin/amd64`
@@ -51,7 +46,7 @@ The platforms this input or shipper supports. Must contain one or more of the fo
5146

5247
### `outputs` (list of strings)
5348

54-
The output types this input or shipper supports. If this is an input, then inputs of this type can only target (non-shipper) output types in this list. If this is a shipper, then this shipper can only implement output types in this list.
49+
The output types this input supports.
5550

5651
### `proxied_actions` (list of strings)
5752

@@ -64,13 +59,9 @@ proxied_actions:
6459
- UPGRADE
6560
```
6661

67-
### `shippers` (list of strings, input only)
68-
69-
The shipper types this input supports. Inputs of this type can target any output type supported by the shippers in this list, as long as the output policy includes `shipper.enabled: true`. If an input supports more than one shipper implementing the same output type, then Agent will prefer the one that appears first in this list.
70-
7162
### `runtime.preventions`
7263

73-
The `runtime.preventions` field contains a list of [EQL conditions](https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-syntax.html#eql-syntax-conditions) which should prevent the use of this input or shipper if any are true. Each prevention should include a `condition` in EQL syntax and a `message` that will be displayed if the condition prevents the use of a component.
64+
The `runtime.preventions` field contains a list of [EQL conditions](https://www.elastic.co/guide/en/elasticsearch/reference/current/eql-syntax.html#eql-syntax-conditions) which should prevent the use of this input if any are true. Each prevention should include a `condition` in EQL syntax and a `message` that will be displayed if the condition prevents the use of a component.
7465

7566
Here are some example preventions taken from the Endpoint spec file:
7667

@@ -94,9 +85,9 @@ The variables that can be accessed by a condition are:
9485
- `user.root`: true if Agent is being run with root / administrator permissions.
9586
- `install.in_default`: true if the Agent is installed in the default location or has been installed via deb or rpm.
9687

97-
### `command` (required for shipper)
88+
### `command`
9889

99-
The `command` field determines how the component will be run. Shippers must include this field, while inputs must include either `command` or `service`. `command` consists of the following subfields:
90+
The `command` field determines how the component will be run. Inputs must include either `command` or `service`. `command` consists of the following subfields:
10091

10192
#### `command.args` (list of strings)
10293

@@ -150,7 +141,7 @@ Some components (particularly Beats) terminate when they receive a new configura
150141

151142
### `service` (input only)
152143

153-
Inputs that are run as a system service (like Endpoint Security) can use `service` instead of `command` to indicate that Agent should only monitor them, not manage their execution. `service` consists of the following subfields:
144+
Inputs that are run as a system service (like Endpoint Security) can use `service` instead of `command` to indicate that Agent should only monitor them, not manage their execution. `service` consists of the following subfields:
154145

155146
#### `service.cport` (int, required)
156147

docs/images/components-shipper-example.d2

-46
This file was deleted.

docs/images/components-shipper-example.svg

-30
This file was deleted.

internal/pkg/agent/application/coordinator/coordinator.go

-1
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,6 @@ func (c *Coordinator) filterByCapabilities(comps []component.Component) []compon
14851485
}
14861486
result := []component.Component{}
14871487
for _, component := range comps {
1488-
// If this is an input component (not a shipper), make sure its type is allowed
14891488
if component.InputSpec != nil && !c.caps.AllowInput(component.InputType) {
14901489
c.logger.Infof("Component '%v' with input type '%v' filtered by capabilities.yml", component.ID, component.InputType)
14911490
continue

0 commit comments

Comments
 (0)