-
Notifications
You must be signed in to change notification settings - Fork 217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: packet traces feature for Retina CLI #198
Closed
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
e84affd
feat: packet traces feature for Retina CLI
nddq 9a4118f
Merge branch 'main' into feat/traceCLI
nddq c41b3cd
readd licenses for 3rd party + linter issues
nddq 56690e8
fix tests not passing
nddq 117c5ca
Merge branch 'main' into feat/traceCLI
nddq bcc8d0e
Merge branch 'main' into feat/traceCLI
nddq File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
# TraceConfiguration | ||
|
||
> **Note:** This feature is currently under experimental development. | ||
|
||
## Overview | ||
|
||
The `TraceConfiguration` CustomResourceDefinition (CRD) introduces a custom resource named `TraceConfiguration` that enables users to configure packet traces in a Kubernetes cluster. Packet traces can be tailored to specific use cases, offering the flexibility to capture detailed network data for debugging or continuous streaming of traces for security purposes. | ||
|
||
## CRD Specification | ||
|
||
The full specification for the `MetricsConfiguration` CRD can be found in the [TraceConfiguration CRD](https://github.com/microsoft/retina/blob/main/deploy/manifests/controller/helm/retina/crds/retina.sh_tracesconfigurations.yaml) file. | ||
|
||
The `TraceConfiguration` CRD is defined with the following specifications: | ||
|
||
- **API Group:** retina.sh | ||
- **API Version:** v1alpha1 | ||
- **Kind:** TraceConfiguration | ||
- **Plural:** traceconfigurations | ||
- **Singular:** traceconfiguration | ||
- **Scope:** Namespaced | ||
|
||
### Fields | ||
|
||
- **spec.traceConfigurations:** Specifies the detailed configuration options for packet tracing. It includes the following properties: | ||
- `captureLevel`: Specifies the capture level, which can be set to `allPackets` or `firstPacket` (default). | ||
- `includeLayer7Data`: Indicates whether layer 7 data (HTTP, DNS, TLS) should be included in the trace (default is `false`). | ||
- `from`: Specifies the source entities from which packets will be captured, including IP blocks, namespaces, pods, and more. | ||
- `to`: Specifies the destination entities to which packets will be captured, including IP blocks, services, and more. | ||
- `ports`: Specifies the ports and protocols to capture packets for. | ||
|
||
- **spec.tracePoints:** Specifies the types of trace points to capture, such as pod, nodeToPod, and nodeToNetwork. | ||
|
||
- **spec.outputConfiguration:** Specifies the output destination and connection configuration for trace data. It includes the following properties: | ||
- `destination`: Specifies the destination for trace data, which can be `stdout`, `azuretable`, `loganalytics`, or `opentelemetry`. | ||
- `connectionConfiguration`: Specifies connection-related configuration options. | ||
|
||
- **status:** Describes the status of the trace configuration, including the current state, reason, and accepted specification. | ||
|
||
## Usage | ||
|
||
### Configuring Packet Traces | ||
|
||
To configure packet traces, create a YAML manifest file with the desired specifications and apply it to the cluster using `kubectl apply`: | ||
|
||
```yaml | ||
apiVersion: retina.sh/v1alpha1 | ||
kind: TraceConfiguration | ||
metadata: | ||
name: example-trace-configuration | ||
spec: | ||
traceConfigurations: | ||
- captureLevel: firstPacket | ||
includeLayer7Data: true | ||
from: | ||
- ipBlock: | ||
cidr: 10.0.0.0/16 | ||
except: | ||
- 10.0.0.5 | ||
to: | ||
- namespaceSelector: | ||
label: value | ||
ports: | ||
- port: "80" | ||
protocol: TCP | ||
tracePoints: | ||
- pod | ||
- nodeToPod | ||
outputConfiguration: | ||
destination: stdout | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
pkg/controllers/daemon/metricsconfiguration/metricsconfiguration_controller.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
pkg/controllers/daemon/metricsconfiguration/metricsconfiguration_controller_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
pkg/controllers/operator/metricsconfiguration/metricsconfiguration_controller.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 0 additions & 13 deletions
13
pkg/controllers/operator/metricsconfiguration/metricsconfiguration_controller_test.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add a comment here that this is not implemented in bold headings ?