Skip to content

Commit

Permalink
Merge branch 'main' into test-build-version-in-binary
Browse files Browse the repository at this point in the history
  • Loading branch information
k15r authored Feb 12, 2025
2 parents 2d45666 + 0dd4e8d commit 9bcfd1a
Show file tree
Hide file tree
Showing 247 changed files with 8,759 additions and 2,131 deletions.
12 changes: 9 additions & 3 deletions .env
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Default Environment Variables
## General
ENV_K3S_K8S_VERSION=1.30.5 # refers to the version of kubernetes used in K3s
ENV_K3S_K8S_VERSION=1.30.9 # refers to the version of kubernetes used in K3s
ENV_IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:main # Image URL to use all building/pushing image targets

## Gardener
Expand All @@ -10,6 +10,12 @@ ENV_GARDENER_MIN_NODES=1
ENV_GARDENER_MAX_NODES=2

## Dependencies
ENV_ISTIO_VERSION=1.11.0
ENV_K3D_VERSION=v5.4.7
ENV_ISTIO_VERSION=1.14.1
ENV_GORELEASER_VERSION=v1.23.0

## Default Docker Images
DEFAULT_FLUENTBIT_EXPORTER_IMAGE="europe-docker.pkg.dev/kyma-project/prod/directory-size-exporter:v20250206-00da07e7"
DEFAULT_FLUENTBIT_IMAGE="europe-docker.pkg.dev/kyma-project/prod/external/fluent/fluent-bit:3.2.4"
DEFAULT_OTEL_COLLECTOR_IMAGE="europe-docker.pkg.dev/kyma-project/prod/kyma-otel-collector:0.118.0-main"
DEFAULT_SELFMONITOR_IMAGE="europe-docker.pkg.dev/kyma-project/prod/tpi/telemetry-self-monitor:3.1.0-98bf175"
DEFAULT_TEST_TELEMETRYGEN_IMAGE="ghcr.io/open-telemetry/opentelemetry-collector-contrib/telemetrygen:v0.118.0"
26 changes: 14 additions & 12 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,6 @@
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "daily"
commit-message:
prefix: "chore"
labels:
- "area/dependency"
- "kind/chore"
ignore:
- dependency-name: "kyma-project/prod/tpi/fluent-bit"

- package-ecosystem: "gomod"
directory: "/"
schedule:
Expand Down Expand Up @@ -42,3 +30,17 @@ updates:
labels:
- "area/ci"
- "kind/chore"

- package-ecosystem: "gomod"
directory: "/docs/user/integration/sample-app"
schedule:
interval: "daily"
commit-message:
prefix: "chore"
groups:
otel:
patterns:
- "go.opentelemetry.io/otel/*"
labels:
- "area/dependency"
- "kind/chore"
6 changes: 5 additions & 1 deletion .github/template/prepare-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,14 @@ runs:
shell: bash
run: make --debug deploy-experimental

- name: Wait for manager readiness
- name: Wait for manager deployment rollout
shell: bash
run: kubectl -n kyma-system rollout status deployment telemetry-manager --timeout=90s

- name: Wait for manager readiness
shell: bash
run: kubectl -n kyma-system wait pods -l app.kubernetes.io/instance=telemetry,app.kubernetes.io/name=manager --for=condition=Ready=true --timeout=90s

- name: Print cluster info
shell: bash
run: |
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/branch-integration.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
name: Branch Integration

on:
merge_group:
branches:
- "release-*"
push:
branches:
- "main"
- "release-*"
paths-ignore:
- 'docs/**'
- 'dependencies/**'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,4 +72,4 @@ jobs:
with:
payload-file-path: ".github/workflows/slack-message.json"
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_HUSKIES_NOTIF_WEBHOOK_URL }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
51 changes: 51 additions & 0 deletions .github/workflows/build-sample-app-image.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build Sample App Image

on:
pull_request_target:
paths:
- "docs/user/integration/sample-app/**"
types: [ opened, edited, synchronize, reopened, ready_for_review ]
push:
branches:
- main
- sample-app
paths:
- "docs/user/integration/sample-app/**"
workflow_dispatch:

