From 5d70bf542f3767d740397c5234bb0d7f1405a4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Ho=C3=9F?= Date: Sat, 4 Nov 2023 16:03:34 +0100 Subject: [PATCH] add bpfd-dev/bpfd MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Sebastian Hoß --- .reuse/dep5 | 4 + code-generator/src/catalog.rs | 12 + .../bpfd/bpfd.dev/v1alpha1/bpfprograms.yaml | 98 +++++++ .../bpfd.dev/v1alpha1/kprobeprograms.yaml | 239 +++++++++++++++ .../bpfd/bpfd.dev/v1alpha1/tcprograms.yaml | 275 ++++++++++++++++++ .../bpfd.dev/v1alpha1/tracepointprograms.yaml | 219 ++++++++++++++ .../bpfd.dev/v1alpha1/uprobeprograms.yaml | 251 ++++++++++++++++ .../bpfd/bpfd.dev/v1alpha1/xdpprograms.yaml | 258 ++++++++++++++++ kube-custom-resources-rs/Cargo.toml | 1 + .../src/bpfd_dev_v1alpha1/bpfprograms.rs | 62 ++++ .../src/bpfd_dev_v1alpha1/kprobeprograms.rs | 163 +++++++++++ .../src/bpfd_dev_v1alpha1/mod.rs | 6 + .../src/bpfd_dev_v1alpha1/tcprograms.rs | 184 ++++++++++++ .../bpfd_dev_v1alpha1/tracepointprograms.rs | 157 ++++++++++ .../src/bpfd_dev_v1alpha1/uprobeprograms.rs | 169 +++++++++++ .../src/bpfd_dev_v1alpha1/xdpprograms.rs | 172 +++++++++++ kube-custom-resources-rs/src/lib.rs | 2 + 17 files changed, 2272 insertions(+) create mode 100644 crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/bpfprograms.yaml create mode 100644 crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/kprobeprograms.yaml create mode 100644 crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tcprograms.yaml create mode 100644 crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tracepointprograms.yaml create mode 100644 crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/uprobeprograms.yaml create mode 100644 crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/xdpprograms.yaml create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/bpfprograms.rs create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/kprobeprograms.rs create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/mod.rs create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tcprograms.rs create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tracepointprograms.rs create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/uprobeprograms.rs create mode 100644 kube-custom-resources-rs/src/bpfd_dev_v1alpha1/xdpprograms.rs diff --git a/.reuse/dep5 b/.reuse/dep5 index b69c2e4c8..6534ee963 100644 --- a/.reuse/dep5 +++ b/.reuse/dep5 @@ -139,6 +139,10 @@ Files: crd-catalog/bitnami-labs/sealed-secrets/* Copyright: The bitnami-labs/sealed-secrets Authors License: Apache-2.0 +Files: crd-catalog/bpfd-dev/bpfd/* +Copyright: The bpfd-dev/bpfd Authors +License: Apache-2.0 + Files: crd-catalog/carlosedp/lbconfig-operator/* Copyright: The carlosedp/lbconfig-operator Authors License: MIT diff --git a/code-generator/src/catalog.rs b/code-generator/src/catalog.rs index b488fe85d..a56aa5ddb 100644 --- a/code-generator/src/catalog.rs +++ b/code-generator/src/catalog.rs @@ -372,6 +372,18 @@ pub const CRD_V1_SOURCES: &'static [UpstreamSource] = &[ "https://github.com/bitnami-labs/sealed-secrets/blob/main/helm/sealed-secrets/crds/bitnami.com_sealedsecrets.yaml", ], }, + UpstreamSource { + project_name: "bpfd-dev/bpfd", + license: APACHE_V2, + urls: &[ + "https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/crd/bases/bpfd.dev_bpfprograms.yaml", + "https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/crd/bases/bpfd.dev_kprobeprograms.yaml", + "https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/crd/bases/bpfd.dev_tcprograms.yaml", + "https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/crd/bases/bpfd.dev_tracepointprograms.yaml", + "https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/crd/bases/bpfd.dev_uprobeprograms.yaml", + "https://github.com/bpfd-dev/bpfd/blob/main/bpfd-operator/config/crd/bases/bpfd.dev_xdpprograms.yaml", + ], + }, UpstreamSource { project_name: "carlosedp/lbconfig-operator", license: MIT, diff --git a/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/bpfprograms.yaml b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/bpfprograms.yaml new file mode 100644 index 000000000..992c216ad --- /dev/null +++ b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/bpfprograms.yaml @@ -0,0 +1,98 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + name: bpfprograms.bpfd.dev +spec: + group: bpfd.dev + names: + kind: BpfProgram + listKind: BpfProgramList + plural: bpfprograms + singular: bpfprogram + scope: Cluster + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: BpfProgram is the Schema for the Bpfprograms API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: BpfProgramSpec defines the desired state of BpfProgram + properties: + maps: + additionalProperties: + type: string + description: 'Maps is a map with Keys: Map Names, and Values: Map Pin paths' + type: object + type: + description: Type specifies the bpf program type + type: string + type: object + status: + description: BpfProgramStatus defines the observed state of BpfProgram TODO Make these a fixed set of metav1.Condition.types and metav1.Condition.reasons + properties: + conditions: + description: 'Conditions houses the updates regarding the actual implementation of the bpf program on the node Known .status.conditions.type are: "Available", "Progressing", and "Degraded"' + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + format: int64 + minimum: 0.0 + type: integer + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/kprobeprograms.yaml b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/kprobeprograms.yaml new file mode 100644 index 000000000..e327bfd9b --- /dev/null +++ b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/kprobeprograms.yaml @@ -0,0 +1,239 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + name: kprobeprograms.bpfd.dev +spec: + group: bpfd.dev + names: + kind: KprobeProgram + listKind: KprobeProgramList + plural: kprobeprograms + singular: kprobeprogram + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.bpffunctionname + name: BpfFunctionName + type: string + - jsonPath: .spec.nodeselector + name: NodeSelector + type: string + - jsonPath: .spec.func_name + name: FunctionName + priority: 1 + type: string + - jsonPath: .spec.offset + name: Offset + priority: 1 + type: integer + - jsonPath: .spec.retprobe + name: RetProbe + priority: 1 + type: boolean + name: v1alpha1 + schema: + openAPIV3Schema: + description: KprobeProgram is the Schema for the KprobePrograms API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: KprobeProgramSpec defines the desired state of KprobeProgram + properties: + bpffunctionname: + description: BpfFunctionName is the name of the function that is the entry point for the BPF program + type: string + bytecode: + description: Bytecode configures where the bpf program's bytecode should be loaded from. + properties: + image: + description: Image used to specify a bytecode container image. + properties: + imagepullpolicy: + default: IfNotPresent + description: PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + enum: + - Always + - Never + - IfNotPresent + type: string + imagepullsecret: + description: ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + properties: + name: + description: Name of the secret which contains the credentials to access the image repository. + type: string + namespace: + description: Namespace of the secret which contains the credentials to access the image repository. + type: string + required: + - name + - namespace + type: object + url: + description: Valid container image URL used to reference a remote bytecode image. + type: string + required: + - url + type: object + path: + description: Path is used to specify a bytecode object via filepath. + type: string + type: object + func_names: + description: Functions to attach the kprobe to. + items: + type: string + type: array + globaldata: + additionalProperties: + format: byte + type: string + description: GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + type: object + mapownerselector: + description: MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + nodeselector: + description: NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + offset: + default: 0 + description: Offset added to the address of the function for kprobe. Not allowed for kretprobes. + format: int64 + type: integer + retprobe: + default: false + description: Whether the program is a kretprobe. Default is false + type: boolean + required: + - bpffunctionname + - bytecode + - func_names + - nodeselector + type: object + x-kubernetes-validations: + - message: offset cannot be set for kretprobes + rule: self.retprobe == false || self.offset == 0 + status: + description: KprobeProgramStatus defines the observed state of KprobeProgram + properties: + conditions: + description: Conditions houses the global cluster state for the KprobeProgram. The explicit condition types are defined internally. + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + format: int64 + minimum: 0.0 + type: integer + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tcprograms.yaml b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tcprograms.yaml new file mode 100644 index 000000000..e23f09141 --- /dev/null +++ b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tcprograms.yaml @@ -0,0 +1,275 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + name: tcprograms.bpfd.dev +spec: + group: bpfd.dev + names: + kind: TcProgram + listKind: TcProgramList + plural: tcprograms + singular: tcprogram + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.bpffunctionname + name: BpfFunctionName + type: string + - jsonPath: .spec.nodeselector + name: NodeSelector + type: string + - jsonPath: .spec.priority + name: Priority + priority: 1 + type: string + - jsonPath: .spec.direction + name: Direction + priority: 1 + type: string + - jsonPath: .spec.interfaceselector + name: InterfaceSelector + priority: 1 + type: string + - jsonPath: .spec.proceedon + name: ProceedOn + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: TcProgram is the Schema for the TcProgram API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: TcProgramSpec defines the desired state of TcProgram + properties: + bpffunctionname: + description: BpfFunctionName is the name of the function that is the entry point for the BPF program + type: string + bytecode: + description: Bytecode configures where the bpf program's bytecode should be loaded from. + properties: + image: + description: Image used to specify a bytecode container image. + properties: + imagepullpolicy: + default: IfNotPresent + description: PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + enum: + - Always + - Never + - IfNotPresent + type: string + imagepullsecret: + description: ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + properties: + name: + description: Name of the secret which contains the credentials to access the image repository. + type: string + namespace: + description: Namespace of the secret which contains the credentials to access the image repository. + type: string + required: + - name + - namespace + type: object + url: + description: Valid container image URL used to reference a remote bytecode image. + type: string + required: + - url + type: object + path: + description: Path is used to specify a bytecode object via filepath. + type: string + type: object + direction: + description: Direction specifies the direction of traffic the tc program should attach to for a given network device. + enum: + - ingress + - egress + type: string + globaldata: + additionalProperties: + format: byte + type: string + description: GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + type: object + interfaceselector: + description: Selector to determine the network interface (or interfaces) + maxProperties: 1 + minProperties: 1 + properties: + interfaces: + description: Interfaces refers to a list of network interfaces to attach the BPF program to. + items: + type: string + type: array + primarynodeinterface: + description: Attach BPF program to the primary interface on the node. Only 'true' accepted. + type: boolean + type: object + mapownerselector: + description: MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + nodeselector: + description: NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + priority: + description: Priority specifies the priority of the tc program in relation to other programs of the same type with the same attach point. It is a value from 0 to 1000 where lower values have higher precedence. + format: int32 + maximum: 1000.0 + minimum: 0.0 + type: integer + proceedon: + default: + - pipe + - dispatcher_return + description: ProceedOn allows the user to call other tc programs in chain on this exit code. Multiple values are supported by repeating the parameter. + items: + enum: + - unspec + - ok + - reclassify + - shot + - pipe + - stolen + - queued + - repeat + - redirect + - trap + - dispatcher_return + type: string + maxItems: 11 + type: array + required: + - bpffunctionname + - bytecode + - direction + - interfaceselector + - nodeselector + - priority + type: object + status: + description: TcProgramStatus defines the observed state of TcProgram + properties: + conditions: + description: Conditions houses the global cluster state for the TcProgram. The explicit condition types are defined internally. + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + format: int64 + minimum: 0.0 + type: integer + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tracepointprograms.yaml b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tracepointprograms.yaml new file mode 100644 index 000000000..e2a1853b9 --- /dev/null +++ b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tracepointprograms.yaml @@ -0,0 +1,219 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + name: tracepointprograms.bpfd.dev +spec: + group: bpfd.dev + names: + kind: TracepointProgram + listKind: TracepointProgramList + plural: tracepointprograms + singular: tracepointprogram + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.bpffunctionname + name: BpfFunctionName + type: string + - jsonPath: .spec.nodeselector + name: NodeSelector + type: string + - jsonPath: .spec.name + name: TracePoint + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: TracepointProgram is the Schema for the TracepointPrograms API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: TracepointProgramSpec defines the desired state of TracepointProgram + properties: + bpffunctionname: + description: BpfFunctionName is the name of the function that is the entry point for the BPF program + type: string + bytecode: + description: Bytecode configures where the bpf program's bytecode should be loaded from. + properties: + image: + description: Image used to specify a bytecode container image. + properties: + imagepullpolicy: + default: IfNotPresent + description: PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + enum: + - Always + - Never + - IfNotPresent + type: string + imagepullsecret: + description: ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + properties: + name: + description: Name of the secret which contains the credentials to access the image repository. + type: string + namespace: + description: Namespace of the secret which contains the credentials to access the image repository. + type: string + required: + - name + - namespace + type: object + url: + description: Valid container image URL used to reference a remote bytecode image. + type: string + required: + - url + type: object + path: + description: Path is used to specify a bytecode object via filepath. + type: string + type: object + globaldata: + additionalProperties: + format: byte + type: string + description: GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + type: object + mapownerselector: + description: MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + names: + description: Names refers to the names of kernel tracepoints to attach the bpf program to. + items: + type: string + type: array + nodeselector: + description: NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + required: + - bpffunctionname + - bytecode + - names + - nodeselector + type: object + status: + description: TracepointProgramStatus defines the observed state of TracepointProgram + properties: + conditions: + description: Conditions houses the global cluster state for the TracepointProgram. The explicit condition types are defined internally. + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + format: int64 + minimum: 0.0 + type: integer + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/uprobeprograms.yaml b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/uprobeprograms.yaml new file mode 100644 index 000000000..4d4d6629d --- /dev/null +++ b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/uprobeprograms.yaml @@ -0,0 +1,251 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + name: uprobeprograms.bpfd.dev +spec: + group: bpfd.dev + names: + kind: UprobeProgram + listKind: UprobeProgramList + plural: uprobeprograms + singular: uprobeprogram + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.bpffunctionname + name: BpfFunctionName + type: string + - jsonPath: .spec.nodeselector + name: NodeSelector + type: string + - jsonPath: .spec.func_name + name: FunctionName + priority: 1 + type: string + - jsonPath: .spec.offset + name: Offset + priority: 1 + type: integer + - jsonPath: .spec.target + name: Target + priority: 1 + type: string + - jsonPath: .spec.retprobe + name: RetProbe + priority: 1 + type: boolean + - jsonPath: .spec.pid + name: Pid + priority: 1 + type: integer + name: v1alpha1 + schema: + openAPIV3Schema: + description: UprobeProgram is the Schema for the UprobePrograms API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: UprobeProgramSpec defines the desired state of UprobeProgram + properties: + bpffunctionname: + description: BpfFunctionName is the name of the function that is the entry point for the BPF program + type: string + bytecode: + description: Bytecode configures where the bpf program's bytecode should be loaded from. + properties: + image: + description: Image used to specify a bytecode container image. + properties: + imagepullpolicy: + default: IfNotPresent + description: PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + enum: + - Always + - Never + - IfNotPresent + type: string + imagepullsecret: + description: ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + properties: + name: + description: Name of the secret which contains the credentials to access the image repository. + type: string + namespace: + description: Namespace of the secret which contains the credentials to access the image repository. + type: string + required: + - name + - namespace + type: object + url: + description: Valid container image URL used to reference a remote bytecode image. + type: string + required: + - url + type: object + path: + description: Path is used to specify a bytecode object via filepath. + type: string + type: object + func_name: + description: Function to attach the uprobe to. + type: string + globaldata: + additionalProperties: + format: byte + type: string + description: GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + type: object + mapownerselector: + description: MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + nodeselector: + description: NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + offset: + default: 0 + description: Offset added to the address of the function for uprobe. + format: int64 + type: integer + pid: + description: Only execute uprobe for given process identification number (PID). If PID is not provided, uprobe executes for all PIDs. + format: int32 + type: integer + retprobe: + default: false + description: Whether the program is a uretprobe. Default is false + type: boolean + target: + description: Library name or the absolute path to a binary or library. + items: + type: string + type: array + required: + - bpffunctionname + - bytecode + - nodeselector + - target + type: object + status: + description: UprobeProgramStatus defines the observed state of UprobeProgram + properties: + conditions: + description: Conditions houses the global cluster state for the UprobeProgram. The explicit condition types are defined internally. + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + format: int64 + minimum: 0.0 + type: integer + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/xdpprograms.yaml b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/xdpprograms.yaml new file mode 100644 index 000000000..fbe477bd0 --- /dev/null +++ b/crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/xdpprograms.yaml @@ -0,0 +1,258 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.11.3 + name: xdpprograms.bpfd.dev +spec: + group: bpfd.dev + names: + kind: XdpProgram + listKind: XdpProgramList + plural: xdpprograms + singular: xdpprogram + scope: Cluster + versions: + - additionalPrinterColumns: + - jsonPath: .spec.bpffunctionname + name: BpfFunctionName + type: string + - jsonPath: .spec.nodeselector + name: NodeSelector + type: string + - jsonPath: .spec.priority + name: Priority + priority: 1 + type: string + - jsonPath: .spec.interfaceselector + name: InterfaceSelector + priority: 1 + type: string + - jsonPath: .spec.proceedon + name: ProceedOn + priority: 1 + type: string + name: v1alpha1 + schema: + openAPIV3Schema: + description: XdpProgram is the Schema for the XdpPrograms API + properties: + apiVersion: + description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources' + type: string + kind: + description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds' + type: string + metadata: + type: object + spec: + description: XdpProgramSpec defines the desired state of XdpProgram + properties: + bpffunctionname: + description: BpfFunctionName is the name of the function that is the entry point for the BPF program + type: string + bytecode: + description: Bytecode configures where the bpf program's bytecode should be loaded from. + properties: + image: + description: Image used to specify a bytecode container image. + properties: + imagepullpolicy: + default: IfNotPresent + description: PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + enum: + - Always + - Never + - IfNotPresent + type: string + imagepullsecret: + description: ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + properties: + name: + description: Name of the secret which contains the credentials to access the image repository. + type: string + namespace: + description: Namespace of the secret which contains the credentials to access the image repository. + type: string + required: + - name + - namespace + type: object + url: + description: Valid container image URL used to reference a remote bytecode image. + type: string + required: + - url + type: object + path: + description: Path is used to specify a bytecode object via filepath. + type: string + type: object + globaldata: + additionalProperties: + format: byte + type: string + description: GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + type: object + interfaceselector: + description: Selector to determine the network interface (or interfaces) + maxProperties: 1 + minProperties: 1 + properties: + interfaces: + description: Interfaces refers to a list of network interfaces to attach the BPF program to. + items: + type: string + type: array + primarynodeinterface: + description: Attach BPF program to the primary interface on the node. Only 'true' accepted. + type: boolean + type: object + mapownerselector: + description: MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + nodeselector: + description: NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + properties: + matchExpressions: + description: matchExpressions is a list of label selector requirements. The requirements are ANDed. + items: + description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. + properties: + key: + description: key is the label key that the selector applies to. + type: string + operator: + description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + type: string + values: + description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + items: + type: string + type: array + required: + - key + - operator + type: object + type: array + matchLabels: + additionalProperties: + type: string + description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + type: object + type: object + x-kubernetes-map-type: atomic + priority: + description: Priority specifies the priority of the bpf program in relation to other programs of the same type with the same attach point. It is a value from 0 to 1000 where lower values have higher precedence. + format: int32 + maximum: 1000.0 + minimum: 0.0 + type: integer + proceedon: + default: + - pass + - dispatcher_return + items: + enum: + - aborted + - drop + - pass + - tx + - redirect + - dispatcher_return + type: string + maxItems: 6 + type: array + required: + - bpffunctionname + - bytecode + - interfaceselector + - nodeselector + - priority + type: object + status: + description: XdpProgramStatus defines the observed state of XdpProgram + properties: + conditions: + description: Conditions houses the global cluster state for the XdpProgram. The explicit condition types are defined internally. + items: + description: "Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, \n type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: \"Available\", \"Progressing\", and \"Degraded\" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:\"conditions,omitempty\" patchStrategy:\"merge\" patchMergeKey:\"type\" protobuf:\"bytes,1,rep,name=conditions\"` \n // other fields }" + properties: + lastTransitionTime: + description: lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + format: date-time + type: string + message: + description: message is a human readable message indicating details about the transition. This may be an empty string. + maxLength: 32768 + type: string + observedGeneration: + description: observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + format: int64 + minimum: 0.0 + type: integer + reason: + description: reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + maxLength: 1024 + minLength: 1 + pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$ + type: string + status: + description: status of the condition, one of True, False, Unknown. + enum: + - 'True' + - 'False' + - Unknown + type: string + type: + description: type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + maxLength: 316 + pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$ + type: string + required: + - lastTransitionTime + - message + - reason + - status + - type + type: object + type: array + x-kubernetes-list-map-keys: + - type + x-kubernetes-list-type: map + type: object + required: + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/kube-custom-resources-rs/Cargo.toml b/kube-custom-resources-rs/Cargo.toml index bb4db94d1..df40c51d8 100644 --- a/kube-custom-resources-rs/Cargo.toml +++ b/kube-custom-resources-rs/Cargo.toml @@ -67,6 +67,7 @@ beat_k8s_elastic_co_v1beta1 = [] binding_operators_coreos_com_v1alpha1 = [] bitnami_com_v1alpha1 = [] boskos_k8s_io_v1 = [] +bpfd_dev_v1alpha1 = [] bus_volcano_sh_v1alpha1 = [] cache_kubedl_io_v1alpha1 = [] caching_ibm_com_v1alpha1 = [] diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/bpfprograms.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/bpfprograms.rs new file mode 100644 index 000000000..92c0f23a4 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/bpfprograms.rs @@ -0,0 +1,62 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename ./crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/bpfprograms.yaml +// kopium version: 0.16.1 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// BpfProgramSpec defines the desired state of BpfProgram +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)] +#[kube(group = "bpfd.dev", version = "v1alpha1", kind = "BpfProgram", plural = "bpfprograms")] +#[kube(status = "BpfProgramStatus")] +#[kube(schema = "disabled")] +pub struct BpfProgramSpec { + /// Maps is a map with Keys: Map Names, and Values: Map Pin paths + #[serde(default, skip_serializing_if = "Option::is_none")] + pub maps: Option>, + /// Type specifies the bpf program type + #[serde(default, skip_serializing_if = "Option::is_none", rename = "type")] + pub r#type: Option, +} + +/// BpfProgramStatus defines the observed state of BpfProgram TODO Make these a fixed set of metav1.Condition.types and metav1.Condition.reasons +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct BpfProgramStatus { + /// Conditions houses the updates regarding the actual implementation of the bpf program on the node Known .status.conditions.type are: "Available", "Progressing", and "Degraded" + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct BpfProgramStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: BpfProgramStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum BpfProgramStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/kprobeprograms.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/kprobeprograms.rs new file mode 100644 index 000000000..0a4c44f34 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/kprobeprograms.rs @@ -0,0 +1,163 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename ./crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/kprobeprograms.yaml +// kopium version: 0.16.1 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// KprobeProgramSpec defines the desired state of KprobeProgram +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)] +#[kube(group = "bpfd.dev", version = "v1alpha1", kind = "KprobeProgram", plural = "kprobeprograms")] +#[kube(status = "KprobeProgramStatus")] +#[kube(schema = "disabled")] +pub struct KprobeProgramSpec { + /// BpfFunctionName is the name of the function that is the entry point for the BPF program + pub bpffunctionname: String, + /// Bytecode configures where the bpf program's bytecode should be loaded from. + pub bytecode: KprobeProgramBytecode, + /// Functions to attach the kprobe to. + pub func_names: Vec, + /// GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub globaldata: Option>, + /// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mapownerselector: Option, + /// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + pub nodeselector: KprobeProgramNodeselector, + /// Offset added to the address of the function for kprobe. Not allowed for kretprobes. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Whether the program is a kretprobe. Default is false + #[serde(default, skip_serializing_if = "Option::is_none")] + pub retprobe: Option, +} + +/// Bytecode configures where the bpf program's bytecode should be loaded from. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramBytecode { + /// Image used to specify a bytecode container image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option, + /// Path is used to specify a bytecode object via filepath. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramBytecodeImage { + /// PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullpolicy: Option, + /// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullsecret: Option, + /// Valid container image URL used to reference a remote bytecode image. + pub url: String, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum KprobeProgramBytecodeImageImagepullpolicy { + Always, + Never, + IfNotPresent, +} + +/// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramBytecodeImageImagepullsecret { + /// Name of the secret which contains the credentials to access the image repository. + pub name: String, + /// Namespace of the secret which contains the credentials to access the image repository. + pub namespace: String, +} + +/// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramMapownerselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramMapownerselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramNodeselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramNodeselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// KprobeProgramStatus defines the observed state of KprobeProgram +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramStatus { + /// Conditions houses the global cluster state for the KprobeProgram. The explicit condition types are defined internally. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct KprobeProgramStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: KprobeProgramStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum KprobeProgramStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/mod.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/mod.rs new file mode 100644 index 000000000..a08254f75 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/mod.rs @@ -0,0 +1,6 @@ +pub mod bpfprograms; +pub mod kprobeprograms; +pub mod tcprograms; +pub mod tracepointprograms; +pub mod uprobeprograms; +pub mod xdpprograms; diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tcprograms.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tcprograms.rs new file mode 100644 index 000000000..5416b46f6 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tcprograms.rs @@ -0,0 +1,184 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename ./crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tcprograms.yaml +// kopium version: 0.16.1 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// TcProgramSpec defines the desired state of TcProgram +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)] +#[kube(group = "bpfd.dev", version = "v1alpha1", kind = "TcProgram", plural = "tcprograms")] +#[kube(status = "TcProgramStatus")] +#[kube(schema = "disabled")] +pub struct TcProgramSpec { + /// BpfFunctionName is the name of the function that is the entry point for the BPF program + pub bpffunctionname: String, + /// Bytecode configures where the bpf program's bytecode should be loaded from. + pub bytecode: TcProgramBytecode, + /// Direction specifies the direction of traffic the tc program should attach to for a given network device. + pub direction: TcProgramDirection, + /// GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub globaldata: Option>, + /// Selector to determine the network interface (or interfaces) + pub interfaceselector: TcProgramInterfaceselector, + /// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mapownerselector: Option, + /// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + pub nodeselector: TcProgramNodeselector, + /// Priority specifies the priority of the tc program in relation to other programs of the same type with the same attach point. It is a value from 0 to 1000 where lower values have higher precedence. + pub priority: i32, + /// ProceedOn allows the user to call other tc programs in chain on this exit code. Multiple values are supported by repeating the parameter. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub proceedon: Option>, +} + +/// Bytecode configures where the bpf program's bytecode should be loaded from. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramBytecode { + /// Image used to specify a bytecode container image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option, + /// Path is used to specify a bytecode object via filepath. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramBytecodeImage { + /// PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullpolicy: Option, + /// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullsecret: Option, + /// Valid container image URL used to reference a remote bytecode image. + pub url: String, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum TcProgramBytecodeImageImagepullpolicy { + Always, + Never, + IfNotPresent, +} + +/// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramBytecodeImageImagepullsecret { + /// Name of the secret which contains the credentials to access the image repository. + pub name: String, + /// Namespace of the secret which contains the credentials to access the image repository. + pub namespace: String, +} + +/// TcProgramSpec defines the desired state of TcProgram +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum TcProgramDirection { + #[serde(rename = "ingress")] + Ingress, + #[serde(rename = "egress")] + Egress, +} + +/// Selector to determine the network interface (or interfaces) +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramInterfaceselector { + /// Interfaces refers to a list of network interfaces to attach the BPF program to. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub interfaces: Option>, + /// Attach BPF program to the primary interface on the node. Only 'true' accepted. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primarynodeinterface: Option, +} + +/// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramMapownerselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramMapownerselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramNodeselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramNodeselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// TcProgramStatus defines the observed state of TcProgram +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramStatus { + /// Conditions houses the global cluster state for the TcProgram. The explicit condition types are defined internally. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TcProgramStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: TcProgramStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum TcProgramStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tracepointprograms.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tracepointprograms.rs new file mode 100644 index 000000000..23dd6b127 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/tracepointprograms.rs @@ -0,0 +1,157 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename ./crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/tracepointprograms.yaml +// kopium version: 0.16.1 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// TracepointProgramSpec defines the desired state of TracepointProgram +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)] +#[kube(group = "bpfd.dev", version = "v1alpha1", kind = "TracepointProgram", plural = "tracepointprograms")] +#[kube(status = "TracepointProgramStatus")] +#[kube(schema = "disabled")] +pub struct TracepointProgramSpec { + /// BpfFunctionName is the name of the function that is the entry point for the BPF program + pub bpffunctionname: String, + /// Bytecode configures where the bpf program's bytecode should be loaded from. + pub bytecode: TracepointProgramBytecode, + /// GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub globaldata: Option>, + /// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mapownerselector: Option, + /// Names refers to the names of kernel tracepoints to attach the bpf program to. + pub names: Vec, + /// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + pub nodeselector: TracepointProgramNodeselector, +} + +/// Bytecode configures where the bpf program's bytecode should be loaded from. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramBytecode { + /// Image used to specify a bytecode container image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option, + /// Path is used to specify a bytecode object via filepath. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramBytecodeImage { + /// PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullpolicy: Option, + /// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullsecret: Option, + /// Valid container image URL used to reference a remote bytecode image. + pub url: String, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum TracepointProgramBytecodeImageImagepullpolicy { + Always, + Never, + IfNotPresent, +} + +/// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramBytecodeImageImagepullsecret { + /// Name of the secret which contains the credentials to access the image repository. + pub name: String, + /// Namespace of the secret which contains the credentials to access the image repository. + pub namespace: String, +} + +/// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramMapownerselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramMapownerselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramNodeselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramNodeselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// TracepointProgramStatus defines the observed state of TracepointProgram +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramStatus { + /// Conditions houses the global cluster state for the TracepointProgram. The explicit condition types are defined internally. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct TracepointProgramStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: TracepointProgramStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum TracepointProgramStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/uprobeprograms.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/uprobeprograms.rs new file mode 100644 index 000000000..24cc0d7b6 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/uprobeprograms.rs @@ -0,0 +1,169 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename ./crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/uprobeprograms.yaml +// kopium version: 0.16.1 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// UprobeProgramSpec defines the desired state of UprobeProgram +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)] +#[kube(group = "bpfd.dev", version = "v1alpha1", kind = "UprobeProgram", plural = "uprobeprograms")] +#[kube(status = "UprobeProgramStatus")] +#[kube(schema = "disabled")] +pub struct UprobeProgramSpec { + /// BpfFunctionName is the name of the function that is the entry point for the BPF program + pub bpffunctionname: String, + /// Bytecode configures where the bpf program's bytecode should be loaded from. + pub bytecode: UprobeProgramBytecode, + /// Function to attach the uprobe to. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub func_name: Option, + /// GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub globaldata: Option>, + /// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mapownerselector: Option, + /// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + pub nodeselector: UprobeProgramNodeselector, + /// Offset added to the address of the function for uprobe. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub offset: Option, + /// Only execute uprobe for given process identification number (PID). If PID is not provided, uprobe executes for all PIDs. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub pid: Option, + /// Whether the program is a uretprobe. Default is false + #[serde(default, skip_serializing_if = "Option::is_none")] + pub retprobe: Option, + /// Library name or the absolute path to a binary or library. + pub target: Vec, +} + +/// Bytecode configures where the bpf program's bytecode should be loaded from. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramBytecode { + /// Image used to specify a bytecode container image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option, + /// Path is used to specify a bytecode object via filepath. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramBytecodeImage { + /// PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullpolicy: Option, + /// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullsecret: Option, + /// Valid container image URL used to reference a remote bytecode image. + pub url: String, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum UprobeProgramBytecodeImageImagepullpolicy { + Always, + Never, + IfNotPresent, +} + +/// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramBytecodeImageImagepullsecret { + /// Name of the secret which contains the credentials to access the image repository. + pub name: String, + /// Namespace of the secret which contains the credentials to access the image repository. + pub namespace: String, +} + +/// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramMapownerselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramMapownerselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramNodeselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramNodeselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// UprobeProgramStatus defines the observed state of UprobeProgram +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramStatus { + /// Conditions houses the global cluster state for the UprobeProgram. The explicit condition types are defined internally. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct UprobeProgramStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: UprobeProgramStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum UprobeProgramStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/xdpprograms.rs b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/xdpprograms.rs new file mode 100644 index 000000000..cf1bfa233 --- /dev/null +++ b/kube-custom-resources-rs/src/bpfd_dev_v1alpha1/xdpprograms.rs @@ -0,0 +1,172 @@ +// WARNING: generated by kopium - manual changes will be overwritten +// kopium command: kopium --docs --filename ./crd-catalog/bpfd-dev/bpfd/bpfd.dev/v1alpha1/xdpprograms.yaml +// kopium version: 0.16.1 + +use kube::CustomResource; +use serde::{Serialize, Deserialize}; +use std::collections::BTreeMap; + +/// XdpProgramSpec defines the desired state of XdpProgram +#[derive(CustomResource, Serialize, Deserialize, Clone, Debug)] +#[kube(group = "bpfd.dev", version = "v1alpha1", kind = "XdpProgram", plural = "xdpprograms")] +#[kube(status = "XdpProgramStatus")] +#[kube(schema = "disabled")] +pub struct XdpProgramSpec { + /// BpfFunctionName is the name of the function that is the entry point for the BPF program + pub bpffunctionname: String, + /// Bytecode configures where the bpf program's bytecode should be loaded from. + pub bytecode: XdpProgramBytecode, + /// GlobalData allows the user to to set global variables when the program is loaded with an array of raw bytes. This is a very low level primitive. The caller is responsible for formatting the byte string appropriately considering such things as size, endianness, alignment and packing of data structures. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub globaldata: Option>, + /// Selector to determine the network interface (or interfaces) + pub interfaceselector: XdpProgramInterfaceselector, + /// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub mapownerselector: Option, + /// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. + pub nodeselector: XdpProgramNodeselector, + /// Priority specifies the priority of the bpf program in relation to other programs of the same type with the same attach point. It is a value from 0 to 1000 where lower values have higher precedence. + pub priority: i32, + #[serde(default, skip_serializing_if = "Option::is_none")] + pub proceedon: Option>, +} + +/// Bytecode configures where the bpf program's bytecode should be loaded from. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramBytecode { + /// Image used to specify a bytecode container image. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub image: Option, + /// Path is used to specify a bytecode object via filepath. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub path: Option, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramBytecodeImage { + /// PullPolicy describes a policy for if/when to pull a bytecode image. Defaults to IfNotPresent. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullpolicy: Option, + /// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub imagepullsecret: Option, + /// Valid container image URL used to reference a remote bytecode image. + pub url: String, +} + +/// Image used to specify a bytecode container image. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum XdpProgramBytecodeImageImagepullpolicy { + Always, + Never, + IfNotPresent, +} + +/// ImagePullSecret is the name of the secret bpfd should use to get remote image repository secrets. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramBytecodeImageImagepullsecret { + /// Name of the secret which contains the credentials to access the image repository. + pub name: String, + /// Namespace of the secret which contains the credentials to access the image repository. + pub namespace: String, +} + +/// Selector to determine the network interface (or interfaces) +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramInterfaceselector { + /// Interfaces refers to a list of network interfaces to attach the BPF program to. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub interfaces: Option>, + /// Attach BPF program to the primary interface on the node. Only 'true' accepted. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub primarynodeinterface: Option, +} + +/// MapOwnerSelector is used to select the loaded eBPF program this eBPF program will share a map with. The value is a label applied to the BpfProgram to select. The selector must resolve to exactly one instance of a BpfProgram on a given node or the eBPF program will not load. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramMapownerselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramMapownerselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// NodeSelector allows the user to specify which nodes to deploy the bpf program to. This field must be specified, to select all nodes use standard metav1.LabelSelector semantics and make it empty. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramNodeselector { + /// matchExpressions is a list of label selector requirements. The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchExpressions")] + pub match_expressions: Option>, + /// matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "matchLabels")] + pub match_labels: Option>, +} + +/// A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values. +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramNodeselectorMatchExpressions { + /// key is the label key that the selector applies to. + pub key: String, + /// operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist. + pub operator: String, + /// values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub values: Option>, +} + +/// XdpProgramStatus defines the observed state of XdpProgram +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramStatus { + /// Conditions houses the global cluster state for the XdpProgram. The explicit condition types are defined internally. + #[serde(default, skip_serializing_if = "Option::is_none")] + pub conditions: Option>, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub struct XdpProgramStatusConditions { + /// lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable. + #[serde(rename = "lastTransitionTime")] + pub last_transition_time: String, + /// message is a human readable message indicating details about the transition. This may be an empty string. + pub message: String, + /// observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance. + #[serde(default, skip_serializing_if = "Option::is_none", rename = "observedGeneration")] + pub observed_generation: Option, + /// reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty. + pub reason: String, + /// status of the condition, one of True, False, Unknown. + pub status: XdpProgramStatusConditionsStatus, + /// type of condition in CamelCase or in foo.example.com/CamelCase. --- Many .condition.type values are consistent across resources like Available, but because arbitrary conditions can be useful (see .node.status.conditions), the ability to deconflict is important. The regex it matches is (dns1123SubdomainFmt/)?(qualifiedNameFmt) + #[serde(rename = "type")] + pub r#type: String, +} + +/// Condition contains details for one aspect of the current state of this API Resource. --- This struct is intended for direct use as an array at the field path .status.conditions. For example, +/// type FooStatus struct{ // Represents the observations of a foo's current state. // Known .status.conditions.type are: "Available", "Progressing", and "Degraded" // +patchMergeKey=type // +patchStrategy=merge // +listType=map // +listMapKey=type Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` +/// // other fields } +#[derive(Serialize, Deserialize, Clone, Debug)] +pub enum XdpProgramStatusConditionsStatus { + True, + False, + Unknown, +} + diff --git a/kube-custom-resources-rs/src/lib.rs b/kube-custom-resources-rs/src/lib.rs index 712999165..ea82ad501 100644 --- a/kube-custom-resources-rs/src/lib.rs +++ b/kube-custom-resources-rs/src/lib.rs @@ -80,6 +80,8 @@ pub mod binding_operators_coreos_com_v1alpha1; pub mod bitnami_com_v1alpha1; #[cfg(feature = "boskos_k8s_io_v1")] pub mod boskos_k8s_io_v1; +#[cfg(feature = "bpfd_dev_v1alpha1")] +pub mod bpfd_dev_v1alpha1; #[cfg(feature = "bus_volcano_sh_v1alpha1")] pub mod bus_volcano_sh_v1alpha1; #[cfg(feature = "cache_kubedl_io_v1alpha1")]