-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'loadbalancing' distribution (#15)
Signed-off-by: Juraci Paixão Kröhling <juraci@kroehling.de>
- Loading branch information
1 parent
ae6a8c9
commit c1405f7
Showing
17 changed files
with
344 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Continuous Integration - load-balancing | ||
|
||
on: | ||
workflow_run: | ||
workflows: [Continuous Integration] | ||
types: | ||
- completed | ||
|
||
jobs: | ||
release: | ||
name: Continuous Integration - loadbalancing - GoReleaser | ||
uses: ./.github/workflows/base-goreleaser-ci.yaml | ||
with: | ||
distribution: loadbalancing | ||
secrets: inherit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: Release loadbalancing | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
name: Release loadbalancing | ||
uses: ./.github/workflows/base-release.yaml | ||
with: | ||
distribution: loadbalancing | ||
secrets: inherit | ||
permissions: write-all |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
project_name: loadbalancing | ||
builds: | ||
- id: loadbalancing | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- "386" | ||
- amd64 | ||
- arm64 | ||
- ppc64le | ||
ignore: | ||
- goos: darwin | ||
goarch: "386" | ||
- goos: windows | ||
goarch: arm64 | ||
dir: _build | ||
binary: loadbalancing | ||
ldflags: | ||
- -s | ||
- -w | ||
flags: | ||
- -trimpath | ||
env: | ||
- CGO_ENABLED=0 | ||
archives: | ||
- id: loadbalancing | ||
builds: | ||
- loadbalancing | ||
name_template: '{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}{{ if .Arm }}v{{ .Arm }}{{ end }}{{ if .Mips }}_{{ .Mips }}{{ end }}' | ||
nfpms: | ||
- package_name: loadbalancing | ||
contents: | ||
- src: loadbalancing.service | ||
dst: /lib/systemd/system/loadbalancing.service | ||
- src: loadbalancing.conf | ||
dst: /etc/loadbalancing/loadbalancing.conf | ||
type: config|noreplace | ||
- src: otelcol.yaml | ||
dst: /etc/loadbalancing/config.yaml | ||
type: config | ||
scripts: | ||
preinstall: preinstall.sh | ||
postinstall: postinstall.sh | ||
preremove: preremove.sh | ||
id: loadbalancing | ||
builds: | ||
- loadbalancing | ||
formats: | ||
- apk | ||
- deb | ||
- rpm | ||
maintainer: Juraci Paixão Kröhling <distributions@kroehling.de> | ||
description: loadbalancing distribution of the OpenTelemetry Collector | ||
license: Apache 2.0 | ||
checksum: | ||
name_template: '{{ .ProjectName }}_checksums.txt' | ||
dockers: | ||
- goos: linux | ||
goarch: "386" | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-386 | ||
extra_files: | ||
- otelcol.yaml | ||
build_flag_templates: | ||
- --pull | ||
- --platform=linux/386 | ||
- --label=org.opencontainers.image.created={{.Date}} | ||
- --label=org.opencontainers.image.name={{.ProjectName}} | ||
- --label=org.opencontainers.image.revision={{.FullCommit}} | ||
- --label=org.opencontainers.image.version={{.Version}} | ||
- --label=org.opencontainers.image.source={{.GitURL}} | ||
use: buildx | ||
- goos: linux | ||
goarch: amd64 | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-amd64 | ||
extra_files: | ||
- otelcol.yaml | ||
build_flag_templates: | ||
- --pull | ||
- --platform=linux/amd64 | ||
- --label=org.opencontainers.image.created={{.Date}} | ||
- --label=org.opencontainers.image.name={{.ProjectName}} | ||
- --label=org.opencontainers.image.revision={{.FullCommit}} | ||
- --label=org.opencontainers.image.version={{.Version}} | ||
- --label=org.opencontainers.image.source={{.GitURL}} | ||
use: buildx | ||
- goos: linux | ||
goarch: arm64 | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-arm64 | ||
extra_files: | ||
- otelcol.yaml | ||
build_flag_templates: | ||
- --pull | ||
- --platform=linux/arm64 | ||
- --label=org.opencontainers.image.created={{.Date}} | ||
- --label=org.opencontainers.image.name={{.ProjectName}} | ||
- --label=org.opencontainers.image.revision={{.FullCommit}} | ||
- --label=org.opencontainers.image.version={{.Version}} | ||
- --label=org.opencontainers.image.source={{.GitURL}} | ||
use: buildx | ||
- goos: linux | ||
goarch: ppc64le | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-ppc64le | ||
extra_files: | ||
- otelcol.yaml | ||
build_flag_templates: | ||
- --pull | ||
- --platform=linux/ppc64le | ||
- --label=org.opencontainers.image.created={{.Date}} | ||
- --label=org.opencontainers.image.name={{.ProjectName}} | ||
- --label=org.opencontainers.image.revision={{.FullCommit}} | ||
- --label=org.opencontainers.image.version={{.Version}} | ||
- --label=org.opencontainers.image.source={{.GitURL}} | ||
use: buildx | ||
docker_manifests: | ||
- name_template: ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }} | ||
image_templates: | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-386 | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-amd64 | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-arm64 | ||
- ghcr.io/jpkrohling/otelcol-distributions/loadbalancing:{{ .Version }}-ppc64le | ||
sboms: | ||
- id: archive | ||
artifacts: archive | ||
- id: package | ||
artifacts: package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM alpine:latest | ||
|
||
ARG USER_UID=10001 | ||
USER ${USER_UID} | ||
|
||
COPY loadbalancing /loadbalancing | ||
COPY otelcol.yaml /etc/loadbalancing/config.yaml | ||
ENTRYPOINT ["/loadbalancing"] | ||
CMD ["--config", "/etc/loadbalancing/config.yaml"] | ||
EXPOSE 4317 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Systemd environment file for the loadbalancing service | ||
|
||
# Command-line options for the loadbalancing service. | ||
# Run `/usr/bin/loadbalancing --help` to see all available options. | ||
OTELCOL_OPTIONS="--config=/etc/loadbalancing/config.yaml" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
[Unit] | ||
Description=Load-balancer distribution of the OpenTelemetry Collector | ||
After=network.target | ||
|
||
[Service] | ||
EnvironmentFile=/etc/loadbalancing/loadbalancing.conf | ||
ExecStart=/usr/bin/loadbalancing $OTELCOL_OPTIONS | ||
KillMode=mixed | ||
Restart=on-failure | ||
Type=simple | ||
User=loadbalancing | ||
Group=loadbalancing | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
dist: | ||
module: github.com/jpkrohling/otelcol-distributions/loadbalancing | ||
name: otelcol | ||
description: Load-balancer distribution of the OpenTelemetry Collector | ||
version: 0.91.0 | ||
output_path: ./_build | ||
otelcol_version: 0.91.0 | ||
|
||
extensions: | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/extension/healthcheckextension v0.91.0 | ||
receivers: | ||
- gomod: go.opentelemetry.io/collector/receiver/otlpreceiver v0.91.0 | ||
exporters: | ||
- gomod: go.opentelemetry.io/collector/exporter/otlpexporter v0.91.0 | ||
- gomod: github.com/open-telemetry/opentelemetry-collector-contrib/exporter/loadbalancingexporter v0.91.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
extensions: | ||
health_check: | ||
|
||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
|
||
processors: | ||
|
||
exporters: | ||
loadbalancing: | ||
protocol: | ||
otlp: | ||
timeout: 1s | ||
resolver: | ||
static: | ||
hostnames: | ||
- example.com:4317 | ||
|
||
service: | ||
extensions: [health_check] | ||
pipelines: | ||
traces: | ||
receivers: | ||
- otlp | ||
processors: [] | ||
exporters: | ||
- loadbalancing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
extensions: | ||
health_check: | ||
|
||
receivers: | ||
otlp: | ||
protocols: | ||
grpc: | ||
|
||
processors: | ||
|
||
exporters: | ||
loadbalancing: | ||
protocol: | ||
otlp: | ||
timeout: 1s | ||
resolver: | ||
static: | ||
hostnames: | ||
- example.com:4317 | ||
|
||
service: | ||
pipelines: | ||
traces: | ||
receivers: [otlp] | ||
processors: [] | ||
exporters: [otlp] | ||
|
||
logs: | ||
receivers: [otlp] | ||
processors: [] | ||
exporters: [otlp] | ||
|
||
extensions: [health_check] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if command -v systemctl >/dev/null 2>&1; then | ||
systemctl enable loadbalancing.service | ||
if [ -f /etc/loadbalancing/config.yaml ]; then | ||
systemctl start loadbalancing.service | ||
fi | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/sh | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
getent passwd loadbalancing >/dev/null || useradd --system --user-group --no-create-home --shell /sbin/nologin loadbalancing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/bin/sh | ||
|
||
# Copyright The OpenTelemetry Authors | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
if command -v systemctl >/dev/null 2>&1; then | ||
systemctl stop loadbalancing.service | ||
systemctl disable loadbalancing.service | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.