Skip to content
This repository was archived by the owner on Nov 28, 2024. It is now read-only.

Make AEE containers resources configurable #360

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions api/bases/ansibleee.openstack.org_openstackansibleees.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,37 @@ spec:
- true
- false
type: boolean
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
default: Never
enum:
Expand Down
4 changes: 4 additions & 0 deletions api/v1beta1/openstack_ansibleee_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ type OpenStackAnsibleEESpec struct {
// +kubebuilder:validation:Optional
// InitContainers allows the passing of an array of containers that will be executed before the ansibleee execution itself
InitContainers []corev1.Container `json:"initContainers,omitempty"`
// Compute Resources required by this ansibleee job.
// More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
// +kubebuilder:validation:Optional
Resources corev1.ResourceRequirements `json:"resources,omitempty"`
// +kubebuilder:validation:Optional
// ServiceAccountName allows to specify what ServiceAccountName do we want the ansible execution run with. Without specifying,
// it will run with default serviceaccount
Expand Down
1 change: 1 addition & 0 deletions api/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 31 additions & 0 deletions config/crd/bases/ansibleee.openstack.org_openstackansibleees.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1530,6 +1530,37 @@ spec:
- true
- false
type: boolean
resources:
properties:
claims:
items:
properties:
name:
type: string
required:
- name
type: object
type: array
x-kubernetes-list-map-keys:
- name
x-kubernetes-list-type: map
limits:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
requests:
additionalProperties:
anyOf:
- type: integer
- type: string
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
type: object
type: object
restartPolicy:
default: Never
enum:
Expand Down
1 change: 1 addition & 0 deletions controllers/openstack_ansibleee_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,7 @@ func (r *OpenStackAnsibleEEReconciler) jobForOpenStackAnsibleEE(ctx context.Cont
Name: instance.Spec.Name,
Args: args,
Env: instance.Spec.Env,
Resources: instance.Spec.Resources,
}},
}

Expand Down
5 changes: 5 additions & 0 deletions docs/assemblies/openstack_ansibleee.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,11 @@ OpenStackAnsibleEESpec defines the desired state of OpenStackAnsibleEE
| []corev1.Container
| false

| resources
| Compute Resources required by this ansibleee job. More info: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
| corev1.ResourceRequirements
| false

| serviceAccountName
| ServiceAccountName allows to specify what ServiceAccountName do we want the ansible execution run with. Without specifying, it will run with default serviceaccount
| string
Expand Down
Loading