From 43ed0f422343e291b418f6de5b12319036847476 Mon Sep 17 00:00:00 2001 From: Thomas Ferrandiz Date: Mon, 2 Sep 2024 14:20:09 +0000 Subject: [PATCH] Add missing crds and options in the chart --- .../crds/whereabouts.cni.cncf.io_ippools.yaml | 36 +++++---- ...hereabouts.cni.cncf.io_nodeslicepools.yaml | 79 +++++++++++++++++++ ...ncf.io_overlappingrangeipreservations.yaml | 31 ++++---- .../templates/cluster_role.yaml | 7 ++ .../templates/node-slice-controller.yaml | 4 +- deployment/whereabouts-chart/values.yaml | 3 + 6 files changed, 127 insertions(+), 33 deletions(-) create mode 100644 deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_nodeslicepools.yaml diff --git a/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_ippools.yaml b/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_ippools.yaml index c912654e3..8e0ef3628 100644 --- a/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_ippools.yaml +++ b/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_ippools.yaml @@ -1,9 +1,9 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: ippools.whereabouts.cni.cncf.io spec: group: whereabouts.cni.cncf.io @@ -20,14 +20,19 @@ spec: description: IPPool is the Schema for the ippools 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' + 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' + 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 @@ -41,14 +46,17 @@ spec: properties: id: type: string + ifname: + type: string podref: type: string required: - id + - podref type: object - description: Allocations is the set of allocated IPs for the given - range. Its` indices are a direct mapping to the IP with the same - index/offset for the pool's range. + description: |- + Allocations is the set of allocated IPs for the given range. Its` indices are a direct mapping to the + IP with the same index/offset for the pool's range. type: object range: description: Range is a RFC 4632/4291-style string that represents @@ -61,9 +69,3 @@ spec: type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_nodeslicepools.yaml b/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_nodeslicepools.yaml new file mode 100644 index 000000000..113d0837f --- /dev/null +++ b/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_nodeslicepools.yaml @@ -0,0 +1,79 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + controller-gen.kubebuilder.io/version: v0.14.0 + name: nodeslicepools.whereabouts.cni.cncf.io +spec: + group: whereabouts.cni.cncf.io + names: + kind: NodeSlicePool + listKind: NodeSlicePoolList + plural: nodeslicepools + singular: nodeslicepool + scope: Namespaced + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: NodeSlicePool is the Schema for the nodesliceippools 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: NodeSlicePoolSpec defines the desired state of NodeSlicePool + properties: + range: + description: |- + Range is a RFC 4632/4291-style string that represents an IP address and prefix length in CIDR notation + this refers to the entire range where the node is allocated a subset + type: string + sliceSize: + description: SliceSize is the size of subnets or slices of the range + that each node will be assigned + type: string + required: + - range + - sliceSize + type: object + status: + description: NodeSlicePoolStatus defines the desired state of NodeSlicePool + properties: + allocations: + description: Allocations holds the allocations of nodes to slices + items: + properties: + nodeName: + description: NodeName is the name of the node assigned to this + slice, empty node name is an available slice for assignment + type: string + sliceRange: + description: SliceRange is the subnet of this slice + type: string + required: + - nodeName + - sliceRange + type: object + type: array + required: + - allocations + type: object + type: object + served: true + storage: true diff --git a/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml b/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml index 82d9547d4..f95cdfb8b 100644 --- a/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml +++ b/deployment/whereabouts-chart/crds/whereabouts.cni.cncf.io_overlappingrangeipreservations.yaml @@ -1,9 +1,9 @@ +--- apiVersion: apiextensions.k8s.io/v1 kind: CustomResourceDefinition metadata: annotations: - controller-gen.kubebuilder.io/version: v0.4.1 - creationTimestamp: null + controller-gen.kubebuilder.io/version: v0.14.0 name: overlappingrangeipreservations.whereabouts.cni.cncf.io spec: group: whereabouts.cni.cncf.io @@ -21,14 +21,19 @@ spec: 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' + 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' + 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 @@ -38,19 +43,15 @@ spec: properties: containerid: type: string + ifname: + type: string podref: type: string required: - - containerid + - podref type: object required: - spec type: object served: true storage: true -status: - acceptedNames: - kind: "" - plural: "" - conditions: [] - storedVersions: [] diff --git a/deployment/whereabouts-chart/templates/cluster_role.yaml b/deployment/whereabouts-chart/templates/cluster_role.yaml index 61a732d22..cb97aa931 100644 --- a/deployment/whereabouts-chart/templates/cluster_role.yaml +++ b/deployment/whereabouts-chart/templates/cluster_role.yaml @@ -30,6 +30,13 @@ rules: - get - list - watch +- apiGroups: [""] + resources: + - nodes + verbs: + - get + - list + - watch - apiGroups: ["k8s.cni.cncf.io"] resources: - network-attachment-definitions diff --git a/deployment/whereabouts-chart/templates/node-slice-controller.yaml b/deployment/whereabouts-chart/templates/node-slice-controller.yaml index 889905a61..303b6cef7 100644 --- a/deployment/whereabouts-chart/templates/node-slice-controller.yaml +++ b/deployment/whereabouts-chart/templates/node-slice-controller.yaml @@ -1,3 +1,4 @@ +{{- if .Values.nodeSliceController.enabled }} apiVersion: apps/v1 kind: Deployment metadata: @@ -84,4 +85,5 @@ spec: - fieldRef: apiVersion: v1 fieldPath: metadata.namespace - path: namespace \ No newline at end of file + path: namespace +{{- end}} diff --git a/deployment/whereabouts-chart/values.yaml b/deployment/whereabouts-chart/values.yaml index f632a5568..d241e73f3 100644 --- a/deployment/whereabouts-chart/values.yaml +++ b/deployment/whereabouts-chart/values.yaml @@ -52,3 +52,6 @@ affinity: {} cniConf: confDir: /etc/cni/net.d binDir: /opt/cni/bin + +nodeSliceController: + enabled: true