Skip to content

Commit

Permalink
feat: Remove Ressources limits
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord committed Jan 19, 2023
1 parent 474d983 commit 60db800
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 28 deletions.
13 changes: 6 additions & 7 deletions controllers/components/auth_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ import (
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -176,12 +175,12 @@ func (r *Mutator) reconcileDeployment(ctx context.Context, auth *componentsv1bet
Env: env,
LivenessProbe: controllerutils.DefaultLiveness(),
ImagePullPolicy: controllerutils.ImagePullPolicy(auth.Spec),
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
},
},
//Resources: corev1.ResourceRequirements{
// Limits: corev1.ResourceList{
// corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
// corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
// },
//},
VolumeMounts: []corev1.VolumeMount{{
Name: "config",
ReadOnly: true,
Expand Down
13 changes: 6 additions & 7 deletions controllers/components/control_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import (
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -128,12 +127,12 @@ func (m *ControlMutator) reconcileDeployment(ctx context.Context, control *compo
Name: "http",
ContainerPort: 3000,
}},
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
},
},
//Resources: corev1.ResourceRequirements{
// Limits: corev1.ResourceList{
// corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
// corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
// },
//},
}},
},
},
Expand Down
13 changes: 6 additions & 7 deletions controllers/components/ledger_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/util/intstr"
Expand Down Expand Up @@ -154,12 +153,12 @@ func (r *LedgerMutator) reconcileDeployment(ctx context.Context, ledger *compone
FailureThreshold: 10,
TerminationGracePeriodSeconds: pointer.Int64(10),
},
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
},
},
//Resources: corev1.ResourceRequirements{
// Limits: corev1.ResourceList{
// corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
// corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
// },
//},
}},
},
},
Expand Down
13 changes: 6 additions & 7 deletions controllers/components/search_mutator.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ import (
corev1 "k8s.io/api/core/v1"
networkingv1 "k8s.io/api/networking/v1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/runtime"
"k8s.io/apimachinery/pkg/types"
Expand Down Expand Up @@ -149,12 +148,12 @@ func (r *SearchMutator) reconcileDeployment(ctx context.Context, search *compone
ContainerPort: 8080,
}},
LivenessProbe: controllerutils.DefaultLiveness(),
Resources: corev1.ResourceRequirements{
Limits: corev1.ResourceList{
corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
},
},
//Resources: corev1.ResourceRequirements{
// Limits: corev1.ResourceList{
// corev1.ResourceCPU: *resource.NewMilliQuantity(500, resource.DecimalSI),
// corev1.ResourceMemory: *resource.NewMilliQuantity(1024, resource.DecimalSI),
// },
//},
}},
},
},
Expand Down

0 comments on commit 60db800

Please sign in to comment.