From b257611e666a870319625f4548b1995b36c980ec Mon Sep 17 00:00:00 2001 From: Marco Ferraioli Date: Tue, 13 Feb 2024 17:11:15 +0100 Subject: [PATCH 01/24] feat: partial module update, deploy and config changes, update MAINTENANCE.md file --- katalog/tempo-distributed/MAINTENANCE.md | 2 +- katalog/tempo-distributed/configs/tempo.yaml | 3 +- katalog/tempo-distributed/deploy.yaml | 96 ++++++++++---------- 3 files changed, 53 insertions(+), 48 deletions(-) diff --git a/katalog/tempo-distributed/MAINTENANCE.md b/katalog/tempo-distributed/MAINTENANCE.md index 0d14cbf..461c0ba 100644 --- a/katalog/tempo-distributed/MAINTENANCE.md +++ b/katalog/tempo-distributed/MAINTENANCE.md @@ -6,7 +6,7 @@ To maintain the Tempo package, you should follow this steps. helm repo add grafana https://grafana.github.io/helm-charts helm repo update helm search repo grafana/tempo-distributed # get the latest chart version -helm pull grafana/tempo-distributed --version 1.7.3 --untar --untardir /tmp # this command will download the chart in /tmp/tempo-distributed +helm pull grafana/tempo-distributed --version 1.8.3 --untar --untardir /tmp # this command will download the chart in /tmp/tempo-distributed ``` Run the following command: diff --git a/katalog/tempo-distributed/configs/tempo.yaml b/katalog/tempo-distributed/configs/tempo.yaml index 9f8f31b..4e8ffc7 100644 --- a/katalog/tempo-distributed/configs/tempo.yaml +++ b/katalog/tempo-distributed/configs/tempo.yaml @@ -90,6 +90,7 @@ querier: trace_by_id: query_timeout: 10s query_frontend: + max_outstanding_per_tenant: 2000 max_retries: 2 search: concurrent_jobs: 1000 @@ -130,4 +131,4 @@ storage: wal: path: /var/tempo/wal usage_report: - reporting_enabled: true \ No newline at end of file + reporting_enabled: true diff --git a/katalog/tempo-distributed/deploy.yaml b/katalog/tempo-distributed/deploy.yaml index 2ab7bfd..8f7bf9b 100644 --- a/katalog/tempo-distributed/deploy.yaml +++ b/katalog/tempo-distributed/deploy.yaml @@ -9,7 +9,7 @@ kind: PodDisruptionBudget metadata: name: tempo-distributed-ingester labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -31,7 +31,7 @@ metadata: name: tempo-distributed namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -44,7 +44,7 @@ kind: ConfigMap metadata: name: tempo-distributed-runtime labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -60,8 +60,9 @@ apiVersion: v1 kind: ConfigMap metadata: name: tempo-distributed-gateway + namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -149,7 +150,7 @@ kind: Service metadata: name: tempo-distributed-compactor labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: compactor @@ -174,7 +175,7 @@ metadata: name: tempo-distributed-distributor-discovery namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -236,7 +237,7 @@ metadata: name: tempo-distributed-distributor namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -298,8 +299,9 @@ apiVersion: v1 kind: Service metadata: name: tempo-distributed-gateway + namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -325,7 +327,7 @@ metadata: name: tempo-distributed-gossip-ring namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gossip-ring @@ -352,7 +354,7 @@ metadata: name: tempo-distributed-ingester-discovery namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -383,7 +385,7 @@ metadata: name: tempo-distributed-ingester namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -411,7 +413,7 @@ metadata: name: tempo-distributed-memcached namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -437,7 +439,7 @@ metadata: name: tempo-distributed-querier namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -465,7 +467,7 @@ metadata: name: tempo-distributed-query-frontend-discovery namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend @@ -499,7 +501,7 @@ metadata: name: tempo-distributed-query-frontend namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend @@ -527,7 +529,7 @@ metadata: name: tempo-distributed-compactor namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: compactor @@ -550,7 +552,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -558,7 +560,7 @@ spec: app.kubernetes.io/component: compactor app.kubernetes.io/part-of: memberlist annotations: - checksum/config: e288a7b35baa64064179a607f6d5a77b5c2bd95d825104d397bfebb3d52ff436 + checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae spec: serviceAccountName: tempo-distributed securityContext: @@ -625,7 +627,7 @@ metadata: name: tempo-distributed-distributor namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -643,7 +645,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -651,7 +653,7 @@ spec: app.kubernetes.io/component: distributor app.kubernetes.io/part-of: memberlist annotations: - checksum/config: e288a7b35baa64064179a607f6d5a77b5c2bd95d825104d397bfebb3d52ff436 + checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae spec: serviceAccountName: tempo-distributed securityContext: @@ -776,8 +778,9 @@ apiVersion: apps/v1 kind: Deployment metadata: name: tempo-distributed-gateway + namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -794,7 +797,7 @@ spec: template: metadata: annotations: - checksum/config: 35278988affecf31670235e7ee00392370732a53b80aa281302bf75149c2bd10 + checksum/config: bea4355bb563fa6da4ad8a30d3c7ce722091e6bc43b81550195763815ca2d90f labels: app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed @@ -888,7 +891,7 @@ metadata: name: tempo-distributed-querier namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -910,7 +913,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -918,7 +921,7 @@ spec: app.kubernetes.io/component: querier app.kubernetes.io/part-of: memberlist annotations: - checksum/config: e288a7b35baa64064179a607f6d5a77b5c2bd95d825104d397bfebb3d52ff436 + checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae spec: serviceAccountName: tempo-distributed securityContext: @@ -1021,7 +1024,7 @@ metadata: name: tempo-distributed-query-frontend namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend @@ -1043,14 +1046,14 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" app.kubernetes.io/managed-by: Helm app.kubernetes.io/component: query-frontend annotations: - checksum/config: e288a7b35baa64064179a607f6d5a77b5c2bd95d825104d397bfebb3d52ff436 + checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae spec: serviceAccountName: tempo-distributed securityContext: @@ -1145,7 +1148,7 @@ kind: HorizontalPodAutoscaler metadata: name: tempo-distributed-distributor labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -1171,8 +1174,9 @@ apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: tempo-distributed-gateway + namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -1199,7 +1203,7 @@ kind: HorizontalPodAutoscaler metadata: name: tempo-distributed-querier labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -1227,7 +1231,7 @@ metadata: name: tempo-distributed-ingester namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -1249,7 +1253,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -1257,7 +1261,7 @@ spec: app.kubernetes.io/component: ingester app.kubernetes.io/part-of: memberlist annotations: - checksum/config: e288a7b35baa64064179a607f6d5a77b5c2bd95d825104d397bfebb3d52ff436 + checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae spec: serviceAccountName: tempo-distributed securityContext: @@ -1362,7 +1366,7 @@ metadata: name: tempo-distributed-memcached namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -1379,7 +1383,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -1452,7 +1456,7 @@ kind: PrometheusRule metadata: name: tempo-distributed labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -1468,7 +1472,7 @@ metadata: name: tempo-distributed-compactor namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: compactor @@ -1504,7 +1508,7 @@ metadata: name: tempo-distributed-distributor namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -1540,7 +1544,7 @@ metadata: name: tempo-distributed-ingester namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -1576,7 +1580,7 @@ metadata: name: tempo-distributed-memcached namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -1611,7 +1615,7 @@ metadata: name: tempo-distributed-metrics-generator namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: metrics-generator @@ -1647,7 +1651,7 @@ metadata: name: tempo-distributed-querier namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -1683,7 +1687,7 @@ metadata: name: tempo-distributed-tempo-query namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: tempo-query @@ -1718,7 +1722,7 @@ metadata: name: tempo-distributed-query-frontend namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.7.3 + helm.sh/chart: tempo-distributed-1.8.3 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend From 10157afa7215e27e05f316de90856affbee92d7c Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Mon, 19 Feb 2024 18:07:27 +0100 Subject: [PATCH 02/24] fix(unit-test): fix duplicate test name in tests.sh --- katalog/tests/tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/katalog/tests/tests.sh b/katalog/tests/tests.sh index e6a831d..0f36881 100755 --- a/katalog/tests/tests.sh +++ b/katalog/tests/tests.sh @@ -23,7 +23,7 @@ set -o pipefail apply katalog/minio-ha } -@test "wait for apply to settle and dump state to dump.json" { +@test "wait for apply to settle minio and dump state to dump.json" { info max_retry=0 echo "=====" $max_retry "=====" >&2 @@ -40,7 +40,7 @@ set -o pipefail apply katalog/tempo-distributed } -@test "wait for apply to settle and dump state to dump.json" { +@test "wait for apply to settle tempo-distributed and dump state to dump.json" { info max_retry=0 echo "=====" $max_retry "=====" >&2 From 0d089eb67714f1ce1189c7e71dd62f00172ca788 Mon Sep 17 00:00:00 2001 From: Marco Ferraioli Date: Tue, 20 Feb 2024 11:36:55 +0100 Subject: [PATCH 03/24] docs: add release note for new version, update compatibility matrix --- docs/COMPATIBILITY_MATRIX.md | 11 ++++++----- docs/releases/v1.0.3.md | 23 +++++++++++++++++++++++ 2 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 docs/releases/v1.0.3.md diff --git a/docs/COMPATIBILITY_MATRIX.md b/docs/COMPATIBILITY_MATRIX.md index 428cc5a..e0ee181 100644 --- a/docs/COMPATIBILITY_MATRIX.md +++ b/docs/COMPATIBILITY_MATRIX.md @@ -1,10 +1,11 @@ # Compatibility Matrix -| Module Version / Kubernetes Version | 1.26.X | 1.27.X | -| ----------------------------------- | ------------------ | ------------------ | -| v1.0.0 | :white_check_mark: | :white_check_mark: | -| v1.0.1 | :white_check_mark: | :white_check_mark: | -| v1.0.2 | :white_check_mark: | :white_check_mark: | +| Module Version / Kubernetes Version | 1.26.X | 1.27.X | 1.28.X | 1.29.X | +|-------------------------------------|--------------------|--------------------|--------------------|--------------------| +| v1.0.0 | :white_check_mark: | :white_check_mark: | | | +| v1.0.1 | :white_check_mark: | :white_check_mark: | | | +| v1.0.2 | :white_check_mark: | :white_check_mark: | | | +| v1.0.3 | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | - :white_check_mark: Compatible diff --git a/docs/releases/v1.0.3.md b/docs/releases/v1.0.3.md new file mode 100644 index 0000000..deb0ca8 --- /dev/null +++ b/docs/releases/v1.0.3.md @@ -0,0 +1,23 @@ +# Tracing Core Module Release 1.0.3 + +Welcome to the latest release of the `tracing` module of [`Kubernetes Fury Distribution`](https://github.com/sighupio/fury-distribution) maintained by team SIGHUP. + +This patch release changes how kustomize generate the configMap for tempo, using a generator. + +## Component Images 🚢 + +| Component | Supported Version | Previous Version | +| ------------------- | --------------------------------------------------------------------------------------------------- | ---------------- | +| `tempo-distributed` | [`v2.3.1`](https://github.com/grafana/tempo/releases/tag/v2.3.1) | `No Update` | +| `minio-ha` | [`vRELEASE.2023-01-12T02-06-16Z`](https://github.com/minio/minio/tree/RELEASE.2023-01-12T02-06-16Z) | `No Update` | + +## Update Guide 🦮 + +### Process + +To upgrade the module run: + +```bash +kustomize build | kubectl apply -f - +``` + From 926afe7f8bbefe7e39db5b21989464b4abc57ba6 Mon Sep 17 00:00:00 2001 From: Marco Ferraioli Date: Tue, 20 Feb 2024 12:01:04 +0100 Subject: [PATCH 04/24] docs: update README with new deployment method, rename old to 'Legacy Deployment' --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 1023e47..50cc0d1 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,22 @@ Check the [compatibility matrix][compatibility-matrix] for additional informatio ### Deployment +For the new deployment method, you should include the tracing module configuration in your `furyctl.yaml` file, specifically under the `spec.distribution.modules.tracing` section. This streamlined approach enhances the deployment process by seamlessly integrating with the Kubernetes Fury Distribution management tools. + +Here is an example snippet for the `furyctl.yaml` file that demonstrates how to configure the tracing module with Tempo as the tracing system and High Availability (HA) MinIO instance for storage: + +```yaml +spec: + distribution: + modules: + tracing: + type: tempo +``` + +By adopting this configuration, you deploy the Tempo tracing system accompanied by an HA MinIO instance as the storage backend. This setup allows flexibility in choosing different storage backends and adjusting retention policies according to your needs. For more detailed information on configuring the tracing module, including alternative storage options and retention policy adjustments, refer to the [official documentation](https://docs.kubernetesfury.com/docs/furyctl/providers/kfddistribution#specdistributionmodulestracing). + +### Legacy Deployment + 1. List the packages you want to deploy and their version in a `Furyfile.yml` ```yaml From 6d22b882315202d01980702ecf9a05b6cf3b79fa Mon Sep 17 00:00:00 2001 From: Marco Ferraioli Date: Wed, 21 Feb 2024 10:46:32 +0100 Subject: [PATCH 05/24] feat: add Makefile to project --- Makefile | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 Makefile diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..3e5e05d --- /dev/null +++ b/Makefile @@ -0,0 +1,96 @@ + +.DEFAULT_GOAL: help +SHELL := /bin/bash + +PROJECTNAME := "fury-kubernetes-tracing" +VERSION := $(shell (git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)' --count=1 | sed -Ee 's/^refs\/tags\/v|-.*//')) + +.PHONY: help +all: help +help: Makefile + @echo + @echo " Choose a command to run in "$(PROJECTNAME)":" + @echo + @sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' + @echo + +.PHONY: version +## version: lists the latest version of tool +version: + @echo v$(VERSION) + +check-variable-%: # detection of undefined variables. + @[[ "${${*}}" ]] || (echo '*** Please define variable `${*}` ***' && exit 1) + +check-release-file-%: # checks if a release doc exists + $(eval tag := `echo "${*}" | sed -e "s/-rc.//"`) + $(eval release_file := "docs/releases/${tag}.md") + @test -f ${release_file} || (echo "*** Please define file ${release_file} ***" && exit 1) + +bumpversion-requirements: check-docker + @docker build --no-cache --pull --target bumpversion-requirement -f build/builder/Dockerfile -t ${PROJECTNAME}:local-bumpversion-requirements . + +SEMVER_TYPES := major minor patch +BUMP_TARGETS := $(addprefix bump-,$(SEMVER_TYPES)) +.PHONY: $(BUMP_TARGETS) +## bump-major: Bumps the module up by a major version +## bump-minor: Bumps the module up by a minor version +## bump-patch: Bumps the module up by a patch version +$(BUMP_TARGETS): bumpversion-requirements + $(eval bump_type := $(strip $(word 2,$(subst -, ,$@)))) + @echo "Making a ${bump_type} tag" + @docker run --rm -v ~/.gitconfig:/etc/gitconfig -v ${PWD}:/src -w /src ${PROJECTNAME}:local-bumpversion-requirements $(bump_type) + @$(MAKE) clean-bumpversion-requirements + +## bump-rc: Bumps the module up by a release candidate (this only adds a tag, and not bump the version in labels) +.PHONY: +bump-rc: check-variable-TAG check-release-file-$(TAG) + @echo "Making ${TAG} tag" + @git tag ${TAG} + +check-%: # detection of required software. + @which ${*} > /dev/null || (echo '*** Please install `${*}` ***' && exit 1) + +license-requirements: check-docker + @docker build --no-cache --pull --target add-license-requirement -f build/builder/Dockerfile -t ${PROJECTNAME}:local-license-requirements . + +## add-license: Add license headers in all files in the project +add-license: license-requirements + @docker run --rm -v ${PWD}:/src -w /src ${PROJECTNAME}:local-license-requirements addlicense -c "SIGHUP s.r.l" -v -l bsd . + @$(MAKE) clean-license-requirements + +## check-license: Check license headers are in-place in all files in the project +check-license: check-docker + @docker build --no-cache --pull --target check-license -f build/builder/Dockerfile -t ${PROJECTNAME}:local-license . + @$(MAKE) clean-license + +## check-label: Check if labels are present in all kustomization files +check-label: check-docker + @docker build --no-cache --pull --target checklabel -f build/builder/Dockerfile -t ${PROJECTNAME}:checklabel . + +## lint: Run the policeman over the repository +lint: check-docker + @docker build --no-cache --pull --target linter -f build/builder/Dockerfile -t ${PROJECTNAME}:local-lint . + @$(MAKE) clean-lint + +## deploy-all: Deploys all the components in the tracing module +deploy-all: deploy-minio deploy-tempo + +## deploy-minio: Deploys the `minio` component in the cluster +deploy-minio: check-kustomize check-kubectl + @kustomize build katalog/minio-ha | kubectl apply -f- + +## deploy-tempo: Deploys the `tempo` component in the cluster +deploy-tempo: check-kustomize check-kubectl + @kustomize build katalog/tempo-distributed | kubectl apply -f- + +## clean-%: Clean the container image resulting from another target. make build clean-build +clean-%: + docker rmi -f ${PROJECTNAME}:local-${*} + +jsonbuilder: + @docker build --no-cache --pull --target jsonbuilder -f build/builder/Dockerfile -t ${PROJECTNAME}:jsonbuilder . + +## build-canonical-json: Build a canonical JSON for any tag of module, only to be run inside a clean working directory +build-canonical-json: check-docker check-variable-TAG jsonbuilder + @docker run -ti --rm -v $(PWD):/app -w /app ${PROJECTNAME}:jsonbuilder build-json -m=$(PROJECTNAME) -v=${TAG} . \ No newline at end of file From a8165ad8f792fe32adae360b71ed3b4ee644a3dc Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:44:25 +0100 Subject: [PATCH 06/24] feat(ci): add linter dockerfile and contributing file --- build/builder/Dockerfile | 55 ++++++++++++++ docs/CONTRIBUTING.md | 156 ++++++++++++++++++++++++++++++++++++++- 2 files changed, 210 insertions(+), 1 deletion(-) create mode 100644 build/builder/Dockerfile diff --git a/build/builder/Dockerfile b/build/builder/Dockerfile new file mode 100644 index 0000000..a0532e7 --- /dev/null +++ b/build/builder/Dockerfile @@ -0,0 +1,55 @@ +# Copyright (c) 2021 SIGHUP s.r.l All rights reserved. +# Use of this source code is governed by a BSD-style +# license that can be found in the LICENSE file. + +# hadolint ignore=DL3007 +FROM quay.io/sighup/policeman:latest as linter + +ENV VALIDATE_KUBERNETES_KUBEVAL="false" +ENV VALIDATE_JSCPD="false" +ENV VALIDATE_DOCKERFILE="false" + +RUN mkdir /app +WORKDIR /app + +COPY . . + +RUN npm install -g embedme@1.22.0 && /entrypoint.sh && embedme --verify "**/*.md" + +FROM golang:1.16 as add-license-requirement + +RUN go get -u github.com/google/addlicense && addlicense -c "SIGHUP s.r.l" -v -l bsd . + +FROM golang:1.16 as check-license + +RUN go get -u github.com/google/addlicense && mkdir /app + +WORKDIR /app + +COPY . . + +RUN addlicense -c "SIGHUP s.r.l" -v -l bsd --check . + +FROM openpolicyagent/conftest:v0.28.1 as checklabel + +RUN mkdir /app +WORKDIR /app + +COPY . . + +RUN conftest pull https://raw.githubusercontent.com/sighupio/ci-commons/main/conftest/kustomization/kfd-labels.rego && \ + conftest test katalog/**/kustomization.yaml + +FROM registry.sighup.io/poc/fury-repo-automations:v0.0.3 as jsonbuilder + +RUN mkdir /app +WORKDIR /app + +COPY . . + +FROM python:3.9-alpine as bumpversion-requirement + +# hadolint ignore=DL3018 +RUN apk add git --no-cache && pip --no-cache-dir install bump2version==1.0.1 + +ENTRYPOINT ["/usr/local/bin/bumpversion"] \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index f9e3e94..519ef50 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,3 +1,157 @@ # Contribution -TODO \ No newline at end of file +Read the following guide about how to contribute to this project and get +familiar with. + +## Make + +This project contains an easy-to-use interface with a `Makefile`. It allows you +to pass all the checks the pipeline will pass on certain events. So it worth get +familiar with all the targets. To know what targets are available in the project +just run: + +```bash +$ make help + + Choose a command to run in fury-kubernetes-tracing: + + version lists the latest version of tool + bump-major Bumps the module up by a major version + bump-minor Bumps the module up by a minor version + bump-patch Bumps the module up by a patch version + bump-rc Bumps the module up by a release candidate (this only adds a tag, and not bump the version in labels) + add-license Add license headers in all files in the project + check-license Check license headers are in-place in all files in the project + check-label Check if labels are present in all kustomization files + lint Run the policeman over the repository + deploy-all Deploys all the components in the tracing module + deploy-minio Deploys the `minio` component in the cluster + deploy-tempo Deploys the `tempo` component in the cluster + clean-% Clean the container image resulting from another target. make build clean-build + build-canonical-json Build a canonical JSON for any tag of module, only to be run inside a clean working directory +``` + +## bump-version (Release process) + +`bump-%v` targets is the recommended way of creating a new release in this +module. This target internally uses +[`bump2version`](https://github.com/c4urself/bump2version/#installation) to bump +the versions of the module in the `examples` directory and the `kustomization` +labels. Then it creates the tag corresponding to the target chosen. We follow +semantic versioning and following is the criteria for versions: + +- `bump-major`: Bumps up a major version, i.e. from 1.x.y -> 2.0.0 +- `bump-major`: Bumps up a major version, i.e. from x.2.y -> x.2.0 +- `bump-patch`: Bumps up a patch version, i.e. from x.y.2 -> x.y.3 +- `bump-rc`: Creates an `rc(release candidate)` tag based on the env + variable `TAG` to be given with the make call. + +Before bumping the version, make sure you have a file in the directory +`docs/releases/` with the name of the new tag to be created. That is if you are +planning to make a patch release to version `v1.9.2`, create a file +`docs/releases/v1.9.2.md` with the release notes. You can see an example +[here](releases/v0.1.0.md). Commit all the change with appropriate commit messages. + +Before a real release(major, minor or patch) is made, it is recommended +to create a patch release to make sure that the module is ready for the +real release. For this you can use the target `bump-rc`. + +`bump-rc` works a bit differently in that it does not bump the versions in the +`kustomization` files or `Furyfiles` as configured in `.bumpversion.cfg`. The +assumption behind this being the considering that a pre-release is more like a +draft release. Another difference of this target is, it expects the rc tag name as +a variable `TAG` along with the `make` call. This is because it is otherwise +quite difficult to interpret which is the target version for which a `rc` is +being created. So the example usage is: + +```bash +$ TAG=v1.9.2-rc1 make bump-rc +# This essentially creates a tag `v1.9.2-rc1` which we can push to github to create a pre-release +``` + +Then, in order to release it(assuming from version `1.9.1` to `1.9.2` - so a +patch release): + +```bash +$ make bump-patch +Making a patch tag +$ git push --tags origin master +# This should trigger the drone pipeline to publish the new release with the release notes from the file created. +``` + +## lint + +To ensure the code-bases follow a standard, we have automated pipelines testing +for the linting rules. If one has to test if the rules are respected locally, +the following command can be run: + +```bash +$ make lint +# This will use a dockerised super-linter library to run linting +``` + +## add-license and check-license + +### check-license + +This target ensures that a BSD license clause-3 copyrighted to `SIGHUP +s.r.l` is added to all the code files in the repository. To run the +check, run the command: + +```bash +$ make check-license +# This will use a dockerised `addlicense` library to run check for labels +``` + +### add-license + +We ensure all of our files are LICENSED respecting the community standards. The +automated drone pipelines fail, if some files are left without license. To add +our preferred license(BSD clause-3), one could locally run: + +```bash +$ make add-license +# This will use a dockerised `addlicense` library to add license to the +# missing files +``` + +## clean-%v + +The `clean-%v` target has been designed to remove the local built image +resulting from the different targets in the [`Makefile`](Makefile). + +The main reason to implement this target is to save disk space. `clean-%v` +target is automatically called in the targets `lint` and `add-license`. + +## Check-label + +This targets verifies that required labels for KFD modules exist in each +kustomization file in the repo. The list of required labels and this +check can be found +[here](https://github.com/sighupio/ci-commons/blob/main/conftest/kustomization/kfd-labels.md). + +## Deploy + +To deploy the components available under this module easily, some make targets +are bundled in this repo. You can see the available option in the `make help`. +To deploy a minimal working setup of this module, one could run the following +command, which in turn triggers other make targets for individual components: + +```bash +$ make deploy-all +# This deploys calico and ip-masq +``` + +## build-canonical-json + +> Warning: run this command only inside a clean working directory. + +These two targets can be used to create the canonical definition for the +module or an existing TAG. The following are the usages: + +```bash +$ TAG=v1.9.1 make build-canonical-json +INFO[0000] Building JSON for: module fury-kubernetes-tracing, version v1.9.1 +``` + +The above command builds a canonical JSON parsing the version `v1.9.1`. From 0fc5158ce086152572de21d5f68640bc41a19004 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Wed, 21 Feb 2024 14:45:16 +0100 Subject: [PATCH 07/24] chore: bump manifests version to 1.8.4 --- katalog/tempo-distributed/MAINTENANCE.md | 2 +- katalog/tempo-distributed/deploy.yaml | 92 ++++++++++++------------ 2 files changed, 47 insertions(+), 47 deletions(-) diff --git a/katalog/tempo-distributed/MAINTENANCE.md b/katalog/tempo-distributed/MAINTENANCE.md index 461c0ba..fe94243 100644 --- a/katalog/tempo-distributed/MAINTENANCE.md +++ b/katalog/tempo-distributed/MAINTENANCE.md @@ -6,7 +6,7 @@ To maintain the Tempo package, you should follow this steps. helm repo add grafana https://grafana.github.io/helm-charts helm repo update helm search repo grafana/tempo-distributed # get the latest chart version -helm pull grafana/tempo-distributed --version 1.8.3 --untar --untardir /tmp # this command will download the chart in /tmp/tempo-distributed +helm pull grafana/tempo-distributed --version 1.8.4 --untar --untardir /tmp # this command will download the chart in /tmp/tempo-distributed ``` Run the following command: diff --git a/katalog/tempo-distributed/deploy.yaml b/katalog/tempo-distributed/deploy.yaml index 8f7bf9b..57f4079 100644 --- a/katalog/tempo-distributed/deploy.yaml +++ b/katalog/tempo-distributed/deploy.yaml @@ -9,7 +9,7 @@ kind: PodDisruptionBudget metadata: name: tempo-distributed-ingester labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -31,7 +31,7 @@ metadata: name: tempo-distributed namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -44,7 +44,7 @@ kind: ConfigMap metadata: name: tempo-distributed-runtime labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -62,7 +62,7 @@ metadata: name: tempo-distributed-gateway namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -150,7 +150,7 @@ kind: Service metadata: name: tempo-distributed-compactor labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: compactor @@ -175,7 +175,7 @@ metadata: name: tempo-distributed-distributor-discovery namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -237,7 +237,7 @@ metadata: name: tempo-distributed-distributor namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -301,7 +301,7 @@ metadata: name: tempo-distributed-gateway namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -327,7 +327,7 @@ metadata: name: tempo-distributed-gossip-ring namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gossip-ring @@ -354,7 +354,7 @@ metadata: name: tempo-distributed-ingester-discovery namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -385,7 +385,7 @@ metadata: name: tempo-distributed-ingester namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -413,7 +413,7 @@ metadata: name: tempo-distributed-memcached namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -439,7 +439,7 @@ metadata: name: tempo-distributed-querier namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -467,7 +467,7 @@ metadata: name: tempo-distributed-query-frontend-discovery namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend @@ -501,7 +501,7 @@ metadata: name: tempo-distributed-query-frontend namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend @@ -529,7 +529,7 @@ metadata: name: tempo-distributed-compactor namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: compactor @@ -552,7 +552,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -560,7 +560,7 @@ spec: app.kubernetes.io/component: compactor app.kubernetes.io/part-of: memberlist annotations: - checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae + checksum/config: 45e72a4bc751e1d01213d9ed8275ebd03ce930e576bba0d664f4b97dc5e245f8 spec: serviceAccountName: tempo-distributed securityContext: @@ -627,7 +627,7 @@ metadata: name: tempo-distributed-distributor namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -645,7 +645,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -653,7 +653,7 @@ spec: app.kubernetes.io/component: distributor app.kubernetes.io/part-of: memberlist annotations: - checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae + checksum/config: 45e72a4bc751e1d01213d9ed8275ebd03ce930e576bba0d664f4b97dc5e245f8 spec: serviceAccountName: tempo-distributed securityContext: @@ -780,7 +780,7 @@ metadata: name: tempo-distributed-gateway namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -797,7 +797,7 @@ spec: template: metadata: annotations: - checksum/config: bea4355bb563fa6da4ad8a30d3c7ce722091e6bc43b81550195763815ca2d90f + checksum/config: f7aba320959598ccac550e26dea6b0affc9e9b9c92dbba33630666d49961af69 labels: app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed @@ -891,7 +891,7 @@ metadata: name: tempo-distributed-querier namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -913,7 +913,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -921,7 +921,7 @@ spec: app.kubernetes.io/component: querier app.kubernetes.io/part-of: memberlist annotations: - checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae + checksum/config: 45e72a4bc751e1d01213d9ed8275ebd03ce930e576bba0d664f4b97dc5e245f8 spec: serviceAccountName: tempo-distributed securityContext: @@ -1024,7 +1024,7 @@ metadata: name: tempo-distributed-query-frontend namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend @@ -1046,14 +1046,14 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" app.kubernetes.io/managed-by: Helm app.kubernetes.io/component: query-frontend annotations: - checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae + checksum/config: 45e72a4bc751e1d01213d9ed8275ebd03ce930e576bba0d664f4b97dc5e245f8 spec: serviceAccountName: tempo-distributed securityContext: @@ -1148,7 +1148,7 @@ kind: HorizontalPodAutoscaler metadata: name: tempo-distributed-distributor labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -1176,7 +1176,7 @@ metadata: name: tempo-distributed-gateway namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: gateway @@ -1203,7 +1203,7 @@ kind: HorizontalPodAutoscaler metadata: name: tempo-distributed-querier labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -1231,7 +1231,7 @@ metadata: name: tempo-distributed-ingester namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -1253,7 +1253,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -1261,7 +1261,7 @@ spec: app.kubernetes.io/component: ingester app.kubernetes.io/part-of: memberlist annotations: - checksum/config: b76463b7fb06b122ede19a222a5c8313c902854f4ef5ea5cb826c84f7231b8ae + checksum/config: 45e72a4bc751e1d01213d9ed8275ebd03ce930e576bba0d664f4b97dc5e245f8 spec: serviceAccountName: tempo-distributed securityContext: @@ -1366,7 +1366,7 @@ metadata: name: tempo-distributed-memcached namespace: tracing labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -1383,7 +1383,7 @@ spec: template: metadata: labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -1456,7 +1456,7 @@ kind: PrometheusRule metadata: name: tempo-distributed labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/version: "2.3.1" @@ -1472,7 +1472,7 @@ metadata: name: tempo-distributed-compactor namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: compactor @@ -1508,7 +1508,7 @@ metadata: name: tempo-distributed-distributor namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: distributor @@ -1544,7 +1544,7 @@ metadata: name: tempo-distributed-ingester namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: ingester @@ -1580,7 +1580,7 @@ metadata: name: tempo-distributed-memcached namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: memcached @@ -1615,7 +1615,7 @@ metadata: name: tempo-distributed-metrics-generator namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: metrics-generator @@ -1651,7 +1651,7 @@ metadata: name: tempo-distributed-querier namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: querier @@ -1687,7 +1687,7 @@ metadata: name: tempo-distributed-tempo-query namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: tempo-query @@ -1722,7 +1722,7 @@ metadata: name: tempo-distributed-query-frontend namespace: "tracing" labels: - helm.sh/chart: tempo-distributed-1.8.3 + helm.sh/chart: tempo-distributed-1.8.4 app.kubernetes.io/name: tempo app.kubernetes.io/instance: tempo-distributed app.kubernetes.io/component: query-frontend From de5bf73243172cf733a3182d4dd20ac6a1cbab75 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Wed, 21 Feb 2024 16:25:34 +0100 Subject: [PATCH 08/24] chore: linting --- docs/CONTRIBUTING.md | 8 ++++---- katalog/minio-ha/README.md | 5 ++--- katalog/tests/kind/config.yml | 1 + 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 519ef50..3a2b97e 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -58,7 +58,7 @@ real release. For this you can use the target `bump-rc`. `bump-rc` works a bit differently in that it does not bump the versions in the `kustomization` files or `Furyfiles` as configured in `.bumpversion.cfg`. The -assumption behind this being the considering that a pre-release is more like a +assumption behind this being the considering that a prerelease is more like a draft release. Another difference of this target is, it expects the rc tag name as a variable `TAG` along with the `make` call. This is because it is otherwise quite difficult to interpret which is the target version for which a `rc` is @@ -66,7 +66,7 @@ being created. So the example usage is: ```bash $ TAG=v1.9.2-rc1 make bump-rc -# This essentially creates a tag `v1.9.2-rc1` which we can push to github to create a pre-release +# This essentially creates a tag `v1.9.2-rc1` which we can push to github to create a prerelease ``` Then, in order to release it(assuming from version `1.9.1` to `1.9.2` - so a @@ -126,14 +126,14 @@ target is automatically called in the targets `lint` and `add-license`. ## Check-label This targets verifies that required labels for KFD modules exist in each -kustomization file in the repo. The list of required labels and this +kustomization file in the repository. The list of required labels and this check can be found [here](https://github.com/sighupio/ci-commons/blob/main/conftest/kustomization/kfd-labels.md). ## Deploy To deploy the components available under this module easily, some make targets -are bundled in this repo. You can see the available option in the `make help`. +are bundled in this repository. You can see the available option in the `make help`. To deploy a minimal working setup of this module, one could run the following command, which in turn triggers other make targets for individual components: diff --git a/katalog/minio-ha/README.md b/katalog/minio-ha/README.md index f25429b..d5c7b0f 100644 --- a/katalog/minio-ha/README.md +++ b/katalog/minio-ha/README.md @@ -4,8 +4,7 @@ MinIO is a popular distributed object storage system that allows organizations to deploy highly available and scalable storage infrastructure. -In order to achieve high availability (HA) for MinIO, a cluster of multiple MinIO nodes must be deployed, -with each node having access to its own set of PVCs. +In order to achieve high availability (HA) for MinIO, a cluster of multiple MinIO nodes must be deployed backed by their own set of PVCs. ## Requirements @@ -19,7 +18,7 @@ with each node having access to its own set of PVCs. ## Image repository and tag * MinIO image: `minio/minio` -* MinIO repo: [MinIO on Github][minio-gh] +* MinIO repo: [MinIO on GitHub][minio-gh] ## Configuration diff --git a/katalog/tests/kind/config.yml b/katalog/tests/kind/config.yml index b80a097..aab9313 100644 --- a/katalog/tests/kind/config.yml +++ b/katalog/tests/kind/config.yml @@ -2,6 +2,7 @@ # Use of this source code is governed by a BSD-style # license that can be found in the LICENSE file. +--- kind: Cluster apiVersion: kind.x-k8s.io/v1alpha4 networking: From ed4ecfef76c0428009f0c1925fa5828038fd53f0 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Thu, 22 Feb 2024 17:38:24 +0100 Subject: [PATCH 09/24] docs: minor changes on main README.md file --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 50cc0d1..142d1fd 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ Kubernetes Fury Tracing -![Release](https://img.shields.io/badge/Latest%20Release-v1.0.2-blue) +![Release](https://img.shields.io/badge/Latest%20Release-v1.0.3-blue) ![License](https://img.shields.io/github/license/sighupio/fury-kubernetes-tracing?label=License) ![Slack](https://img.shields.io/badge/slack-@kubernetes/fury-yellow.svg?logo=slack&label=Slack) @@ -17,7 +17,7 @@ If you are new to KFD please refer to the [official documentation][kfd-docs] on **Kubernetes Fury Tracing** uses a collection of open source tools to provide the most resilient and robust tracing stack for the cluster. -The module right now contains only the [tempo][tempo-page] tool from grafana. +The module contains the [tempo][tempo-page] tool from grafana. All the components are deployed in the `tracing` namespace in the cluster. @@ -34,6 +34,8 @@ Click on each package to see its full documentation. | ------------------ | :----------------: | --------------- | | `1.26.x` | :white_check_mark: | No known issues | | `1.27.x` | :white_check_mark: | No known issues | +| `1.28.x` | :white_check_mark: | No known issues | +| `1.29.x` | :white_check_mark: | No known issues | Check the [compatibility matrix][compatibility-matrix] for additional informations about previous releases of the modules. @@ -48,7 +50,7 @@ Check the [compatibility matrix][compatibility-matrix] for additional informatio ### Deployment -For the new deployment method, you should include the tracing module configuration in your `furyctl.yaml` file, specifically under the `spec.distribution.modules.tracing` section. This streamlined approach enhances the deployment process by seamlessly integrating with the Kubernetes Fury Distribution management tools. +Include the tracing module configuration in your `furyctl.yaml` file, specifically under the `spec.distribution.modules.tracing` section. This streamlined approach enhances the deployment process by seamlessly integrating with the Kubernetes Fury Distribution management tools. Here is an example snippet for the `furyctl.yaml` file that demonstrates how to configure the tracing module with Tempo as the tracing system and High Availability (HA) MinIO instance for storage: @@ -58,10 +60,10 @@ spec: modules: tracing: type: tempo + minio: + storageSize: "20Gi" ``` -By adopting this configuration, you deploy the Tempo tracing system accompanied by an HA MinIO instance as the storage backend. This setup allows flexibility in choosing different storage backends and adjusting retention policies according to your needs. For more detailed information on configuring the tracing module, including alternative storage options and retention policy adjustments, refer to the [official documentation](https://docs.kubernetesfury.com/docs/furyctl/providers/kfddistribution#specdistributionmodulestracing). - ### Legacy Deployment 1. List the packages you want to deploy and their version in a `Furyfile.yml` @@ -69,7 +71,7 @@ By adopting this configuration, you deploy the Tempo tracing system accompanied ```yaml bases: - name: tracing - version: "v1.0.2" + version: "v1.0.3" ``` > See `furyctl` [documentation][furyctl-repo] for additional details about `Furyfile.yml` format. From 2b29e0f0f6b7929a77916ae6ac9b410fbc4a48ab Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Thu, 22 Feb 2024 18:00:24 +0100 Subject: [PATCH 10/24] feat(ci): add 1.28 e2e tests --- .drone.yml | 101 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) diff --git a/.drone.yml b/.drone.yml index dcbb197..bfecadb 100644 --- a/.drone.yml +++ b/.drone.yml @@ -297,7 +297,107 @@ steps: volumes: - name: shared temp: {} +--- +name: e2e-kubernetes-1.28 +kind: pipeline +type: docker + +depends_on: + - policeman + +node: + runner: internal + +platform: + os: linux + arch: amd64 + +trigger: + ref: + include: + - refs/heads/master + - refs/heads/main + - refs/tags/** +steps: + - name: init + image: quay.io/sighup/e2e-testing-drone-plugin:v2.0.0 + pull: always + volumes: + - name: shared + path: /shared + depends_on: [ clone ] + settings: + action: custom-cluster-128 + pipeline_id: cluster-127 + local_kind_config_path: katalog/tests/kind/config.yml + cluster_version: "1.28.0" + instance_path: /shared + instance_size: 2-extra-large + aws_default_region: + from_secret: aws_region + aws_access_key_id: + from_secret: aws_access_key_id + aws_secret_access_key: + from_secret: aws_secret_access_key + terraform_tf_states_bucket_name: + from_secret: terraform_tf_states_bucket_name + vsphere_server: + from_secret: vsphere_server + vsphere_password: + from_secret: vsphere_password + vsphere_user: + from_secret: vsphere_user + dockerhub_username: + from_secret: dockerhub_username + dockerhub_password: + from_secret: dockerhub_password + + - name: e2e + # KUBECTL 1.27.1 - KUSTOMIZE 3.5.3 - HELM 3.1.1 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0 + image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.1.1_1.9.4_1.26.3_3.5.3_4.33.3 + pull: always + volumes: + - name: shared + path: /shared + depends_on: [ init ] + commands: + - export KUBECONFIG=/shared/kube/kubeconfig-128 + - bats -t katalog/tests/tests.sh + + - name: destroy + image: quay.io/sighup/e2e-testing-drone-plugin:v2.2.0 + pull: always + depends_on: [ e2e ] + settings: + action: destroy + pipeline_id: cluster-128 + aws_default_region: + from_secret: aws_region + aws_access_key_id: + from_secret: aws_access_key_id + aws_secret_access_key: + from_secret: aws_secret_access_key + terraform_tf_states_bucket_name: + from_secret: terraform_tf_states_bucket_name + vsphere_server: + from_secret: vsphere_server + vsphere_password: + from_secret: vsphere_password + vsphere_user: + from_secret: vsphere_user + dockerhub_username: + from_secret: dockerhub_username + dockerhub_password: + from_secret: dockerhub_password + when: + status: + - success + - failure + +volumes: + - name: shared + temp: {} --- name: release kind: pipeline @@ -306,6 +406,7 @@ type: docker depends_on: - e2e-kubernetes-1.26 - e2e-kubernetes-1.27 + - e2e-kubernetes-1.28 platform: os: linux From 5b78364959a6d79d0527e6d125f2b069eb1a95db Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:23:27 +0100 Subject: [PATCH 11/24] fix(ci): use kind clusters on drone's worker node --- .drone.yml | 337 +++++++++++++++++++++++------------------------------ 1 file changed, 149 insertions(+), 188 deletions(-) diff --git a/.drone.yml b/.drone.yml index bfecadb..67f95d6 100644 --- a/.drone.yml +++ b/.drone.yml @@ -118,84 +118,71 @@ trigger: - refs/tags/** steps: - - name: init - image: quay.io/sighup/e2e-testing-drone-plugin:v1.26.4 + - name: create Kind cluster + image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0 pull: always volumes: - - name: shared - path: /shared - depends_on: [ clone ] - settings: - action: custom-cluster-126 - pipeline_id: cluster-126 - local_kind_config_path: katalog/tests/kind/config.yml - cluster_version: '1.26.4' - instance_path: /shared - instance_size: 2-extra-large - aws_default_region: - from_secret: aws_region - aws_access_key_id: - from_secret: aws_access_key_id - aws_secret_access_key: - from_secret: aws_secret_access_key - terraform_tf_states_bucket_name: - from_secret: terraform_tf_states_bucket_name - vsphere_server: - from_secret: vsphere_server - vsphere_password: - from_secret: vsphere_password - vsphere_user: - from_secret: vsphere_user - dockerhub_username: - from_secret: dockerhub_username - dockerhub_password: - from_secret: dockerhub_password + - name: dockersock + path: /var/run/docker.sock + environment: + CLUSTER_VERSION: v1.26.4 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + # /drone/src is the default workdir for the pipeline + # using this folder we don't need to mount another + # shared volume between the steps + KUBECONFIG: /drone/src/kubeconfig + commands: + # create a custom config to disable Kind's default CNI so + # we can test using KFD's networking module. + - | + cat < kind-config.yaml + kind: Cluster + apiVersion: kind.x-k8s.io/v1alpha4 + networking: + disableDefaultCNI: false + EOF + # NOTE: kind's `--wait` flag that waits for the control-plane ot be ready + # does not work when disabling the default CNI. It will always go in timeout. + - kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config kind-config.yaml + # save the kubeconfig so we can use it from other steps. + - kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG} - name: e2e - # KUBECTL 1.25.3 - KUSTOMIZE 3.5.3 - HELM 3.1.1 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0 + # KUBECTL 1.27.1 - KUSTOMIZE 3.5.3 - HELM 3.1.1 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0 image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.1.1_1.9.4_1.26.3_3.5.3_4.33.3 pull: always - volumes: - - name: shared - path: /shared - depends_on: [ init ] + network_mode: host + environment: + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + KUBECONFIG: /drone/src/kubeconfig + FURYCTL_VERSION: v0.27.2 + depends_on: [create Kind cluster] commands: - - export KUBECONFIG=/shared/kube/kubeconfig-126 + - cp $${KUBECONFIG} /tmp/kubeconfig + - export KUBECONFIG=/tmp/kubeconfig - bats -t katalog/tests/tests.sh - - name: destroy - image: quay.io/sighup/e2e-testing-drone-plugin:v1.26.4 - pull: always - depends_on: [ e2e ] - settings: - action: destroy - pipeline_id: cluster-126 - aws_default_region: - from_secret: aws_region - aws_access_key_id: - from_secret: aws_access_key_id - aws_secret_access_key: - from_secret: aws_secret_access_key - terraform_tf_states_bucket_name: - from_secret: terraform_tf_states_bucket_name - vsphere_server: - from_secret: vsphere_server - vsphere_password: - from_secret: vsphere_password - vsphere_user: - from_secret: vsphere_user - dockerhub_username: - from_secret: dockerhub_username - dockerhub_password: - from_secret: dockerhub_password + - name: delete-kind-cluster + image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0 + volumes: + - name: dockersock + path: /var/run/docker.sock + environment: + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + commands: + # does not matter if the command fails + - kind delete cluster --name $${CLUSTER_NAME} || true + depends_on: + - e2e-kfddistribution when: status: - success - failure volumes: - - name: shared - temp: {} + - name: dockersock + host: + path: /var/run/docker.sock --- name: e2e-kubernetes-1.27 kind: pipeline @@ -219,84 +206,71 @@ trigger: - refs/tags/** steps: - - name: init - image: quay.io/sighup/e2e-testing-drone-plugin:v1.27.1 + - name: create Kind cluster + image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0 pull: always volumes: - - name: shared - path: /shared - depends_on: [ clone ] - settings: - action: custom-cluster-127 - pipeline_id: cluster-127 - local_kind_config_path: katalog/tests/kind/config.yml - cluster_version: "1.27.1" - instance_path: /shared - instance_size: 2-extra-large - aws_default_region: - from_secret: aws_region - aws_access_key_id: - from_secret: aws_access_key_id - aws_secret_access_key: - from_secret: aws_secret_access_key - terraform_tf_states_bucket_name: - from_secret: terraform_tf_states_bucket_name - vsphere_server: - from_secret: vsphere_server - vsphere_password: - from_secret: vsphere_password - vsphere_user: - from_secret: vsphere_user - dockerhub_username: - from_secret: dockerhub_username - dockerhub_password: - from_secret: dockerhub_password + - name: dockersock + path: /var/run/docker.sock + environment: + CLUSTER_VERSION: v1.27.1 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + # /drone/src is the default workdir for the pipeline + # using this folder we don't need to mount another + # shared volume between the steps + KUBECONFIG: /drone/src/kubeconfig + commands: + # create a custom config to disable Kind's default CNI so + # we can test using KFD's networking module. + - | + cat < kind-config.yaml + kind: Cluster + apiVersion: kind.x-k8s.io/v1alpha4 + networking: + disableDefaultCNI: false + EOF + # NOTE: kind's `--wait` flag that waits for the control-plane ot be ready + # does not work when disabling the default CNI. It will always go in timeout. + - kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config kind-config.yaml + # save the kubeconfig so we can use it from other steps. + - kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG} - name: e2e # KUBECTL 1.27.1 - KUSTOMIZE 3.5.3 - HELM 3.1.1 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0 - image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.12.0_1.9.4_1.27.1_3.5.3_4.33.3 + image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.1.1_1.9.4_1.26.3_3.5.3_4.33.3 pull: always - volumes: - - name: shared - path: /shared - depends_on: [ init ] + network_mode: host + environment: + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + KUBECONFIG: /drone/src/kubeconfig + FURYCTL_VERSION: v0.27.2 + depends_on: [create Kind cluster] commands: - - export KUBECONFIG=/shared/kube/kubeconfig-127 + - cp $${KUBECONFIG} /tmp/kubeconfig + - export KUBECONFIG=/tmp/kubeconfig - bats -t katalog/tests/tests.sh - - name: destroy - image: quay.io/sighup/e2e-testing-drone-plugin:v1.27.1 - pull: always - depends_on: [ e2e ] - settings: - action: destroy - pipeline_id: cluster-127 - aws_default_region: - from_secret: aws_region - aws_access_key_id: - from_secret: aws_access_key_id - aws_secret_access_key: - from_secret: aws_secret_access_key - terraform_tf_states_bucket_name: - from_secret: terraform_tf_states_bucket_name - vsphere_server: - from_secret: vsphere_server - vsphere_password: - from_secret: vsphere_password - vsphere_user: - from_secret: vsphere_user - dockerhub_username: - from_secret: dockerhub_username - dockerhub_password: - from_secret: dockerhub_password + - name: delete-kind-cluster + image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0 + volumes: + - name: dockersock + path: /var/run/docker.sock + environment: + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + commands: + # does not matter if the command fails + - kind delete cluster --name $${CLUSTER_NAME} || true + depends_on: + - e2e-kfddistribution when: status: - success - failure volumes: - - name: shared - temp: {} + - name: dockersock + host: + path: /var/run/docker.sock --- name: e2e-kubernetes-1.28 kind: pipeline @@ -320,84 +294,71 @@ trigger: - refs/tags/** steps: - - name: init - image: quay.io/sighup/e2e-testing-drone-plugin:v2.0.0 + - name: create Kind cluster + image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0 pull: always volumes: - - name: shared - path: /shared - depends_on: [ clone ] - settings: - action: custom-cluster-128 - pipeline_id: cluster-127 - local_kind_config_path: katalog/tests/kind/config.yml - cluster_version: "1.28.0" - instance_path: /shared - instance_size: 2-extra-large - aws_default_region: - from_secret: aws_region - aws_access_key_id: - from_secret: aws_access_key_id - aws_secret_access_key: - from_secret: aws_secret_access_key - terraform_tf_states_bucket_name: - from_secret: terraform_tf_states_bucket_name - vsphere_server: - from_secret: vsphere_server - vsphere_password: - from_secret: vsphere_password - vsphere_user: - from_secret: vsphere_user - dockerhub_username: - from_secret: dockerhub_username - dockerhub_password: - from_secret: dockerhub_password + - name: dockersock + path: /var/run/docker.sock + environment: + CLUSTER_VERSION: v1.28.0 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + # /drone/src is the default workdir for the pipeline + # using this folder we don't need to mount another + # shared volume between the steps + KUBECONFIG: /drone/src/kubeconfig + commands: + # create a custom config to disable Kind's default CNI so + # we can test using KFD's networking module. + - | + cat < kind-config.yaml + kind: Cluster + apiVersion: kind.x-k8s.io/v1alpha4 + networking: + disableDefaultCNI: false + EOF + # NOTE: kind's `--wait` flag that waits for the control-plane ot be ready + # does not work when disabling the default CNI. It will always go in timeout. + - kind create cluster --name $${CLUSTER_NAME} --image registry.sighup.io/fury/kindest/node:$${CLUSTER_VERSION} --config kind-config.yaml + # save the kubeconfig so we can use it from other steps. + - kind get kubeconfig --name $${CLUSTER_NAME} > $${KUBECONFIG} - name: e2e # KUBECTL 1.27.1 - KUSTOMIZE 3.5.3 - HELM 3.1.1 - YQ 4.21.1 - ISTIOCTL 1.9.4 - FURYCTL 0.9.0 - BATS 1.1.0 image: quay.io/sighup/e2e-testing:1.1.0_0.11.0_3.1.1_1.9.4_1.26.3_3.5.3_4.33.3 pull: always - volumes: - - name: shared - path: /shared - depends_on: [ init ] + network_mode: host + environment: + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + KUBECONFIG: /drone/src/kubeconfig + FURYCTL_VERSION: v0.27.2 + depends_on: [create Kind cluster] commands: - - export KUBECONFIG=/shared/kube/kubeconfig-128 + - cp $${KUBECONFIG} /tmp/kubeconfig + - export KUBECONFIG=/tmp/kubeconfig - bats -t katalog/tests/tests.sh - - name: destroy - image: quay.io/sighup/e2e-testing-drone-plugin:v2.2.0 - pull: always - depends_on: [ e2e ] - settings: - action: destroy - pipeline_id: cluster-128 - aws_default_region: - from_secret: aws_region - aws_access_key_id: - from_secret: aws_access_key_id - aws_secret_access_key: - from_secret: aws_secret_access_key - terraform_tf_states_bucket_name: - from_secret: terraform_tf_states_bucket_name - vsphere_server: - from_secret: vsphere_server - vsphere_password: - from_secret: vsphere_password - vsphere_user: - from_secret: vsphere_user - dockerhub_username: - from_secret: dockerhub_username - dockerhub_password: - from_secret: dockerhub_password + - name: delete-kind-cluster + image: quay.io/sighup/dind-kind-kubectl-kustomize:0.20.0_1.29.1_3.10.0 + volumes: + - name: dockersock + path: /var/run/docker.sock + environment: + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + commands: + # does not matter if the command fails + - kind delete cluster --name $${CLUSTER_NAME} || true + depends_on: + - e2e-kfddistribution when: status: - success - failure volumes: - - name: shared - temp: {} + - name: dockersock + host: + path: /var/run/docker.sock --- name: release kind: pipeline From 2771b3e8d6a354711c4a1c9b7b8d4c15b92de857 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:34:36 +0100 Subject: [PATCH 12/24] fix(ci): fix steps dependency --- .drone.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index 67f95d6..3ab3a28 100644 --- a/.drone.yml +++ b/.drone.yml @@ -173,7 +173,7 @@ steps: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true depends_on: - - e2e-kfddistribution + - e2e when: status: - success @@ -261,7 +261,7 @@ steps: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true depends_on: - - e2e-kfddistribution + - e2e when: status: - success @@ -349,7 +349,7 @@ steps: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true depends_on: - - e2e-kfddistribution + - e2e when: status: - success From 8c5ca3994befde562ae1d715b9571665c6d59184 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:35:58 +0100 Subject: [PATCH 13/24] fix(ci): prevent conflicts in naming conventions when multiple clusters are defined in the same dronefile --- .drone.yml | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 3ab3a28..494ebd7 100644 --- a/.drone.yml +++ b/.drone.yml @@ -126,7 +126,7 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.26.4 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps @@ -153,7 +153,8 @@ steps: pull: always network_mode: host environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_VERSION: v1.26.4 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} KUBECONFIG: /drone/src/kubeconfig FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] @@ -168,7 +169,8 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_VERSION: v1.26.4 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true @@ -214,7 +216,7 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.27.1 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps @@ -241,7 +243,8 @@ steps: pull: always network_mode: host environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_VERSION: v1.27.1 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} KUBECONFIG: /drone/src/kubeconfig FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] @@ -256,7 +259,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true @@ -302,7 +305,7 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.28.0 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps @@ -329,7 +332,8 @@ steps: pull: always network_mode: host environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_VERSION: v1.28.0 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} KUBECONFIG: /drone/src/kubeconfig FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] @@ -344,7 +348,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true From 9c49cd384a7baeb3d022ec6fa96a880004164299 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 14:55:47 +0100 Subject: [PATCH 14/24] fix(ci): fix cluster name suffix in kind-related steps --- .drone.yml | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/.drone.yml b/.drone.yml index 494ebd7..2517584 100644 --- a/.drone.yml +++ b/.drone.yml @@ -126,7 +126,7 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.26.4 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-126 # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps @@ -153,8 +153,7 @@ steps: pull: always network_mode: host environment: - CLUSTER_VERSION: v1.26.4 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-126 KUBECONFIG: /drone/src/kubeconfig FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] @@ -169,8 +168,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_VERSION: v1.26.4 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-126 commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true @@ -216,7 +214,7 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.27.1 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-127 # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps @@ -243,8 +241,7 @@ steps: pull: always network_mode: host environment: - CLUSTER_VERSION: v1.27.1 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-127 KUBECONFIG: /drone/src/kubeconfig FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] @@ -259,7 +256,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-127 commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true @@ -305,7 +302,7 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.28.0 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128 # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps @@ -332,8 +329,7 @@ steps: pull: always network_mode: host environment: - CLUSTER_VERSION: v1.28.0 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128 KUBECONFIG: /drone/src/kubeconfig FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] @@ -348,7 +344,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${CLUSTER_VERSION} + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128 commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true From 2a4fefb9aa18e80610fd5acd164f319c862e0edc Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:07:15 +0100 Subject: [PATCH 15/24] fix(ci): use DRONE_STAGE_NAME to avoid conflicts in kubeconfig files in multi-stage e2e tests --- .drone.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.drone.yml b/.drone.yml index 2517584..4a6d476 100644 --- a/.drone.yml +++ b/.drone.yml @@ -126,11 +126,11 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.26.4 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-126 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps - KUBECONFIG: /drone/src/kubeconfig + KUBECONFIG: /drone/src/kubeconfig-${DRONE_STAGE_NAME} commands: # create a custom config to disable Kind's default CNI so # we can test using KFD's networking module. @@ -153,8 +153,8 @@ steps: pull: always network_mode: host environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-126 - KUBECONFIG: /drone/src/kubeconfig + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} + KUBECONFIG: /drone/src/kubeconfig-${DRONE_STAGE_NAME} FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] commands: @@ -168,7 +168,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-126 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true @@ -214,11 +214,11 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.27.1 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-127 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps - KUBECONFIG: /drone/src/kubeconfig + KUBECONFIG: /drone/src/kubeconfig-${DRONE_STAGE_NAME} commands: # create a custom config to disable Kind's default CNI so # we can test using KFD's networking module. @@ -241,8 +241,8 @@ steps: pull: always network_mode: host environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-127 - KUBECONFIG: /drone/src/kubeconfig + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} + KUBECONFIG: /drone/src/kubeconfig-${DRONE_STAGE_NAME} FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] commands: @@ -256,7 +256,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-127 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true @@ -302,11 +302,11 @@ steps: path: /var/run/docker.sock environment: CLUSTER_VERSION: v1.28.0 - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another # shared volume between the steps - KUBECONFIG: /drone/src/kubeconfig + KUBECONFIG: /drone/src/kubeconfig-${DRONE_STAGE_NAME} commands: # create a custom config to disable Kind's default CNI so # we can test using KFD's networking module. @@ -329,8 +329,8 @@ steps: pull: always network_mode: host environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128 - KUBECONFIG: /drone/src/kubeconfig + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} + KUBECONFIG: /drone/src/kubeconfig-${DRONE_STAGE_NAME} FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] commands: @@ -344,7 +344,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-128 + CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} commands: # does not matter if the command fails - kind delete cluster --name $${CLUSTER_NAME} || true From 09205c51d0d1e1ab9dcdcb89b795e67ea81ab291 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:41:59 +0100 Subject: [PATCH 16/24] fix(ci): kubeconfig file references --- .drone.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.drone.yml b/.drone.yml index 4a6d476..91699cf 100644 --- a/.drone.yml +++ b/.drone.yml @@ -158,8 +158,6 @@ steps: FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] commands: - - cp $${KUBECONFIG} /tmp/kubeconfig - - export KUBECONFIG=/tmp/kubeconfig - bats -t katalog/tests/tests.sh - name: delete-kind-cluster @@ -246,8 +244,6 @@ steps: FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] commands: - - cp $${KUBECONFIG} /tmp/kubeconfig - - export KUBECONFIG=/tmp/kubeconfig - bats -t katalog/tests/tests.sh - name: delete-kind-cluster @@ -334,8 +330,6 @@ steps: FURYCTL_VERSION: v0.27.2 depends_on: [create Kind cluster] commands: - - cp $${KUBECONFIG} /tmp/kubeconfig - - export KUBECONFIG=/tmp/kubeconfig - bats -t katalog/tests/tests.sh - name: delete-kind-cluster From 0e8201c0a76c25d42e4cef65a33f9cf323fa8b29 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Fri, 23 Feb 2024 16:47:20 +0100 Subject: [PATCH 17/24] chore(ci): serialize e2e stages --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 91699cf..f9135ce 100644 --- a/.drone.yml +++ b/.drone.yml @@ -188,6 +188,7 @@ type: docker depends_on: - policeman + - e2e-kubernetes-1.26 node: runner: internal @@ -274,6 +275,7 @@ type: docker depends_on: - policeman + - e2e-kubernetes-1.27 node: runner: internal From 2dbdfbe71d8c34f5a8e145e52173fb8a3cc55625 Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:51:24 +0100 Subject: [PATCH 18/24] fix(ci): Cluster image version for 1.26 and 1.27 --- .drone.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index f9135ce..bc8ff22 100644 --- a/.drone.yml +++ b/.drone.yml @@ -125,7 +125,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_VERSION: v1.26.4 + CLUSTER_VERSION: v1.26.6 CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another @@ -212,7 +212,7 @@ steps: - name: dockersock path: /var/run/docker.sock environment: - CLUSTER_VERSION: v1.27.1 + CLUSTER_VERSION: v1.27.3 CLUSTER_NAME: ${DRONE_REPO_NAME}-${DRONE_BUILD_NUMBER}-${DRONE_STAGE_NAME} # /drone/src is the default workdir for the pipeline # using this folder we don't need to mount another From 8efb9af287e58d9fc40ccfc87670faada3d600cc Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Tue, 27 Feb 2024 12:54:11 +0100 Subject: [PATCH 19/24] chore(ci): enable again e2e parallel execution --- .drone.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.drone.yml b/.drone.yml index bc8ff22..d27b877 100644 --- a/.drone.yml +++ b/.drone.yml @@ -188,7 +188,6 @@ type: docker depends_on: - policeman - - e2e-kubernetes-1.26 node: runner: internal @@ -275,7 +274,6 @@ type: docker depends_on: - policeman - - e2e-kubernetes-1.27 node: runner: internal From 1b9859e24c9993bfb4287dc54d4ec1b31eb8354d Mon Sep 17 00:00:00 2001 From: Ramiro Algozino Date: Mon, 18 Mar 2024 14:39:03 +0100 Subject: [PATCH 20/24] docs: minor fixes to readmes Minor fixes to docs: linting, grammar and replacing logging for tracing to fix copy&paste errors. --- README.md | 18 ++++++++++-------- docs/COMPATIBILITY_MATRIX.md | 2 -- katalog/tempo-distributed/MAINTENANCE.md | 2 +- katalog/tempo-distributed/README.md | 1 - 4 files changed, 11 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 1023e47..63a9664 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ +

Kubernetes Fury Tracing

+ ![Release](https://img.shields.io/badge/Latest%20Release-v1.0.2-blue) ![License](https://img.shields.io/github/license/sighupio/fury-kubernetes-tracing?label=License) @@ -17,7 +19,7 @@ If you are new to KFD please refer to the [official documentation][kfd-docs] on **Kubernetes Fury Tracing** uses a collection of open source tools to provide the most resilient and robust tracing stack for the cluster. -The module right now contains only the [tempo][tempo-page] tool from grafana. +The module right now contains only the [tempo][tempo-page] tool from Grafana. All the components are deployed in the `tracing` namespace in the cluster. @@ -35,16 +37,16 @@ Click on each package to see its full documentation. | `1.26.x` | :white_check_mark: | No known issues | | `1.27.x` | :white_check_mark: | No known issues | -Check the [compatibility matrix][compatibility-matrix] for additional informations about previous releases of the modules. +Check the [compatibility matrix][compatibility-matrix] for additional information about previous releases of the modules. ## Usage ### Prerequisites -| Tool | Version | Description | -| --------------------------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Tool | Version | Description | +| --------------------------- | ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- | | [furyctl][furyctl-repo] | `>=0.25.0` | The recommended tool to download and manage KFD modules and their packages. To learn more about `furyctl` read the [official documentation][furyctl-repo]. | -| [kustomize][kustomize-repo] | `>=3.5.3` | Packages are customized using `kustomize`. To learn how to create your customization layer with `kustomize`, please refer to the [repository][kustomize-repo]. | +| [kustomize][kustomize-repo] | `>=3.5.3` | Packages are customized using `kustomize`. To learn how to create your customization layer with `kustomize`, please refer to the [repository][kustomize-repo]. | ### Deployment @@ -62,12 +64,12 @@ bases: 3. Inspect the download packages under `./vendor/katalog/tracing`. -4. Define a `kustomization.yaml` that includes the `./vendor/katalog/logging` directory as resource. +4. Define a `kustomization.yaml` that includes the `./vendor/katalog/tracing` directory as resource. ```yaml resources: -- ./vendor/katalog/logging/minio-ha -- ./vendor/katalog/logging/tempo-distributed +- ./vendor/katalog/tracing/minio-ha +- ./vendor/katalog/tracing/tempo-distributed ``` 5. To deploy the packages to your cluster, execute: diff --git a/docs/COMPATIBILITY_MATRIX.md b/docs/COMPATIBILITY_MATRIX.md index 428cc5a..fab5851 100644 --- a/docs/COMPATIBILITY_MATRIX.md +++ b/docs/COMPATIBILITY_MATRIX.md @@ -6,8 +6,6 @@ | v1.0.1 | :white_check_mark: | :white_check_mark: | | v1.0.2 | :white_check_mark: | :white_check_mark: | - - :white_check_mark: Compatible - :warning: Has issues - :x: Incompatible - diff --git a/katalog/tempo-distributed/MAINTENANCE.md b/katalog/tempo-distributed/MAINTENANCE.md index 0d14cbf..b166a3a 100644 --- a/katalog/tempo-distributed/MAINTENANCE.md +++ b/katalog/tempo-distributed/MAINTENANCE.md @@ -1,6 +1,6 @@ # Tempo - maintenance -To maintain the Tempo package, you should follow this steps. +To maintain the Tempo package, you should follow these steps. ```bash helm repo add grafana https://grafana.github.io/helm-charts diff --git a/katalog/tempo-distributed/README.md b/katalog/tempo-distributed/README.md index 9de002a..521c806 100644 --- a/katalog/tempo-distributed/README.md +++ b/katalog/tempo-distributed/README.md @@ -47,7 +47,6 @@ kustomize build | kubectl apply -f - [prometheus-operator]: https://github.com/sighup-io/fury-kubernetes-monitoring/blob/master/katalog/prometheus-operator [grafana]: https://github.com/sighup-io/fury-kubernetes-monitoring/blob/master/katalog/grafana - ## License From 465241abef4948e581da5816edcff7821c0f891d Mon Sep 17 00:00:00 2001 From: Ramiro Algozino Date: Mon, 18 Mar 2024 14:46:30 +0100 Subject: [PATCH 21/24] docs: fix markdownlint --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 63a9664..22148ef 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ - +

Kubernetes Fury Tracing From d9631b7d6c3524f764fa639e1251fb9188494b79 Mon Sep 17 00:00:00 2001 From: Ramiro Algozino Date: Mon, 18 Mar 2024 15:07:58 +0100 Subject: [PATCH 22/24] docs(readme): fix linting --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 22148ef..1e8ad16 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ - +

Kubernetes Fury Tracing

- + ![Release](https://img.shields.io/badge/Latest%20Release-v1.0.2-blue) ![License](https://img.shields.io/github/license/sighupio/fury-kubernetes-tracing?label=License) From 2f2fc3ce3921897561459d1704ed3d3bcd460bac Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:14:29 +0100 Subject: [PATCH 23/24] chore: undo makefile and dockerfile changes --- Makefile | 96 ------------------------ build/builder/Dockerfile | 55 -------------- docs/CONTRIBUTING.md | 158 +-------------------------------------- 3 files changed, 1 insertion(+), 308 deletions(-) delete mode 100644 Makefile delete mode 100644 build/builder/Dockerfile diff --git a/Makefile b/Makefile deleted file mode 100644 index 3e5e05d..0000000 --- a/Makefile +++ /dev/null @@ -1,96 +0,0 @@ - -.DEFAULT_GOAL: help -SHELL := /bin/bash - -PROJECTNAME := "fury-kubernetes-tracing" -VERSION := $(shell (git for-each-ref refs/tags --sort=-taggerdate --format='%(refname)' --count=1 | sed -Ee 's/^refs\/tags\/v|-.*//')) - -.PHONY: help -all: help -help: Makefile - @echo - @echo " Choose a command to run in "$(PROJECTNAME)":" - @echo - @sed -n 's/^##//p' $< | column -t -s ':' | sed -e 's/^/ /' - @echo - -.PHONY: version -## version: lists the latest version of tool -version: - @echo v$(VERSION) - -check-variable-%: # detection of undefined variables. - @[[ "${${*}}" ]] || (echo '*** Please define variable `${*}` ***' && exit 1) - -check-release-file-%: # checks if a release doc exists - $(eval tag := `echo "${*}" | sed -e "s/-rc.//"`) - $(eval release_file := "docs/releases/${tag}.md") - @test -f ${release_file} || (echo "*** Please define file ${release_file} ***" && exit 1) - -bumpversion-requirements: check-docker - @docker build --no-cache --pull --target bumpversion-requirement -f build/builder/Dockerfile -t ${PROJECTNAME}:local-bumpversion-requirements . - -SEMVER_TYPES := major minor patch -BUMP_TARGETS := $(addprefix bump-,$(SEMVER_TYPES)) -.PHONY: $(BUMP_TARGETS) -## bump-major: Bumps the module up by a major version -## bump-minor: Bumps the module up by a minor version -## bump-patch: Bumps the module up by a patch version -$(BUMP_TARGETS): bumpversion-requirements - $(eval bump_type := $(strip $(word 2,$(subst -, ,$@)))) - @echo "Making a ${bump_type} tag" - @docker run --rm -v ~/.gitconfig:/etc/gitconfig -v ${PWD}:/src -w /src ${PROJECTNAME}:local-bumpversion-requirements $(bump_type) - @$(MAKE) clean-bumpversion-requirements - -## bump-rc: Bumps the module up by a release candidate (this only adds a tag, and not bump the version in labels) -.PHONY: -bump-rc: check-variable-TAG check-release-file-$(TAG) - @echo "Making ${TAG} tag" - @git tag ${TAG} - -check-%: # detection of required software. - @which ${*} > /dev/null || (echo '*** Please install `${*}` ***' && exit 1) - -license-requirements: check-docker - @docker build --no-cache --pull --target add-license-requirement -f build/builder/Dockerfile -t ${PROJECTNAME}:local-license-requirements . - -## add-license: Add license headers in all files in the project -add-license: license-requirements - @docker run --rm -v ${PWD}:/src -w /src ${PROJECTNAME}:local-license-requirements addlicense -c "SIGHUP s.r.l" -v -l bsd . - @$(MAKE) clean-license-requirements - -## check-license: Check license headers are in-place in all files in the project -check-license: check-docker - @docker build --no-cache --pull --target check-license -f build/builder/Dockerfile -t ${PROJECTNAME}:local-license . - @$(MAKE) clean-license - -## check-label: Check if labels are present in all kustomization files -check-label: check-docker - @docker build --no-cache --pull --target checklabel -f build/builder/Dockerfile -t ${PROJECTNAME}:checklabel . - -## lint: Run the policeman over the repository -lint: check-docker - @docker build --no-cache --pull --target linter -f build/builder/Dockerfile -t ${PROJECTNAME}:local-lint . - @$(MAKE) clean-lint - -## deploy-all: Deploys all the components in the tracing module -deploy-all: deploy-minio deploy-tempo - -## deploy-minio: Deploys the `minio` component in the cluster -deploy-minio: check-kustomize check-kubectl - @kustomize build katalog/minio-ha | kubectl apply -f- - -## deploy-tempo: Deploys the `tempo` component in the cluster -deploy-tempo: check-kustomize check-kubectl - @kustomize build katalog/tempo-distributed | kubectl apply -f- - -## clean-%: Clean the container image resulting from another target. make build clean-build -clean-%: - docker rmi -f ${PROJECTNAME}:local-${*} - -jsonbuilder: - @docker build --no-cache --pull --target jsonbuilder -f build/builder/Dockerfile -t ${PROJECTNAME}:jsonbuilder . - -## build-canonical-json: Build a canonical JSON for any tag of module, only to be run inside a clean working directory -build-canonical-json: check-docker check-variable-TAG jsonbuilder - @docker run -ti --rm -v $(PWD):/app -w /app ${PROJECTNAME}:jsonbuilder build-json -m=$(PROJECTNAME) -v=${TAG} . \ No newline at end of file diff --git a/build/builder/Dockerfile b/build/builder/Dockerfile deleted file mode 100644 index a0532e7..0000000 --- a/build/builder/Dockerfile +++ /dev/null @@ -1,55 +0,0 @@ -# Copyright (c) 2021 SIGHUP s.r.l All rights reserved. -# Use of this source code is governed by a BSD-style -# license that can be found in the LICENSE file. - -# hadolint ignore=DL3007 -FROM quay.io/sighup/policeman:latest as linter - -ENV VALIDATE_KUBERNETES_KUBEVAL="false" -ENV VALIDATE_JSCPD="false" -ENV VALIDATE_DOCKERFILE="false" - -RUN mkdir /app -WORKDIR /app - -COPY . . - -RUN npm install -g embedme@1.22.0 && /entrypoint.sh && embedme --verify "**/*.md" - -FROM golang:1.16 as add-license-requirement - -RUN go get -u github.com/google/addlicense && addlicense -c "SIGHUP s.r.l" -v -l bsd . - -FROM golang:1.16 as check-license - -RUN go get -u github.com/google/addlicense && mkdir /app - -WORKDIR /app - -COPY . . - -RUN addlicense -c "SIGHUP s.r.l" -v -l bsd --check . - -FROM openpolicyagent/conftest:v0.28.1 as checklabel - -RUN mkdir /app -WORKDIR /app - -COPY . . - -RUN conftest pull https://raw.githubusercontent.com/sighupio/ci-commons/main/conftest/kustomization/kfd-labels.rego && \ - conftest test katalog/**/kustomization.yaml - -FROM registry.sighup.io/poc/fury-repo-automations:v0.0.3 as jsonbuilder - -RUN mkdir /app -WORKDIR /app - -COPY . . - -FROM python:3.9-alpine as bumpversion-requirement - -# hadolint ignore=DL3018 -RUN apk add git --no-cache && pip --no-cache-dir install bump2version==1.0.1 - -ENTRYPOINT ["/usr/local/bin/bumpversion"] \ No newline at end of file diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 3a2b97e..30404ce 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1,157 +1 @@ -# Contribution - -Read the following guide about how to contribute to this project and get -familiar with. - -## Make - -This project contains an easy-to-use interface with a `Makefile`. It allows you -to pass all the checks the pipeline will pass on certain events. So it worth get -familiar with all the targets. To know what targets are available in the project -just run: - -```bash -$ make help - - Choose a command to run in fury-kubernetes-tracing: - - version lists the latest version of tool - bump-major Bumps the module up by a major version - bump-minor Bumps the module up by a minor version - bump-patch Bumps the module up by a patch version - bump-rc Bumps the module up by a release candidate (this only adds a tag, and not bump the version in labels) - add-license Add license headers in all files in the project - check-license Check license headers are in-place in all files in the project - check-label Check if labels are present in all kustomization files - lint Run the policeman over the repository - deploy-all Deploys all the components in the tracing module - deploy-minio Deploys the `minio` component in the cluster - deploy-tempo Deploys the `tempo` component in the cluster - clean-% Clean the container image resulting from another target. make build clean-build - build-canonical-json Build a canonical JSON for any tag of module, only to be run inside a clean working directory -``` - -## bump-version (Release process) - -`bump-%v` targets is the recommended way of creating a new release in this -module. This target internally uses -[`bump2version`](https://github.com/c4urself/bump2version/#installation) to bump -the versions of the module in the `examples` directory and the `kustomization` -labels. Then it creates the tag corresponding to the target chosen. We follow -semantic versioning and following is the criteria for versions: - -- `bump-major`: Bumps up a major version, i.e. from 1.x.y -> 2.0.0 -- `bump-major`: Bumps up a major version, i.e. from x.2.y -> x.2.0 -- `bump-patch`: Bumps up a patch version, i.e. from x.y.2 -> x.y.3 -- `bump-rc`: Creates an `rc(release candidate)` tag based on the env - variable `TAG` to be given with the make call. - -Before bumping the version, make sure you have a file in the directory -`docs/releases/` with the name of the new tag to be created. That is if you are -planning to make a patch release to version `v1.9.2`, create a file -`docs/releases/v1.9.2.md` with the release notes. You can see an example -[here](releases/v0.1.0.md). Commit all the change with appropriate commit messages. - -Before a real release(major, minor or patch) is made, it is recommended -to create a patch release to make sure that the module is ready for the -real release. For this you can use the target `bump-rc`. - -`bump-rc` works a bit differently in that it does not bump the versions in the -`kustomization` files or `Furyfiles` as configured in `.bumpversion.cfg`. The -assumption behind this being the considering that a prerelease is more like a -draft release. Another difference of this target is, it expects the rc tag name as -a variable `TAG` along with the `make` call. This is because it is otherwise -quite difficult to interpret which is the target version for which a `rc` is -being created. So the example usage is: - -```bash -$ TAG=v1.9.2-rc1 make bump-rc -# This essentially creates a tag `v1.9.2-rc1` which we can push to github to create a prerelease -``` - -Then, in order to release it(assuming from version `1.9.1` to `1.9.2` - so a -patch release): - -```bash -$ make bump-patch -Making a patch tag -$ git push --tags origin master -# This should trigger the drone pipeline to publish the new release with the release notes from the file created. -``` - -## lint - -To ensure the code-bases follow a standard, we have automated pipelines testing -for the linting rules. If one has to test if the rules are respected locally, -the following command can be run: - -```bash -$ make lint -# This will use a dockerised super-linter library to run linting -``` - -## add-license and check-license - -### check-license - -This target ensures that a BSD license clause-3 copyrighted to `SIGHUP -s.r.l` is added to all the code files in the repository. To run the -check, run the command: - -```bash -$ make check-license -# This will use a dockerised `addlicense` library to run check for labels -``` - -### add-license - -We ensure all of our files are LICENSED respecting the community standards. The -automated drone pipelines fail, if some files are left without license. To add -our preferred license(BSD clause-3), one could locally run: - -```bash -$ make add-license -# This will use a dockerised `addlicense` library to add license to the -# missing files -``` - -## clean-%v - -The `clean-%v` target has been designed to remove the local built image -resulting from the different targets in the [`Makefile`](Makefile). - -The main reason to implement this target is to save disk space. `clean-%v` -target is automatically called in the targets `lint` and `add-license`. - -## Check-label - -This targets verifies that required labels for KFD modules exist in each -kustomization file in the repository. The list of required labels and this -check can be found -[here](https://github.com/sighupio/ci-commons/blob/main/conftest/kustomization/kfd-labels.md). - -## Deploy - -To deploy the components available under this module easily, some make targets -are bundled in this repository. You can see the available option in the `make help`. -To deploy a minimal working setup of this module, one could run the following -command, which in turn triggers other make targets for individual components: - -```bash -$ make deploy-all -# This deploys calico and ip-masq -``` - -## build-canonical-json - -> Warning: run this command only inside a clean working directory. - -These two targets can be used to create the canonical definition for the -module or an existing TAG. The following are the usages: - -```bash -$ TAG=v1.9.1 make build-canonical-json -INFO[0000] Building JSON for: module fury-kubernetes-tracing, version v1.9.1 -``` - -The above command builds a canonical JSON parsing the version `v1.9.1`. +TODO \ No newline at end of file From 52a9a538e6b5503d748e97a0f6e3d1575f096f3f Mon Sep 17 00:00:00 2001 From: mimnix <108413495+mimnix@users.noreply.github.com> Date: Wed, 27 Mar 2024 10:18:42 +0100 Subject: [PATCH 24/24] fix: contributing --- docs/CONTRIBUTING.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/CONTRIBUTING.md b/docs/CONTRIBUTING.md index 30404ce..f9e3e94 100644 --- a/docs/CONTRIBUTING.md +++ b/docs/CONTRIBUTING.md @@ -1 +1,3 @@ +# Contribution + TODO \ No newline at end of file