Skip to content
Merged
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
3 changes: 0 additions & 3 deletions api/install/v1alpha1/executor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ package v1alpha1

import (
corev1 "k8s.io/api/core/v1"
schedulingv1 "k8s.io/api/scheduling/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -56,8 +55,6 @@ type ExecutorSpec struct {
NodeSelector map[string]string `json:"nodeSelector,omitempty"`
// Additional ClusterRoleBindings which will be created
AdditionalClusterRoleBindings []AdditionalClusterRoleBinding `json:"additionalClusterRoleBindings,omitempty"`
// List of PriorityClasses which will be created
PriorityClasses []*schedulingv1.PriorityClass `json:"priorityClasses,omitempty"`
// SecurityContext defines the security options the container should be run with
SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"`
// PodSecurityContext defines the security options the pod should be run with
Expand Down
12 changes: 0 additions & 12 deletions api/install/v1alpha1/zz_generated.deepcopy.go

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

56 changes: 0 additions & 56 deletions charts/armada-operator/crds/executor-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2299,62 +2299,6 @@ spec:
type: string
type: object
type: object
priorityClasses:
description: List of PriorityClasses which will be created
items:
description: |-
PriorityClass defines mapping from a priority class name to the priority
integer value. The value can be any valid integer.
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
description:
description: |-
description is an arbitrary string that usually provides guidelines on
when this priority class should be used.
type: string
globalDefault:
description: |-
globalDefault specifies whether this PriorityClass should be considered as
the default priority for pods that do not have any priority class.
Only one PriorityClass can be marked as `globalDefault`. However, if more than
one PriorityClasses exists with their `globalDefault` field set to true,
the smallest value of such global default PriorityClasses will be used as the default priority.
type: boolean
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:
description: |-
Standard object's metadata.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
type: object
preemptionPolicy:
description: |-
preemptionPolicy is the Policy for preempting pods with lower priority.
One of Never, PreemptLowerPriority.
Defaults to PreemptLowerPriority if unset.
type: string
value:
description: |-
value represents the integer value of this priority class. This is the actual priority that pods
receive when they have the name of this class in their pod spec.
format: int32
type: integer
required:
- value
type: object
type: array
profilingIngressConfig:
description: ProfilingIngressConfig defines configuration for the
profiling Ingress resource
Expand Down
56 changes: 0 additions & 56 deletions config/crd/bases/install.armadaproject.io_executors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2289,62 +2289,6 @@ spec:
type: string
type: object
type: object
priorityClasses:
description: List of PriorityClasses which will be created
items:
description: |-
PriorityClass defines mapping from a priority class name to the priority
integer value. The value can be any valid integer.
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
description:
description: |-
description is an arbitrary string that usually provides guidelines on
when this priority class should be used.
type: string
globalDefault:
description: |-
globalDefault specifies whether this PriorityClass should be considered as
the default priority for pods that do not have any priority class.
Only one PriorityClass can be marked as `globalDefault`. However, if more than
one PriorityClasses exists with their `globalDefault` field set to true,
the smallest value of such global default PriorityClasses will be used as the default priority.
type: boolean
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:
description: |-
Standard object's metadata.
More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata
type: object
preemptionPolicy:
description: |-
preemptionPolicy is the Policy for preempting pods with lower priority.
One of Never, PreemptLowerPriority.
Defaults to PreemptLowerPriority if unset.
type: string
value:
description: |-
value represents the integer value of this priority class. This is the actual priority that pods
receive when they have the name of this class in their pod spec.
format: int32
type: integer
required:
- value
type: object
type: array
profilingIngressConfig:
description: ProfilingIngressConfig defines configuration for the
profiling Ingress resource
Expand Down
1 change: 0 additions & 1 deletion dev/crd/out.md
Original file line number Diff line number Diff line change
Expand Up @@ -472,7 +472,6 @@ _Appears in:_
| `replicas` _integer_ | Replicas is the number of replicated instances for Executor | | |
| `nodeSelector` _object (keys:string, values:string)_ | NodeSelector restricts the Executor pod to run on nodes matching the configured selectors | | |
| `additionalClusterRoleBindings` _[AdditionalClusterRoleBinding](#additionalclusterrolebinding) array_ | Additional ClusterRoleBindings which will be created | | |
| `priorityClasses` _[PriorityClass](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#priorityclass-v1-scheduling) array_ | List of PriorityClasses which will be created | | |
| `securityContext` _[SecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#securitycontext-v1-core)_ | SecurityContext defines the security options the container should be run with | | |
| `podSecurityContext` _[PodSecurityContext](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.29/#podsecuritycontext-v1-core)_ | PodSecurityContext defines the security options the pod should be run with | | |
| `profilingIngressConfig` _[IngressConfig](#ingressconfig)_ | ProfilingIngressConfig defines configuration for the profiling Ingress resource | | |
Expand Down
16 changes: 0 additions & 16 deletions internal/controller/install/common_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ import (

monitoringv1 "github.com/prometheus-operator/prometheus-operator/pkg/apis/monitoring/v1"

schedulingv1 "k8s.io/api/scheduling/v1"

appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
Expand Down Expand Up @@ -61,7 +59,6 @@ type CommonComponents struct {
Secret *corev1.Secret
ClusterRole *rbacv1.ClusterRole
ClusterRoleBindings []*rbacv1.ClusterRoleBinding
PriorityClasses []*schedulingv1.PriorityClass
PrometheusRule *monitoringv1.PrometheusRule
ServiceMonitor *monitoringv1.ServiceMonitor
PodDisruptionBudget *policyv1.PodDisruptionBudget
Expand All @@ -78,10 +75,6 @@ func (cc *CommonComponents) DeepCopy() *CommonComponents {
for _, crb := range cc.ClusterRoleBindings {
clusterRoleBindings = append(clusterRoleBindings, crb.DeepCopy())
}
var priorityClasses []*schedulingv1.PriorityClass
for _, pc := range cc.PriorityClasses {
priorityClasses = append(priorityClasses, pc.DeepCopy())
}
var jobs []*batchv1.Job
for _, job := range cc.Jobs {
jobs = append(jobs, job.DeepCopy())
Expand All @@ -95,7 +88,6 @@ func (cc *CommonComponents) DeepCopy() *CommonComponents {
Secret: cc.Secret.DeepCopy(),
ClusterRole: cc.ClusterRole.DeepCopy(),
ClusterRoleBindings: clusterRoleBindings,
PriorityClasses: priorityClasses,
Jobs: jobs,
CronJob: cc.CronJob.DeepCopy(),
ServiceMonitor: cc.ServiceMonitor.DeepCopy(),
Expand Down Expand Up @@ -190,14 +182,6 @@ func (cc *CommonComponents) ReconcileComponents(newComponents *CommonComponents)
cc.ClusterRoleBindings[i].Labels = newComponents.ClusterRoleBindings[i].Labels
cc.ClusterRoleBindings[i].Annotations = newComponents.ClusterRoleBindings[i].Annotations
}
for i := range cc.PriorityClasses {
cc.PriorityClasses[i].PreemptionPolicy = newComponents.PriorityClasses[i].PreemptionPolicy
cc.PriorityClasses[i].Value = newComponents.PriorityClasses[i].Value
cc.PriorityClasses[i].Description = newComponents.PriorityClasses[i].Description
cc.PriorityClasses[i].GlobalDefault = newComponents.PriorityClasses[i].GlobalDefault
cc.PriorityClasses[i].Labels = newComponents.PriorityClasses[i].Labels
cc.PriorityClasses[i].Annotations = newComponents.PriorityClasses[i].Annotations
}

if newComponents.CronJob != nil {
cc.CronJob.Spec = newComponents.CronJob.Spec
Expand Down
14 changes: 3 additions & 11 deletions internal/controller/install/common_helpers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import (
appsv1 "k8s.io/api/apps/v1"
batchv1 "k8s.io/api/batch/v1"
corev1 "k8s.io/api/core/v1"
schedulingv1 "k8s.io/api/scheduling/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
Expand Down Expand Up @@ -650,8 +649,6 @@ func TestDeepCopy(t *testing.T) {
expectations: func(t *testing.T, old, new CommonComponents) {
assert.EqualValues(t, old.Deployment, new.Deployment)
assert.NotSame(t, old.Deployment, new.Deployment)
assert.Equal(t, len(old.PriorityClasses), len(new.PriorityClasses))
assert.NotSame(t, &old.PriorityClasses, &new.PriorityClasses)
assert.Equal(t, old, new)
assert.NotSame(t, &old, &new)
},
Expand Down Expand Up @@ -791,18 +788,13 @@ func makeCommonComponents() CommonComponents {
AutomountServiceAccountToken: &automountServiceAccountToken,
}

pc := schedulingv1.PriorityClass{
Value: 1000,
}

secret := corev1.Secret{
StringData: map[string]string{"secretkey": "secretval"},
}
return CommonComponents{
Deployment: &deployment,
ServiceAccount: &serviceAccount,
PriorityClasses: []*schedulingv1.PriorityClass{&pc},
Secret: &secret,
Deployment: &deployment,
ServiceAccount: &serviceAccount,
Secret: &secret,
}
}

Expand Down
14 changes: 0 additions & 14 deletions internal/controller/install/executor_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,6 @@ func (r *ExecutorReconciler) Reconcile(ctx context.Context, req ctrl.Request) (c
return ctrl.Result{}, err
}

for _, pc := range components.PriorityClasses {
if err := upsertObjectIfNeeded(ctx, r.Client, pc, executor.Kind, mutateFn, logger); err != nil {
return ctrl.Result{}, err
}
}

if err := upsertObjectIfNeeded(ctx, r.Client, components.PrometheusRule, executor.Kind, mutateFn, logger); err != nil {
return ctrl.Result{}, err
}
Expand Down Expand Up @@ -222,7 +216,6 @@ func (r *ExecutorReconciler) generateExecutorInstallComponents(
ServiceAccount: serviceAccount,
Secret: secret,
ClusterRoleBindings: clusterRoleBindings,
PriorityClasses: executor.Spec.PriorityClasses,
ClusterRole: clusterRole,
ServiceProfiling: profilingService,
IngressProfiling: profilingIngress,
Expand Down Expand Up @@ -514,13 +507,6 @@ func (r *ExecutorReconciler) deleteExternalResources(ctx context.Context, compon
logger.Info("Successfully deleted Executor ClusterRoleBinding", "name", crb.Name)
}

for _, pc := range components.PriorityClasses {
if err := r.Delete(ctx, pc); err != nil && !k8serrors.IsNotFound(err) {
return errors.Wrapf(err, "error deleting ClusterRoleBinding %s", pc.Name)
}
logger.Info("Successfully deleted Executor PriorityClass", "name", pc.Name)
}

return nil
}

Expand Down
Loading