Skip to content

Commit deac93f

Browse files
committed
operator: introduce nri-plugins operator
Introduce an operator for life-cycle-management of NRI plugins. Users are expected to interact with the operator through PluginConfig namespaced Custom Resource. Signed-off-by: Feruzjon Muyassarov <feruzjon.muyassarov@intel.com>
1 parent b313128 commit deac93f

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2593
-18
lines changed

config/crd/bases/config.nri_nriplugindeployments.yaml

Lines changed: 999 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,270 @@
1+
apiVersion: apiextensions.k8s.io/v1
2+
kind: CustomResourceDefinition
3+
metadata:
4+
annotations:
5+
api-approved.kubernetes.io: https://github.com/kubernetes/enhancements/pull/1870
6+
controller-gen.kubebuilder.io/version: v0.11.2
7+
creationTimestamp: null
8+
name: noderesourcetopologies.topology.node.k8s.io
9+
spec:
10+
group: topology.node.k8s.io
11+
names:
12+
kind: NodeResourceTopology
13+
listKind: NodeResourceTopologyList
14+
plural: noderesourcetopologies
15+
shortNames:
16+
- node-res-topo
17+
singular: noderesourcetopology
18+
scope: Cluster
19+
versions:
20+
- name: v1alpha1
21+
schema:
22+
openAPIV3Schema:
23+
description: NodeResourceTopology describes node resources and their topology.
24+
properties:
25+
apiVersion:
26+
description: 'APIVersion defines the versioned schema of this representation
27+
of an object. Servers should convert recognized schemas to the latest
28+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
29+
type: string
30+
kind:
31+
description: 'Kind is a string value representing the REST resource this
32+
object represents. Servers may infer this from the endpoint the client
33+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
34+
type: string
35+
metadata:
36+
type: object
37+
topologyPolicies:
38+
items:
39+
type: string
40+
type: array
41+
zones:
42+
description: ZoneList contains an array of Zone objects.
43+
items:
44+
description: Zone represents a resource topology zone, e.g. socket,
45+
node, die or core.
46+
properties:
47+
attributes:
48+
description: AttributeList contains an array of AttributeInfo objects.
49+
items:
50+
description: AttributeInfo contains one attribute of a Zone.
51+
properties:
52+
name:
53+
type: string
54+
value:
55+
type: string
56+
required:
57+
- name
58+
- value
59+
type: object
60+
type: array
61+
costs:
62+
description: CostList contains an array of CostInfo objects.
63+
items:
64+
description: CostInfo describes the cost (or distance) between
65+
two Zones.
66+
properties:
67+
name:
68+
type: string
69+
value:
70+
format: int64
71+
type: integer
72+
required:
73+
- name
74+
- value
75+
type: object
76+
type: array
77+
name:
78+
type: string
79+
parent:
80+
type: string
81+
resources:
82+
description: ResourceInfoList contains an array of ResourceInfo
83+
objects.
84+
items:
85+
description: ResourceInfo contains information about one resource
86+
type.
87+
properties:
88+
allocatable:
89+
anyOf:
90+
- type: integer
91+
- type: string
92+
description: Allocatable quantity of the resource, corresponding
93+
to allocatable in node status, i.e. total amount of this
94+
resource available to be used by pods.
95+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
96+
x-kubernetes-int-or-string: true
97+
available:
98+
anyOf:
99+
- type: integer
100+
- type: string
101+
description: Available is the amount of this resource currently
102+
available for new (to be scheduled) pods, i.e. Allocatable
103+
minus the resources reserved by currently running pods.
104+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
105+
x-kubernetes-int-or-string: true
106+
capacity:
107+
anyOf:
108+
- type: integer
109+
- type: string
110+
description: Capacity of the resource, corresponding to capacity
111+
in node status, i.e. total amount of this resource that
112+
the node has.
113+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
114+
x-kubernetes-int-or-string: true
115+
name:
116+
description: Name of the resource.
117+
type: string
118+
required:
119+
- allocatable
120+
- available
121+
- capacity
122+
- name
123+
type: object
124+
type: array
125+
type:
126+
type: string
127+
required:
128+
- name
129+
- type
130+
type: object
131+
type: array
132+
required:
133+
- topologyPolicies
134+
- zones
135+
type: object
136+
served: true
137+
storage: false
138+
- name: v1alpha2
139+
schema:
140+
openAPIV3Schema:
141+
description: NodeResourceTopology describes node resources and their topology.
142+
properties:
143+
apiVersion:
144+
description: 'APIVersion defines the versioned schema of this representation
145+
of an object. Servers should convert recognized schemas to the latest
146+
internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
147+
type: string
148+
attributes:
149+
description: AttributeList contains an array of AttributeInfo objects.
150+
items:
151+
description: AttributeInfo contains one attribute of a Zone.
152+
properties:
153+
name:
154+
type: string
155+
value:
156+
type: string
157+
required:
158+
- name
159+
- value
160+
type: object
161+
type: array
162+
kind:
163+
description: 'Kind is a string value representing the REST resource this
164+
object represents. Servers may infer this from the endpoint the client
165+
submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
166+
type: string
167+
metadata:
168+
type: object
169+
topologyPolicies:
170+
description: 'DEPRECATED (to be removed in v1beta1): use top level attributes
171+
if needed'
172+
items:
173+
type: string
174+
type: array
175+
zones:
176+
description: ZoneList contains an array of Zone objects.
177+
items:
178+
description: Zone represents a resource topology zone, e.g. socket,
179+
node, die or core.
180+
properties:
181+
attributes:
182+
description: AttributeList contains an array of AttributeInfo objects.
183+
items:
184+
description: AttributeInfo contains one attribute of a Zone.
185+
properties:
186+
name:
187+
type: string
188+
value:
189+
type: string
190+
required:
191+
- name
192+
- value
193+
type: object
194+
type: array
195+
costs:
196+
description: CostList contains an array of CostInfo objects.
197+
items:
198+
description: CostInfo describes the cost (or distance) between
199+
two Zones.
200+
properties:
201+
name:
202+
type: string
203+
value:
204+
format: int64
205+
type: integer
206+
required:
207+
- name
208+
- value
209+
type: object
210+
type: array
211+
name:
212+
type: string
213+
parent:
214+
type: string
215+
resources:
216+
description: ResourceInfoList contains an array of ResourceInfo
217+
objects.
218+
items:
219+
description: ResourceInfo contains information about one resource
220+
type.
221+
properties:
222+
allocatable:
223+
anyOf:
224+
- type: integer
225+
- type: string
226+
description: Allocatable quantity of the resource, corresponding
227+
to allocatable in node status, i.e. total amount of this
228+
resource available to be used by pods.
229+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
230+
x-kubernetes-int-or-string: true
231+
available:
232+
anyOf:
233+
- type: integer
234+
- type: string
235+
description: Available is the amount of this resource currently
236+
available for new (to be scheduled) pods, i.e. Allocatable
237+
minus the resources reserved by currently running pods.
238+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
239+
x-kubernetes-int-or-string: true
240+
capacity:
241+
anyOf:
242+
- type: integer
243+
- type: string
244+
description: Capacity of the resource, corresponding to capacity
245+
in node status, i.e. total amount of this resource that
246+
the node has.
247+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
248+
x-kubernetes-int-or-string: true
249+
name:
250+
description: Name of the resource.
251+
type: string
252+
required:
253+
- allocatable
254+
- available
255+
- capacity
256+
- name
257+
type: object
258+
type: array
259+
type:
260+
type: string
261+
required:
262+
- name
263+
- type
264+
type: object
265+
type: array
266+
required:
267+
- zones
268+
type: object
269+
served: true
270+
storage: true

deployment/operator/Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM fedora:latest as build
2+
ENV VERIFY_CHECKSUM=false
3+
RUN curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 \
4+
&& chmod 700 get_helm.sh && ./get_helm.sh
5+
6+
FROM quay.io/operator-framework/ansible-operator:v1.32.0
7+
COPY --from=build /usr/local/bin/helm /usr/local/bin/helm
8+
COPY requirements.yml ${HOME}/requirements.yml
9+
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
10+
&& chmod -R ug+rwx ${HOME}/.ansible
11+
12+
COPY watches.yaml ${HOME}/watches.yaml
13+
COPY ansible.cfg /etc/ansible/ansible.cfg
14+
COPY roles/ ${HOME}/roles/
15+
COPY playbooks/ ${HOME}/playbooks/

0 commit comments

Comments
 (0)