Skip to content

Commit

Permalink
[Otel Onboarding] Replace setcap with running with sudo (#192585)
Browse files Browse the repository at this point in the history
Replace `setcap` with running the collector with `sudo` on Linux as it
follows best practices.

Later on, this can be replaced by instructions to install the collector
instead.
  • Loading branch information
flash1293 authored Sep 12, 2024
1 parent 29381c0 commit de454fe
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,10 +548,8 @@ spec:
curl --output elastic-distro-${agentVersion}-linux-$arch.tar.gz --url https://${AGENT_CDN_BASE_URL}/elastic-agent-${agentVersion}-linux-$arch.tar.gz --proto '=https' --tlsv1.2 -fOL && mkdir -p elastic-distro-${agentVersion}-linux-$arch && tar -xvf elastic-distro-${agentVersion}-linux-$arch.tar.gz -C "elastic-distro-${agentVersion}-linux-$arch" --strip-components=1 && cd elastic-distro-${agentVersion}-linux-$arch
sudo setcap 'cap_dac_read_search=ep' ./data/elastic-agent-*/elastic-agent
rm ./otel.yml && cp ./otel_samples/platformlogs_hostmetrics.yml ./otel.yml && mkdir -p ./data/otelcol && sed -i 's#\\\${env:STORAGE_DIR}#'"$PWD"/data/otelcol'#g' ./otel.yml && sed -i 's#\\\${env:ELASTIC_ENDPOINT}#${setup?.elasticsearchUrl}#g' ./otel.yml && sed -i 's/\\\${env:ELASTIC_API_KEY}/${apiKeyData?.apiKeyEncoded}/g' ./otel.yml`,
start: './otelcol --config otel.yml',
start: 'sudo ./otelcol --config otel.yml',
type: 'copy',
},
{
Expand Down

0 comments on commit de454fe

Please sign in to comment.