jobs:
envs:
runs-on: ubuntu-latest
outputs:
tags: ${{ steps.create-tags.outputs.tags }}

steps:
- name: create tags
id: create-tags
run: |
if [[ $GITHUB_EVENT_NAME == 'push' || $GITHUB_EVENT_NAME == 'merge_group' ]]; then
echo 'TAGS=latest' >> "$GITHUB_OUTPUT"
else
{
echo 'tags<<TAGS'
echo 'PR-${{ github.event.pull_request.number }}'
echo '${{ github.event.pull_request.head.sha }}'
echo 'TAGS'
} >> "$GITHUB_OUTPUT"
fi
build-image:
needs: envs
uses: kyma-project/test-infra/.github/workflows/image-builder.yml@main
with:
name: samples/telemetry-sample-app
dockerfile: Dockerfile
context: docs/user/integration/sample-app
tags: ${{ needs.envs.outputs.tags }}
list-images:
needs: build-image
runs-on: ubuntu-latest
steps:
- name: List images
run: |
echo "${{ needs.build-image.outputs.images }}"
2 changes: 1 addition & 1 deletion .github/workflows/build-telemetry-self-monitor-image.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Telemetry Self Monitor Image Builder
name: Build Telemetry Self Monitor Image

on:
pull_request_target:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/pr-code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@ jobs:
- name: Run coverage check
run: make check-coverage

verify-code-generated:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Setup Golang
uses: "./.github/template/setup-golang"

- name: Verify all code and manifests were generated and committed
run: make check-clean

gitleaks:
runs-on: ubuntu-latest
steps:
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/pr-loadtest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.inputs.pr_number }}/head"
repository: ${{ github.repository }}
- id: set-matrix
run: |
image=${{ github.event.inputs.image }}
Expand Down Expand Up @@ -117,6 +120,9 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
ref: "refs/pull/${{ github.event.inputs.pr_number }}/head"
repository: ${{ github.repository }}
- name: Download Results
uses: actions/download-artifact@v4
- name: Print Results
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/pr-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Check Release Branch

on:
pull_request:
branches:
- "release-*"
jobs:
validate-envs:
name: Validate .env file
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4

# check that the .env file does not contain references to the main branch
- name: Check .env file
run: |
if grep -q "main" .env; then
echo "The .env file contains references to the main branch"
exit 1
fi
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: PR Lifecycle
name: PR Upgrade

on:
merge_group:
Expand Down Expand Up @@ -39,7 +39,7 @@ jobs:
GIT_COMMIT_SHA=$(git rev-parse --short=8 HEAD)
GIT_COMMIT_DATE=$(git show -s --format=%cd --date=format:'v%Y%m%d' ${GIT_COMMIT_SHA})
echo "Deploying Manager using image europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA}"
IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA} make deploy-dev
IMG=europe-docker.pkg.dev/kyma-project/prod/telemetry-manager:${GIT_COMMIT_DATE}-${GIT_COMMIT_SHA} make deploy-experimental
- name: Wait for manager readiness
shell: bash
Expand All @@ -48,7 +48,7 @@ jobs:
- name: Run test on latest tag
shell: bash
run: |
bin/ginkgo run --junit-report=junit-report-latest-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
bin/ginkgo run --junit-report=junit-report-latest-version.xml --tags e2e --flake-attempts=5 --label-filter="upgrade || operational" -v test/e2e
- name: Switch back to current revision
uses: actions/checkout@v4
Expand Down Expand Up @@ -82,7 +82,7 @@ jobs:
shell: bash
run: |
make install-tools # delete after the tools via go modules are released
bin/ginkgo run --junit-report=junit-report-current-version.xml --tags e2e --flake-attempts=5 --label-filter="operational" -v test/e2e
bin/ginkgo run --junit-report=junit-report-current-version.xml --tags e2e --flake-attempts=5 --label-filter="upgrade" -v test/e2e
- name: Finalize test
uses: "./.github/template/finalize-test"
Expand Down
4 changes: 4 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ run:
timeout: 10m
build-tags:
- e2e
- tools
linters:
enable-all: true
disable:
Expand Down Expand Up @@ -146,6 +147,9 @@ linters-settings:
alias: slicesutils
- pkg: github.com/kyma-project/telemetry-manager/internal/utils/test
alias: testutils
- pkg: github.com/kyma-project/telemetry-manager/internal/utils/metricpipeline
alias: metricpipelineutils

