{"id":13466670,"url":"https://github.com/groundcover-com/caretta","last_synced_at":"2025-05-14T10:09:43.662Z","repository":{"id":65310901,"uuid":"568919373","full_name":"groundcover-com/caretta","owner":"groundcover-com","description":"Instant K8s service dependency map, right to your Grafana.","archived":false,"fork":false,"pushed_at":"2025-03-17T13:28:09.000Z","size":6833,"stargazers_count":1871,"open_issues_count":11,"forks_count":74,"subscribers_count":23,"default_branch":"main","last_synced_at":"2025-04-06T09:01:01.735Z","etag":null,"topics":["ebpf","kubernetes","observability"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/groundcover-com.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-21T17:33:52.000Z","updated_at":"2025-03-27T09:40:43.000Z","dependencies_parsed_at":"2023-02-13T21:16:58.980Z","dependency_job_id":"e93853cd-346f-4c08-b18c-a4d302be8d65","html_url":"https://github.com/groundcover-com/caretta","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groundcover-com%2Fcaretta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groundcover-com%2Fcaretta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groundcover-com%2Fcaretta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/groundcover-com%2Fcaretta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/groundcover-com","download_url":"https://codeload.github.com/groundcover-com/caretta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248716391,"owners_count":21150306,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ebpf","kubernetes","observability"],"created_at":"2024-07-31T15:00:48.128Z","updated_at":"2025-04-13T12:39:13.759Z","avatar_url":"https://github.com/groundcover-com.png","language":"Go","funding_links":[],"categories":["Projects Related to eBPF","Go","eBPF 相关项目","Cilium related projects"],"sub_categories":["Observability","可观测性"],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003ch1\u003eCaretta\u003c/h1\u003e\n  \u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/logo.svg\" width=\"25%\" alt=\"caretta\" title=\"caretta\" /\u003e\n   \u003cbr\u003e\u003cbr\u003e\n   \u003ca href=\"https://www.producthunt.com/posts/caretta?utm_source=badge-top-post-topic-badge\u0026utm_medium=badge\u0026utm_souce=badge-caretta\" target=\"_blank\"\u003e\u003cimg src=\"https://api.producthunt.com/widgets/embed-image/v1/top-post-topic-badge.svg?post_id=373791\u0026theme=neutral\u0026period=weekly\u0026topic_id=267\" alt=\"Caretta - Instant\u0026#0032;K8s\u0026#0032;service\u0026#0032;dependency\u0026#0032;map\u0026#0044;\u0026#0032;right\u0026#0032;to\u0026#0032;your\u0026#0032;Grafana | Product Hunt\" width=\"25%\"/\u003e\u003c/a\u003e\n  \u003c/p\u003e\n    \u003ch2\u003eInstant K8s service dependency map, right to your Grafana.\u003c/h2\u003e\n    \u003ch4\u003e made by \u003ca href=\"https://www.groundcover.com\"\u003egroundcover\u003c/h4\u003e\n  \u003cp\u003e\n\n[![slack](https://img.shields.io/badge/slack-groundcover-yellowgreen.svg?logo=slack)](http://www.groundcover.com/join-slack)\n[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\u003cbr\u003e\n\n\u003c/div\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"images/caretta.gif\" width=\"90%\" alt=\"caretta-screenshot\" title=\"caretta-screenshot\"\u003e\n\u003c/p\u003e\n\n## What is Caretta?\n\nCaretta is a lightweight, standalone tool that instantly creates a visual network map of the services running in your cluster.\n\nCarreta leverages eBPF to efficiently map all service network interactions in a K8s  cluster, and Grafana to query and visualize the collected data.\n\nCarreta is built to be efficient, with a minimal footprint on the system, and does not require any modifications of the cluster.\n\nCaretta demonstrates the power of using eBPF for observability solutions, which is our vision at \u003ca href=\"https://groundcover.com\"\u003egroundcover\u003c/a\u003e. If you're interested in understanding how Caretta is built, head over to our \u003ca href=\"https://www.groundcover.com/blog/caretta\"\u003eCaretta blog post!\u003c/a\u003e\n\n## Installing Caretta :zap:\nAs simple as installing a helm chart. It is recommended to install Caretta in a new, unique namespace.\n```bash\nhelm repo add groundcover https://helm.groundcover.com/\n```\n```bash\nhelm repo update\n```\n```bash\nhelm install caretta --namespace caretta --create-namespace groundcover/caretta\n```\n\n### Configuration\nYou can configure Caretta using helm values.\nUseful values:\n* **tolerations** can be specified to make sure Caretta's eBPF-agent will run on all cluster in your nodes. *default value will tolerate common control-plane node annotations*\n* **victoria-metrics-single.server.persistentVolume.enabled** can be set to *true* if you wish to save Caretta's metrics to a persistent volume *default: false*\n* **pollIntervalSeconds** can be modified to specify the polling and publishing interval of new metrics from the kernel. *default: 5*\n* The built-in Victoria Metrics and Grafana instances can be disabled by changing the values **victoria-metrics-single.enabled** or **grafana.enabled** to false, accordingly. _default: true_\n* Caretta resolves Kubernetes entities to their owners by default. For example, a pod 'pod1' and another pod 'pod2' both belonging to a deployment 'deployment1' will be resolved to 'deployment1'. This can be disabled by setting **traverseUpHierarchy** to false. _default: true_\n\n\nExample yaml for overriding these values:\n```yaml\npollIntervalSeconds: 15  # set metrics polling interval\ntraverseUpHierarchy: false  # disable resolving kubernetes entities to their owners\n\ntolerations:             # set any desired tolerations\n  - key: node-role.kubernetes.io/control-plane\n    operator: Exists\n    effect: NoSchedule\n\n victoria-metrics-single:\n  server:\n    persistentVolume:\n       enabled: true   # set to true to use persistent volume\n```\nThis can also be done using the --set flag on the `helm install` command.\n\n### Uninstallation\nTo uninstall, delete the helm release:\n```bash\nhelm delete caretta --namespace caretta\n```\nNote that if persistent storage was enabled in the installation, it may not be deleted automatically by this command.\n\n## Requirements\n* Linux kernel version \u003e= 4.16\n* \u003ca href=\"https://nakryiko.com/posts/bpf-portability-and-co-re/\"\u003eCO-RE\u003c/a\u003e support. Supported linux distributions can be found \u003ca href=\"https://github.com/libbpf/libbpf#bpf-co-re-compile-once--run-everywhere\"\u003ehere\u003c/a\u003e. Specifically, Docker for Mac uses a distribution which is not currently supported.\n\n\n\n## Working with Caretta :turtle:\nCaretta's helm chart ships an instance of Grafana with a predefined dashboard using data published by Caretta. This dashboard contains some examples to demonstrate the usage of Caretta's metrics.\n\n### Using the provided Grafana instance\nTo access Grafana, port-forward port `3000` from the Grafana pod in Caretta's namespace.\n\nUsing *kubectl*, it should look something like this:\n\n```bash\nkubectl port-forward --namespace caretta \u003cgrafana-pod-name\u003e 3000:3000\n```\n\n\u003e **_NOTE:_**  Anonymous mode is enabled, making the default dashboard accessible with no login needed.\n\u003e              To edit the default dashboard or create your own dashboard, use the default administrator's credentials user:`admin` ; password:`caretta`.\n\n### Scraping Caretta's metrics\n\nCaretta uses [Victoria Metrics](https://victoriametrics.com/) to collect and publish its metrics, and the outcome can be consumed by **any Prometheus-compatible dashboard**.\n\nCaretta's main metric is `caretta_links_observed` (Gauge). It uses the following labels to represent a specific connection (network socket) going through the cluster:\n* `client_name` - either a name of a kubernetes entity, if resolved, an external domain, if resolved, or an IP address.\n* `client_namespace` - either the namespace of the kubernetes entity, or \"node\", or \"external\".\n* `client_kind` - either the kind of the kubernetes entity, or \"node\", or \"external\".\n* `server_name` - either a name of a kubernetes entity, if resolved, an external domain, if resolved, or an IP address.\n* `server_namespace` - either the namespace of the kubernetes entity, or \"node\", or \"external\".\n* `server_kind` - either the kind of the kubernetes entity, or \"node\", or \"external\".\n* `server_port` - the port used by the server.\n* `role` - either 1 (client) or 2 (server).\n\nAlong those labels, Caretta uses other labels for Grafana's Node Graph panel.\n\n#### Example metric data\nThis example shows a connection between a client named `checkoutservice`, controlled by a deployment, to a service named `productioncatalogservice` on port 3550, from the perspective of the client. Total bytes sent by the client in this connection is 2537 bytes.\n```bash\ncaretta_links_observed{client_id=\"1074587981\",client_kind=\"Deployment\",client_name=\"checkoutservice\",client_namespace=\"demo-ng\",link_id=\"198768460\",role=\"1\",server_id=\"1112713827\",server_kind=\"Service\",server_name=\"productcatalogservice\",server_namespace=\"demo-ng\",server_port=\"3550\"} 2537\n```\n\n#### Example queries  :star:\n```bash\nincrease ((sum (server_port) (caretta_links_observed{client_name=\"some-client\", server_name=\"some-server}))[15m])\n```\nwill output the throughput observed between some-client and some-server in the last 15 minutes, aggregated by port.\n\n```bash\nsum by (server_name) (rate(caretta_links_observed{client_name=\"some-client\"}))\n```\nwill output the rate of traffic from some-client to servers it communicates with, aggregated by the server's name.\n\n```bash\nsort_desc(increase((sum by (client_name)(caretta_links_observed{server_namespace=\"external\"}))[5m]))\n```\nwill output communication to external servers by client's name, sorted descending.\n\n## Need help:grey_question:\nFeel free to reach us on our \u003ca href=\"http://www.groundcover.com/join-slack\"\u003eslack channel\u003c/a\u003e, or create an issue in this repository.\n\n## Contribution\nFeel free to add your contribution to the project.\n\n* Open an issue for missing features, or bugs\n* Create a pull request for adding code to the project\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroundcover-com%2Fcaretta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgroundcover-com%2Fcaretta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgroundcover-com%2Fcaretta/lists"}