Skip to content

Commit 94dda0b

Browse files
Merge pull request #447 from cschwede/fix-missing-resources
Add missing resources for swiftStorage and swiftProxy pods
2 parents 83ae4fc + 749251a commit 94dda0b

12 files changed

Lines changed: 508 additions & 1 deletion

api/bases/swift.openstack.org_swiftproxies.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,67 @@ spec:
300300
format: int32
301301
minimum: 0
302302
type: integer
303+
resources:
304+
description: |-
305+
Resources - Compute Resources required by this service (Limits/Requests).
306+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
307+
properties:
308+
claims:
309+
description: |-
310+
Claims lists the names of resources, defined in spec.resourceClaims,
311+
that are used by this container.
312+
313+
This is an alpha field and requires enabling the
314+
DynamicResourceAllocation feature gate.
315+
316+
This field is immutable. It can only be set for containers.
317+
items:
318+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
319+
properties:
320+
name:
321+
description: |-
322+
Name must match the name of one entry in pod.spec.resourceClaims of
323+
the Pod where this field is used. It makes that resource available
324+
inside a container.
325+
type: string
326+
request:
327+
description: |-
328+
Request is the name chosen for a request in the referenced claim.
329+
If empty, everything from the claim is made available, otherwise
330+
only the result of this request.
331+
type: string
332+
required:
333+
- name
334+
type: object
335+
type: array
336+
x-kubernetes-list-map-keys:
337+
- name
338+
x-kubernetes-list-type: map
339+
limits:
340+
additionalProperties:
341+
anyOf:
342+
- type: integer
343+
- type: string
344+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
345+
x-kubernetes-int-or-string: true
346+
description: |-
347+
Limits describes the maximum amount of compute resources allowed.
348+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
349+
type: object
350+
requests:
351+
additionalProperties:
352+
anyOf:
353+
- type: integer
354+
- type: string
355+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
356+
x-kubernetes-int-or-string: true
357+
description: |-
358+
Requests describes the minimum amount of compute resources required.
359+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
360+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
361+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
362+
type: object
363+
type: object
303364
ringConfigMaps:
304365
default:
305366
- swift-ring-files

api/bases/swift.openstack.org_swifts.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,67 @@ spec:
334334
format: int32
335335
minimum: 0
336336
type: integer
337+
resources:
338+
description: |-
339+
Resources - Compute Resources required by this service (Limits/Requests).
340+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
341+
properties:
342+
claims:
343+
description: |-
344+
Claims lists the names of resources, defined in spec.resourceClaims,
345+
that are used by this container.
346+
347+
This is an alpha field and requires enabling the
348+
DynamicResourceAllocation feature gate.
349+
350+
This field is immutable. It can only be set for containers.
351+
items:
352+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
353+
properties:
354+
name:
355+
description: |-
356+
Name must match the name of one entry in pod.spec.resourceClaims of
357+
the Pod where this field is used. It makes that resource available
358+
inside a container.
359+
type: string
360+
request:
361+
description: |-
362+
Request is the name chosen for a request in the referenced claim.
363+
If empty, everything from the claim is made available, otherwise
364+
only the result of this request.
365+
type: string
366+
required:
367+
- name
368+
type: object
369+
type: array
370+
x-kubernetes-list-map-keys:
371+
- name
372+
x-kubernetes-list-type: map
373+
limits:
374+
additionalProperties:
375+
anyOf:
376+
- type: integer
377+
- type: string
378+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
379+
x-kubernetes-int-or-string: true
380+
description: |-
381+
Limits describes the maximum amount of compute resources allowed.
382+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
383+
type: object
384+
requests:
385+
additionalProperties:
386+
anyOf:
387+
- type: integer
388+
- type: string
389+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
390+
x-kubernetes-int-or-string: true
391+
description: |-
392+
Requests describes the minimum amount of compute resources required.
393+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
394+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
395+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
396+
type: object
397+
type: object
337398
ringConfigMaps:
338399
default:
339400
- swift-ring-files
@@ -514,6 +575,67 @@ spec:
514575
format: int32
515576
minimum: 0
516577
type: integer
578+
resources:
579+
description: |-
580+
Resources - Compute Resources required by this service (Limits/Requests).
581+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
582+
properties:
583+
claims:
584+
description: |-
585+
Claims lists the names of resources, defined in spec.resourceClaims,
586+
that are used by this container.
587+
588+
This is an alpha field and requires enabling the
589+
DynamicResourceAllocation feature gate.
590+
591+
This field is immutable. It can only be set for containers.
592+
items:
593+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
594+
properties:
595+
name:
596+
description: |-
597+
Name must match the name of one entry in pod.spec.resourceClaims of
598+
the Pod where this field is used. It makes that resource available
599+
inside a container.
600+
type: string
601+
request:
602+
description: |-
603+
Request is the name chosen for a request in the referenced claim.
604+
If empty, everything from the claim is made available, otherwise
605+
only the result of this request.
606+
type: string
607+
required:
608+
- name
609+
type: object
610+
type: array
611+
x-kubernetes-list-map-keys:
612+
- name
613+
x-kubernetes-list-type: map
614+
limits:
615+
additionalProperties:
616+
anyOf:
617+
- type: integer
618+
- type: string
619+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
620+
x-kubernetes-int-or-string: true
621+
description: |-
622+
Limits describes the maximum amount of compute resources allowed.
623+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
624+
type: object
625+
requests:
626+
additionalProperties:
627+
anyOf:
628+
- type: integer
629+
- type: string
630+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
631+
x-kubernetes-int-or-string: true
632+
description: |-
633+
Requests describes the minimum amount of compute resources required.
634+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
635+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
636+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
637+
type: object
638+
type: object
517639
ringConfigMaps:
518640
default:
519641
- swift-ring-files