errcheck:
check-type-assertions: true # Reports type assertions: `a := b.(SomeStruct)`.
check-blank: true # Report assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`.
Expand Down
12 changes: 12 additions & 0 deletions .k3d-kyma.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,15 @@ registries:
name: kyma
hostPort: '5001'

options:
k3s:
nodeLabels:
- label: topology.kubernetes.io/region=kyma-local
nodeFilters:
- server:*
- label: topology.kubernetes.io/zone=kyma-local
nodeFilters:
- server:*
- label: node.kubernetes.io/instance-type=local
nodeFilters:
- server:*
2 changes: 2 additions & 0 deletions .mockery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ packages:
interfaces:
GatewayApplierDeleter:
GatewayConfigBuilder:
AgentApplierDeleter:
AgentConfigBuilder:
github.com/kyma-project/telemetry-manager/internal/reconciler/tracepipeline:
interfaces:
FlowHealthProber:
Expand Down
3 changes: 2 additions & 1 deletion CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@

# All files and subdirectories in /docs
/docs/ @kyma-project/technical-writers
/docs/user/integration/sample-app @kyma-project/observability

# All .md files
*.md @kyma-project/technical-writers

# Config files for markdownlint
.markdownlint.yaml @kyma-project/technical-writers
markdown_heading_capitalization.js @kyma-project/technical-writers
markdown_heading_capitalization.js @kyma-project/technical-writers
4 changes: 3 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build the manager binary
FROM europe-docker.pkg.dev/kyma-project/prod/external/library/golang:1.23.4-alpine3.21 AS builder
FROM europe-docker.pkg.dev/kyma-project/prod/external/library/golang:1.23.6-alpine3.21 AS builder

WORKDIR /telemetry-manager-workspace
# Copy the Go Modules manifests
Expand All @@ -24,6 +24,8 @@ RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go mod tidy && go build -ldflags="-X m

FROM scratch

LABEL org.opencontainers.image.source="https://github.com/kyma-project/telemetry-manager"

WORKDIR /

