From 73e722377ec7c4e5502399650170a8b17d1b3e42 Mon Sep 17 00:00:00 2001 From: LorenzoTettamanti Date: Wed, 2 Dec 2026 21:38:45 +0100 Subject: [PATCH 1/3] chore(examples): removed useless volumes --- Examples/run-with-docker-gpu/docker-compose.yaml | 3 --- Examples/run-with-docker/docker-compose.yaml | 3 --- 2 files changed, 6 deletions(-) diff --git a/Examples/run-with-docker-gpu/docker-compose.yaml b/Examples/run-with-docker-gpu/docker-compose.yaml index 307603e..8f4dbb1 100644 --- a/Examples/run-with-docker-gpu/docker-compose.yaml +++ b/Examples/run-with-docker-gpu/docker-compose.yaml @@ -70,7 +70,6 @@ services: - GOMEMLIMIT=1600MiB volumes: - ./otel-collector-config.yaml:/conf/otel-collector-config.yaml:ro - - /var/run/docker.sock:/var/run/docker.sock networks: - cortexflow depends_on: @@ -111,7 +110,6 @@ services: volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - prometheus-data:/prometheus - - /var/run/docker.sock:/var/run/docker.sock networks: - cortexflow healthcheck: @@ -140,7 +138,6 @@ services: - ./grafana/provisioning:/etc/grafana/provisioning:ro - ./grafana/dashboards:/var/lib/grafana/dashboards:ro - grafana-data:/var/lib/grafana - - /var/run/docker.sock:/var/run/docker.sock networks: - cortexflow restart: on-failure diff --git a/Examples/run-with-docker/docker-compose.yaml b/Examples/run-with-docker/docker-compose.yaml index 1a98ca7..0b4ea77 100644 --- a/Examples/run-with-docker/docker-compose.yaml +++ b/Examples/run-with-docker/docker-compose.yaml @@ -70,7 +70,6 @@ services: - GOMEMLIMIT=1600MiB volumes: - ./otel-collector-config.yaml:/conf/otel-collector-config.yaml:ro - - /var/run/docker.sock:/var/run/docker.sock networks: - cortexflow depends_on: @@ -90,7 +89,6 @@ services: volumes: - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro - prometheus-data:/prometheus - - /var/run/docker.sock:/var/run/docker.sock networks: - cortexflow healthcheck: @@ -125,7 +123,6 @@ services: - ./grafana/provisioning:/etc/grafana/provisioning:ro - ./grafana/dashboards:/var/lib/grafana/dashboards:ro - grafana-data:/var/lib/grafana - - /var/run/docker.sock:/var/run/docker.sock networks: - cortexflow restart: on-failure From 884d33abc0dde0b5b1d48340c69153c1dc286444 Mon Sep 17 00:00:00 2001 From: LorenzoTettamanti Date: Wed, 2 Dec 2026 21:57:31 +0100 Subject: [PATCH 2/3] chore(examples): moved kubernetes manifests from the core/src/testing folder to Examples/minikube folder --- .../testing => Examples/minikube}/agent.yaml | 0 .../minikube/chaos-injection/chaos-mesh.yaml | 0 .../minikube}/configmap-role.yaml | 0 .../minikube}/cortexflow-rolebinding.yaml | 0 .../minikube}/grafana.yaml | 0 .../minikube}/identity.yaml | 66 +------- .../minikube}/metrics.yaml | 0 .../minikube}/otel_agent.yaml | 0 .../minikube}/prometheus.yaml | 1 + .../minikube}/rolebinding.yaml | 0 core/src/testing/deploy-test-pod.yaml | 148 ------------------ 11 files changed, 2 insertions(+), 213 deletions(-) rename {core/src/testing => Examples/minikube}/agent.yaml (100%) rename core/src/testing/chaos-mess.yaml => Examples/minikube/chaos-injection/chaos-mesh.yaml (100%) rename {core/src/testing => Examples/minikube}/configmap-role.yaml (100%) rename {core/src/testing => Examples/minikube}/cortexflow-rolebinding.yaml (100%) rename {core/src/testing => Examples/minikube}/grafana.yaml (100%) rename {core/src/testing => Examples/minikube}/identity.yaml (55%) rename {core/src/testing => Examples/minikube}/metrics.yaml (100%) rename {core/src/testing => Examples/minikube}/otel_agent.yaml (100%) rename {core/src/testing => Examples/minikube}/prometheus.yaml (96%) rename {core/src/testing => Examples/minikube}/rolebinding.yaml (100%) delete mode 100644 core/src/testing/deploy-test-pod.yaml diff --git a/core/src/testing/agent.yaml b/Examples/minikube/agent.yaml similarity index 100% rename from core/src/testing/agent.yaml rename to Examples/minikube/agent.yaml diff --git a/core/src/testing/chaos-mess.yaml b/Examples/minikube/chaos-injection/chaos-mesh.yaml similarity index 100% rename from core/src/testing/chaos-mess.yaml rename to Examples/minikube/chaos-injection/chaos-mesh.yaml diff --git a/core/src/testing/configmap-role.yaml b/Examples/minikube/configmap-role.yaml similarity index 100% rename from core/src/testing/configmap-role.yaml rename to Examples/minikube/configmap-role.yaml diff --git a/core/src/testing/cortexflow-rolebinding.yaml b/Examples/minikube/cortexflow-rolebinding.yaml similarity index 100% rename from core/src/testing/cortexflow-rolebinding.yaml rename to Examples/minikube/cortexflow-rolebinding.yaml diff --git a/core/src/testing/grafana.yaml b/Examples/minikube/grafana.yaml similarity index 100% rename from core/src/testing/grafana.yaml rename to Examples/minikube/grafana.yaml diff --git a/core/src/testing/identity.yaml b/Examples/minikube/identity.yaml similarity index 55% rename from core/src/testing/identity.yaml rename to Examples/minikube/identity.yaml index 43e6c92..a78d60f 100644 --- a/core/src/testing/identity.yaml +++ b/Examples/minikube/identity.yaml @@ -17,42 +17,9 @@ spec: spec: hostPID: true hostNetwork: true - initContainers: - - name: bpf-map-permissions - image: ubuntu:24.04 - command: ["/bin/bash","-c"] - args: - - | - echo "mounting the bpf path " - mount -t bpf bpf /sys/fs/bpf - - echo "checking permissions" - ls -ld /sys/fs/bpf - volumeMounts: - - name: bpf - mountPath: /sys/fs/bpf - mountPropagation: Bidirectional - readOnly: false - - name: kernel-dev - mountPath: /lib/modules - readOnly: false - - name: cgroup - mountPath: /sys/fs/cgroup - readOnly: true - securityContext: - runAsUser: 0 - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - SYS_ADMIN - - NET_ADMIN - - SYS_RESOURCE - - BPF - - SYS_PTRACE containers: - name: identity - image: ghcr.io/cortexflow/identity:latest + image: lorenzotettamanti/cortexflow-identity:lru-update2 command: ["/bin/bash", "-c"] args: - | @@ -107,37 +74,6 @@ spec: - SYS_RESOURCE - BPF - SYS_PTRACE - - name: bpftool-control-manager - image: danielpacak/bpftool-runner:latest - command: ["/bin/bash", "-c","sleep infinity"] - volumeMounts: - - name: bpf - mountPath: /sys/fs/bpf - mountPropagation: Bidirectional - readOnly: false - - name: kernel-dev - mountPath: /lib/modules - readOnly: false - - name: cgroup - mountPath: /sys/fs/cgroup - readOnly: true - resources: - limits: - cpu: "1" - memory: "200Mi" - requests: - cpu: "1" - memory: "100Mi" - securityContext: - privileged: true - allowPrivilegeEscalation: true - capabilities: - add: - - SYS_ADMIN - - NET_ADMIN - - SYS_RESOURCE - - BPF - - SYS_PTRACE volumes: - name: bpf hostPath: diff --git a/core/src/testing/metrics.yaml b/Examples/minikube/metrics.yaml similarity index 100% rename from core/src/testing/metrics.yaml rename to Examples/minikube/metrics.yaml diff --git a/core/src/testing/otel_agent.yaml b/Examples/minikube/otel_agent.yaml similarity index 100% rename from core/src/testing/otel_agent.yaml rename to Examples/minikube/otel_agent.yaml diff --git a/core/src/testing/prometheus.yaml b/Examples/minikube/prometheus.yaml similarity index 96% rename from core/src/testing/prometheus.yaml rename to Examples/minikube/prometheus.yaml index 1a1e10c..2ba8ba5 100644 --- a/core/src/testing/prometheus.yaml +++ b/Examples/minikube/prometheus.yaml @@ -56,6 +56,7 @@ spec: - "--config.file=/etc/prometheus/prometheus.yml" - "--storage.tsdb.path=/prometheus" - "--web.enable-lifecycle" + - "--web.enable-admin-api" # useful to delete series from the tsdb ports: - containerPort: 9090 name: web diff --git a/core/src/testing/rolebinding.yaml b/Examples/minikube/rolebinding.yaml similarity index 100% rename from core/src/testing/rolebinding.yaml rename to Examples/minikube/rolebinding.yaml diff --git a/core/src/testing/deploy-test-pod.yaml b/core/src/testing/deploy-test-pod.yaml deleted file mode 100644 index 1f2062e..0000000 --- a/core/src/testing/deploy-test-pod.yaml +++ /dev/null @@ -1,148 +0,0 @@ -apiVersion: v1 -kind: ServiceAccount -metadata: - name: testing-service-account - namespace: cortexflow ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: Role -metadata: - name: service-discovery-role - namespace: cortexflow -rules: -- apiGroups: [ "" ] - resources: [ "services", "pods" ] - verbs: [ "get", "list", "watch" ] -- apiGroups: [ "" ] - resources: [ "configmaps" ] - verbs: [ "get", "list", "watch" ] ---- -apiVersion: rbac.authorization.k8s.io/v1 -kind: RoleBinding -metadata: - name: service-discovery-role-binding - namespace: cortexflow -subjects: -- kind: ServiceAccount - name: testing-service-account - namespace: cortexflow -roleRef: - kind: Role - name: service-discovery-role - apiGroup: rbac.authorization.k8s.io ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-pod - namespace: cortexflow - labels: - app: test1 -spec: - serviceAccountName: testing-service-account - containers: - - name: test-pod - image: nicolaka/netshoot - command: ["/bin/bash", "-c", "sleep 3600"] - ports: - - containerPort: 5053 - protocol: UDP - - containerPort: 5054 - protocol: TCP ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-pod2 - namespace: cortexflow - labels: - app: test2 -spec: - serviceAccountName: testing-service-account - containers: - - name: test-pod2 - image: nicolaka/netshoot - command: ["/bin/bash", "-c", "sleep 3600"] - ports: - - containerPort: 5053 - protocol: UDP - - containerPort: 5054 - protocol: TCP ---- -apiVersion: v1 -kind: Pod -metadata: - name: test-pod3 - namespace: cortexflow - labels: - app: test3 -spec: - hostNetwork: true - hostPID: true - serviceAccountName: testing-service-account - containers: - - name: test-pod3 - image: nicolaka/netshoot - command: ["/bin/bash", "-c", "sleep 3600"] - ports: - - containerPort: 5053 - protocol: UDP - - containerPort: 5054 - protocol: TCP ---- -apiVersion: v1 -kind: Service -metadata: - name: test-pod - namespace: cortexflow -spec: - selector: - app: test1 - ports: - - protocol: TCP - name: tcp-connection - port: 5054 - targetPort: 5054 - - protocol: UDP - name: udp-connection - port: 5053 - targetPort: 5053 - type: ClusterIP ---- -apiVersion: v1 -kind: Service -metadata: - name: test-pod2 - namespace: cortexflow -spec: - selector: - app: test2 - ports: - - protocol: TCP - name: tcp-connection - port: 5054 - targetPort: 5054 - - protocol: UDP - name: udp-connection - port: 5053 - targetPort: 5053 - type: ClusterIP ---- -apiVersion: v1 -kind: Service -metadata: - name: test-pod3 - namespace: cortexflow -spec: - selector: - app: test3 - ports: - - protocol: TCP - name: tcp-connection - port: 5054 - targetPort: 5054 - - protocol: UDP - name: udp-connection - port: 5053 - targetPort: 5053 - type: ClusterIP From 9dfad2343a42e3335576a720fdfe459ae252cb30 Mon Sep 17 00:00:00 2001 From: LorenzoTettamanti Date: Wed, 2 Dec 2026 22:06:01 +0100 Subject: [PATCH 3/3] chore(examples): added minikube example description in examples' readme --- Examples/Readme.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Examples/Readme.md b/Examples/Readme.md index 62a1a3d..bde8991 100644 --- a/Examples/Readme.md +++ b/Examples/Readme.md @@ -5,4 +5,5 @@ You may need to set the prometheus source manually. By default the Prometheus ad | Example | Description| |-----|-------------| |run-with-docker| This example includes a basic example pipeline using **CortexBrain Identity** and **Metrics** components. Metrics are scraped by Prometheus and visualized using a custom Grafana dashboard| -|run-with-docker-gpu| This example includes a basic example pipeline using **CortexBrain Identity** and **Metrics** components. GPU data are provided by the **NVIDIA-DCGM** exporter. Metrics are scraped by Prometheus and visualized using a custom Grafana dashboard| \ No newline at end of file +|run-with-docker-gpu| This example includes a basic example pipeline using **CortexBrain Identity** and **Metrics** components. GPU data are provided by the **NVIDIA-DCGM** exporter. Metrics are scraped by Prometheus and visualized using a custom Grafana dashboard| +|minikube| This example includes a basic minikube setup to test CortexBrain components using **Minikube**. Includes **CortexBrain Identity** and **CortexBrain Metrics** components setup, basic RBAC setup and a simple chaos injection setup using **Chaos Mesh**. As the other examples metrics are scraped by Prometheus and visualized using Grafana| \ No newline at end of file