api/bases/swift.openstack.org_swiftstorages.yaml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,67 @@ spec:
9696
format: int32
9797
minimum: 0
9898
type: integer
99+
resources:
100+
description: |-
101+
Resources - Compute Resources required by this service (Limits/Requests).
102+
https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
103+
properties:
104+
claims:
105+
description: |-
106+
Claims lists the names of resources, defined in spec.resourceClaims,
107+
that are used by this container.
108+
109+
This is an alpha field and requires enabling the
110+
DynamicResourceAllocation feature gate.
111+
112+
This field is immutable. It can only be set for containers.
113+
items:
114+
description: ResourceClaim references one entry in PodSpec.ResourceClaims.
115+
properties:
116+
name:
117+
description: |-
118+
Name must match the name of one entry in pod.spec.resourceClaims of
119+
the Pod where this field is used. It makes that resource available
120+
inside a container.
121+
type: string
122+
request:
123+
description: |-
124+
Request is the name chosen for a request in the referenced claim.
125+
If empty, everything from the claim is made available, otherwise
126+
only the result of this request.
127+
type: string
128+
required:
129+
- name
130+
type: object
131+
type: array
132+
x-kubernetes-list-map-keys:
133+
- name
134+
x-kubernetes-list-type: map
135+
limits:
136+
additionalProperties:
137+
anyOf:
138+
- type: integer
139+
- type: string
140+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
141+
x-kubernetes-int-or-string: true
142+
description: |-
143+
Limits describes the maximum amount of compute resources allowed.
144+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
145+
type: object
146+
requests:
147+
additionalProperties:
148+
anyOf:
149+
- type: integer
150+
- type: string
151+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
152+
x-kubernetes-int-or-string: true
153+
description: |-
154+
Requests describes the minimum amount of compute resources required.
155+
If Requests is omitted for a container, it defaults to Limits if that is explicitly specified,
156+
otherwise to an implementation-defined value. Requests cannot exceed Limits.
157+
More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
158+
type: object
159+
type: object
99160
ringConfigMaps:
100161
default:
101162
- swift-ring-files

api/go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ go 1.24.4
55
require (
66
github.com/openstack-k8s-operators/infra-operator/apis v0.6.1-0.20260212124933-d2541a526cd3
77
github.com/openstack-k8s-operators/lib-common/modules/common v0.6.1-0.20260205083029-d03e9df035ef
8+
k8s.io/api v0.31.14
89
k8s.io/apimachinery v0.31.14
910
sigs.k8s.io/controller-runtime v0.19.7
1011
)
@@ -59,7 +60,6 @@ require (
5960
google.golang.org/protobuf v1.36.7 // indirect
6061
gopkg.in/inf.v0 v0.9.1 // indirect
6162
gopkg.in/yaml.v3 v3.0.1 // indirect
62-
k8s.io/api v0.31.14 // indirect
6363
k8s.io/apiextensions-apiserver v0.33.2 // indirect
6464
k8s.io/client-go v0.31.14 // indirect
6565
k8s.io/klog/v2 v2.130.1 // indirect

api/v1beta1/swiftproxy_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
corev1 "k8s.io/api/core/v1"
2021
rabbitmqv1 "github.com/openstack-k8s-operators/infra-operator/apis/rabbitmq/v1beta1"
2122
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
2223
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
@@ -76,6 +77,11 @@ type SwiftProxySpecCore struct {
7677
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
7778
NetworkAttachments []string `json:"networkAttachments,omitempty"`
7879

80+
// +kubebuilder:validation:Optional
81+
// Resources - Compute Resources required by this service (Limits/Requests).
82+
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
83+
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
84+
7985
// +kubebuilder:validation:Required
8086
// +kubebuilder:default=memcached
8187
// Memcached instance name.

api/v1beta1/swiftstorage_types.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ limitations under the License.
1717
package v1beta1
1818

1919
import (
20+
corev1 "k8s.io/api/core/v1"
2021
condition "github.com/openstack-k8s-operators/lib-common/modules/common/condition"
2122
"github.com/openstack-k8s-operators/lib-common/modules/common/tls"
2223
topologyv1 "github.com/openstack-k8s-operators/infra-operator/apis/topology/v1beta1"
@@ -74,6 +75,11 @@ type SwiftStorageSpecCore struct {
7475
// NetworkAttachments is a list of NetworkAttachment resource names to expose the services to the given network
7576
NetworkAttachments []string `json:"networkAttachments,omitempty"`
7677

78+
// +kubebuilder:validation:Optional
79+
// Resources - Compute Resources required by this service (Limits/Requests).
80+
// https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
81+
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
82+
7783
// +kubebuilder:validation:Required
7884
// +kubebuilder:default=memcached
7985
// Memcached instance name.

api/v1beta1/zz_generated.deepcopy.go

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)