COPY --from=builder /telemetry-manager-workspace/manager .
Expand Down
12 changes: 9 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ TOOLS_PKG_NAMES_CLEAN := $(shell grep -E $(TOOLS_MOD_REGEX) < $(TOOLS_MOD_DIR)/
TOOLS_BIN_NAMES := $(addprefix $(TOOLS_BIN_DIR)/, $(notdir $(TOOLS_PKG_NAMES_CLEAN)))

.PHONY: install-tools
install-tools: $(TOOLS_BIN_NAMES)
install-tools: $(TOOLS_BIN_NAMES) $(POPULATE_IMAGES)

$(TOOLS_BIN_DIR):
if [ ! -d $@ ]; then mkdir -p $@; fi
Expand All @@ -54,6 +54,10 @@ YAMLFMT := $(TOOLS_BIN_DIR)/yamlfmt
STRINGER := $(TOOLS_BIN_DIR)/stringer
WSL := $(TOOLS_BIN_DIR)/wsl
K3D := $(TOOLS_BIN_DIR)/k3d
POPULATE_IMAGES := $(TOOLS_BIN_DIR)/populate-images

$(POPULATE_IMAGES):
cd $(TOOLS_MOD_DIR)/populateimages && go build -o $(POPULATE_IMAGES) main.go

# Sub-makefile
include hack/make/provision.mk
Expand Down Expand Up @@ -114,11 +118,13 @@ manifests-experimental: $(CONTROLLER_GEN) $(YAMLFMT) ## Generate WebhookConfigur
$(YAMLFMT)

.PHONY: generate
generate: $(CONTROLLER_GEN) $(MOCKERY) $(STRINGER) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
generate: $(CONTROLLER_GEN) $(MOCKERY) $(STRINGER) $(POPULATE_IMAGES) ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate.go.txt" paths="./..."
$(MOCKERY)
$(STRINGER) --type Mode internal/utils/logpipeline/logpipeline.go
$(STRINGER) --type FeatureFlag internal/featureflags/featureflags.go
$(POPULATE_IMAGES)


.PHONY: fmt
fmt: ## Run go fmt against code.
Expand Down Expand Up @@ -152,7 +158,7 @@ check-coverage: $(GO_TEST_COVERAGE) ## Check tests coverage.
build: generate fmt vet tidy ## Build manager binary.
go build -o bin/manager main.go

check-clean: ## Check if repo is clean up-to-date. Used after code generation
check-clean: generate manifests manifests-experimental crd-docs-gen ## Check if repo is clean up-to-date. Used after code generation
@echo "Checking if all generated files are up-to-date"
@git diff --name-only --exit-code || (echo "Generated files are not up-to-date. Please run 'make generate manifests manifests-experimental crd-docs-gen' to update them." && exit 1)

Expand Down
1 change: 1 addition & 0 deletions apis/telemetry/v1alpha1/logpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ type LogPipelineList struct {
// +kubebuilder:resource:scope=Cluster,categories={kyma-telemetry,kyma-telemetry-pipelines}
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Configuration Generated",type=string,JSONPath=`.status.conditions[?(@.type=="ConfigurationGenerated")].status`
// +kubebuilder:printcolumn:name="Gateway Healthy",type=string,JSONPath=`.status.conditions[?(@.type=="GatewayHealthy")].status`
// +kubebuilder:printcolumn:name="Agent Healthy",type=string,JSONPath=`.status.conditions[?(@.type=="AgentHealthy")].status`
// +kubebuilder:printcolumn:name="Flow Healthy",type=string,JSONPath=`.status.conditions[?(@.type=="TelemetryFlowHealthy")].status`
// +kubebuilder:printcolumn:name="Unsupported Mode",type=boolean,JSONPath=`.status.unsupportedMode`
Expand Down
6 changes: 3 additions & 3 deletions apis/telemetry/v1alpha1/metricpipeline_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type MetricPipelineInput struct {
// MetricPipelinePrometheusInput defines the Prometheus scraping section.
type MetricPipelinePrometheusInput struct {
// If enabled, Services and Pods marked with `prometheus.io/scrape=true` annotation are scraped. The default is `false`.
Enabled bool `json:"enabled,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// Describes whether Prometheus metrics from specific namespaces are selected. System namespaces are disabled by default.
// +optional
Namespaces *NamespaceSelector `json:"namespaces,omitempty"`
Expand All @@ -94,7 +94,7 @@ type MetricPipelinePrometheusInput struct {
// MetricPipelineRuntimeInput defines the runtime scraping section.
type MetricPipelineRuntimeInput struct {
// If enabled, runtime metrics are scraped. The default is `false`.
Enabled bool `json:"enabled,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// Describes whether runtime metrics from specific namespaces are selected. System namespaces are disabled by default.
// +optional
Namespaces *NamespaceSelector `json:"namespaces,omitempty"`
Expand Down Expand Up @@ -141,7 +141,7 @@ type MetricPipelineRuntimeInputResource struct {
// MetricPipelineIstioInput defines the Istio scraping section.
type MetricPipelineIstioInput struct {
// If enabled, istio-proxy metrics are scraped from Pods that have the istio-proxy sidecar injected. The default is `false`.
Enabled bool `json:"enabled,omitempty"`
Enabled *bool `json:"enabled,omitempty"`
// Describes whether istio-proxy metrics from specific namespaces are selected. System namespaces are enabled by default.
// +optional
Namespaces *NamespaceSelector `json:"namespaces,omitempty"`
Expand Down
Loading

0 comments on commit 9bcfd1a

Please sign in to comment.