generated from kyma-project/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into remove-module-status-feature-flag
- Loading branch information
Showing
21 changed files
with
223 additions
and
67 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
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,73 @@ | ||
name: Telemetry Self Monitor Image Builder | ||
|
||
on: | ||
pull_request_target: | ||
paths: | ||
- "dependencies/telemetry-self-monitor/**" | ||
types: [ opened, edited, synchronize, reopened, ready_for_review ] | ||
push: | ||
branches: | ||
- main | ||
paths: | ||
- "dependencies/telemetry-self-monitor/**" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
envs: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
build-args: ${{ steps.prepare-envs.outputs.build-args }} | ||
build-tag: ${{ steps.build-tag.outputs.build-tag || '' }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Fetch new env file | ||
run: | | ||
git fetch origin ${{ github.event.pull_request.head.sha }} | ||
git checkout ${{ github.event.pull_request.head.sha }} --no-overlay -- dependencies/telemetry-self-monitor/envs | ||
if: github.event_name == 'pull_request_target' | ||
|
||
- name: Prepare Envs | ||
id: prepare-envs | ||
run: | | ||
{ | ||
# this creates a multiline string with the envs. | ||
# Everything between `build-args<<BUILD_ARGS` and BUILD_ARGS will be content of the build-args variable. | ||
echo 'build-args<<BUILD_ARGS' | ||
cat dependencies/telemetry-self-monitor/envs | ||
echo BUILD_ARGS | ||
} >> "$GITHUB_OUTPUT" | ||
- name: load envs into output | ||
id: load-envs | ||
run: | | ||
cat dependencies/telemetry-self-monitor/envs >> "$GITHUB_OUTPUT" | ||
- name: get commit short sha | ||
id: get-short-sha | ||
run: echo "short-sha=$(git rev-parse --short $GITHUB_SHA)" >> $GITHUB_OUTPUT | ||
|
||
- name: build image tag | ||
id: build-tag | ||
run: echo "build-tag=${{ steps.load-envs.outputs.PROMETHEUS_VERSION }}-${{ steps.get-short-sha.outputs.short-sha }}" >> $GITHUB_OUTPUT | ||
if: github.event_name == 'push' | ||
|
||
build-image: | ||
needs: envs | ||
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main | ||
with: | ||
name: tpi/telemetry-self-monitor | ||
dockerfile: Dockerfile | ||
context: dependencies/telemetry-self-monitor | ||
build-args: ${{ needs.envs.outputs.build-args }} | ||
tags: ${{ needs.envs.outputs.build-tag }} | ||
list-images: | ||
needs: build-image | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: List images | ||
run: | | ||
echo "${{ needs.build-image.outputs.images }}" |
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 |
---|---|---|
|
@@ -28,6 +28,7 @@ jobs: | |
with: | ||
files_ignore: | | ||
docs/** | ||
dependencies/** | ||
**/*.md | ||
OWNERS | ||
CODEOWNERS | ||
|
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 |
---|---|---|
|
@@ -25,6 +25,7 @@ jobs: | |
with: | ||
files_ignore: | | ||
docs/** | ||
dependencies/** | ||
**/*.md | ||
OWNERS | ||
CODEOWNERS | ||
|
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
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,33 @@ | ||
ARG ALPINE_VERSION | ||
|
||
FROM node:alpine${ALPINE_VERSION} as builder | ||
|
||
ARG PROMETHEUS_VERSION | ||
|
||
RUN apk add --no-cache git make musl-dev go curl bash | ||
RUN apk --no-cache upgrade | ||
|
||
# Configure Go | ||
ENV GOROOT /usr/lib/go | ||
ENV GOPATH /go | ||
ENV PATH /go/bin:$PATH | ||
|
||
|
||
RUN mkdir -p ${GOPATH}/src ${GOPATH}/bin | ||
WORKDIR / | ||
RUN curl -LO https://github.com/prometheus/prometheus/archive/refs/tags/v${PROMETHEUS_VERSION}.tar.gz | ||
RUN tar xvzf v${PROMETHEUS_VERSION}.tar.gz | ||
RUN mv /prometheus-${PROMETHEUS_VERSION} /prometheus | ||
|
||
WORKDIR /prometheus | ||
COPY plugins.yml plugins.yml | ||
RUN make build | ||
|
||
FROM scratch | ||
|
||
COPY --from=builder /prometheus/prometheus /bin/prometheus | ||
|
||
USER nobody | ||
EXPOSE 9090 | ||
|
||
ENTRYPOINT [ "/bin/prometheus" ] |
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,12 @@ | ||
# Telemetry Self Monitor Docker Image | ||
|
||
The container image is built based on the latest [Prometheus LTS image](https://prometheus.io/docs/introduction/release-cycle/). | ||
|
||
Additionally, there is a [plugins.yml](./plugins.yml) file, which contains the list of the required plugins. | ||
|
||
## Build locally | ||
|
||
To build the image locally with the versions taken from the `envs` file, run: | ||
``` | ||
docker build -t telemetry-self-monitor:local --build-arg PROMETHEUS_VERSION=XXX --build-arg ALPINE_VERSION=XXX . | ||
``` |
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,2 @@ | ||
PROMETHEUS_VERSION=2.53.2 | ||
ALPINE_VERSION=3.20 |
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 @@ | ||
- github.com/prometheus/prometheus/discovery/kubernetes |
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module github.com/kyma-project/telemetry-manager | ||
|
||
go 1.22.5 | ||
go 1.23.1 | ||
|
||
require ( | ||
github.com/go-logr/logr v1.4.2 | ||
|
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.