Skip to content

Commit

Permalink
Add PacketCapture CRD (#5443) (#6257)
Browse files Browse the repository at this point in the history
API only, no controller yet

Signed-off-by: Hang Yan <yhang@vmware.com>
Co-authored-by: Lan <luola@vmware.com>
Co-authored-by: Quan Tian <quan.tian@broadcom.com>
Co-authored-by: Antonin Bas <antonin.bas@broadcom.com>
  • Loading branch information
4 people authored Nov 4, 2024
1 parent fe077f6 commit 92454fb
Show file tree
Hide file tree
Showing 21 changed files with 2,238 additions and 0 deletions.
194 changes: 194 additions & 0 deletions build/charts/antrea/crds/packetcapture.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,194 @@
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: packetcaptures.crd.antrea.io
labels:
app: antrea
spec:
group: crd.antrea.io
versions:
- name: v1alpha1
served: true
storage: true
additionalPrinterColumns:
- jsonPath: .spec.source.pod
description: The name of the source Pod.
name: Source-Pod
type: string
priority: 10
- jsonPath: .spec.destination.pod
description: The name of the destination Pod.
name: Destination-Pod
type: string
priority: 10
- jsonPath: .spec.source.ip
description: The IP address of the source.
name: Source-IP
type: string
priority: 10
- jsonPath: .spec.destination.ip
description: The IP address of the destination.
name: Destination-IP
type: string
priority: 10
- jsonPath: .spec.timeout
description: Timeout in seconds.
name: Timeout
type: integer
priority: 10
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
schema:
openAPIV3Schema:
type: object
required:
- spec
properties:
spec:
type: object
required:
- source
- captureConfig
- destination
anyOf:
- properties:
source:
required: [pod]
- properties:
destination:
required: [pod]
properties:
source:
type: object
oneOf:
- required:
- pod
- required:
- ip
properties:
pod:
type: object
required:
- name
properties:
namespace:
type: string
default: default
name:
type: string
ip:
type: string
format: ipv4
destination:
type: object
oneOf:
- required:
- pod
- required:
- ip
properties:
pod:
type: object
required:
- name
properties:
namespace:
type: string
default: default
name:
type: string
ip:
type: string
format: ipv4
packet:
type: object
properties:
ipFamily:
type: string
enum: [IPv4]
default: IPv4
protocol:
x-kubernetes-int-or-string: true
transportHeader:
type: object
properties:
udp:
type: object
properties:
srcPort:
type: integer
minimum: 1
maximum: 65535
dstPort:
type: integer
minimum: 1
maximum: 65535
tcp:
type: object
properties:
srcPort:
type: integer
minimum: 1
maximum: 65535
dstPort:
type: integer
minimum: 1
maximum: 65535

timeout:
type: integer
minimum: 1
maximum: 300
default: 60
captureConfig:
type: object
oneOf:
- required:
- firstN
properties:
firstN:
type: object
required:
- number
properties:
number:
type: integer
format: int32
fileServer:
type: object
properties:
url:
type: string
pattern: 's{0,1}ftps{0,1}:\/\/[\w-_./]+:\d+'
status:
type: object
properties:
numberCaptured:
type: integer
filePath:
type: string
conditions:
type: array
items:
type: object
properties:
type:
type: string
status:
type: string
lastTransitionTime:
type: string
reason:
type: string
message:
type: string
subresources:
status: {}
scope: Cluster
names:
plural: packetcaptures
singular: packetcapture
kind: PacketCapture
shortNames:
- pcap
197 changes: 197 additions & 0 deletions build/yamls/antrea-aks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2896,6 +2896,203 @@ spec:
shortNames:
- nlm

---
# Source: antrea/crds/packetcapture.yaml
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
name: packetcaptures.crd.antrea.io
labels:
app: antrea
spec:
group: crd.antrea.io
versions:
- name: v1alpha1
served: true
storage: true
additionalPrinterColumns:
- jsonPath: .spec.source.pod
description: The name of the source Pod.
name: Source-Pod
type: string
priority: 10
- jsonPath: .spec.destination.pod
description: The name of the destination Pod.
name: Destination-Pod
type: string
priority: 10
- jsonPath: .spec.source.ip
description: The IP address of the source.
name: Source-IP
type: string
priority: 10
- jsonPath: .spec.destination.ip
description: The IP address of the destination.
name: Destination-IP
type: string
priority: 10
- jsonPath: .spec.timeout
description: Timeout in seconds.
name: Timeout
type: integer
priority: 10
- jsonPath: .metadata.creationTimestamp
name: Age
type: date
schema:
openAPIV3Schema:
type: object
required:
- spec
properties:
spec:
type: object
required:
- source
- captureConfig
- destination
anyOf:
- properties:
source:
required: [pod]
- properties:
destination:
required: [pod]
properties:
source:
type: object
oneOf:
- required:
- pod
- required:
- ip
properties:
pod:
type: object
required:
- name
properties:
namespace:
type: string
default: default
name:
type: string
ip:
type: string
format: ipv4
destination:
type: object
oneOf:
- required:
- pod
- required:
- ip
properties:
pod:
type: object
required:
- name
properties:
namespace:
type: string
default: default
name:
type: string
ip:
type: string
format: ipv4
packet:
type: object
properties:
ipFamily:
type: string
enum: [IPv4]
default: IPv4
protocol:
x-kubernetes-int-or-string: true
transportHeader:
type: object
properties:
udp:
type: object
properties:
srcPort:
type: integer
minimum: 1
maximum: 65535
dstPort:
type: integer
minimum: 1
maximum: 65535
tcp:
type: object
properties:
srcPort:
type: integer
minimum: 1
maximum: 65535
dstPort:
type: integer
minimum: 1
maximum: 65535

timeout:
type: integer
minimum: 1
maximum: 300
default: 60
captureConfig:
type: object
oneOf:
- required:
- firstN
properties:
firstN:
type: object
required:
- number
properties:
number:
type: integer
format: int32
fileServer:
type: object
properties:
url:
type: string
pattern: 's{0,1}ftps{0,1}:\/\/[\w-_./]+:\d+'
status:
type: object
properties:
numberCaptured:
type: integer
filePath:
type: string
conditions:
type: array
items:
type: object
properties:
type:
type: string
status:
type: string
lastTransitionTime:
type: string
reason:
type: string
message:
type: string
subresources:
status: {}
scope: Cluster
names:
plural: packetcaptures
singular: packetcapture
kind: PacketCapture
shortNames:
- pcap

---
# Source: antrea/crds/supportbundlecollection.yaml
apiVersion: apiextensions.k8s.io/v1
Expand Down
Loading

0 comments on commit 92454fb

Please sign in to comment.