Skip to content

Commit

Permalink
no default resource requirements (#309)
Browse files Browse the repository at this point in the history
* no default resource requirements

* Automated commit: update images.
  • Loading branch information
sroettger authored Jun 29, 2021
1 parent 533b570 commit 6a59222
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 12 deletions.
2 changes: 1 addition & 1 deletion dist/resources/operator.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ spec:
serviceAccountName: kctf-operator
containers:
- name: kctf-operator
image: gcr.io/kctf-docker/kctf-operator@sha256:fc7fde30c7922e9229d8bb5b694d885ab49f545883f94dc875ca603f55a66ad2
image: gcr.io/kctf-docker/kctf-operator@sha256:d049545f2a0a23e37eede433800161831b7ec61c3cc8309ed4b4ec24124df47d
command:
- kctf-operator
imagePullPolicy: Always
Expand Down
12 changes: 1 addition & 11 deletions kctf-operator/pkg/controller/challenge/deployment/deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import (
utils "github.com/google/kctf/pkg/controller/challenge/utils"
appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1"
resource "k8s.io/apimachinery/pkg/api/resource"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

Expand Down Expand Up @@ -70,19 +69,10 @@ func deployment(challenge *kctfv1.Challenge) *appsv1.Deployment {
if deployment.Spec.Template.Spec.Containers[idx_challenge].SecurityContext.Capabilities == nil {
deployment.Spec.Template.Spec.Containers[idx_challenge].SecurityContext.Capabilities = &corev1.Capabilities{};
}

deployment.Spec.Template.Spec.Containers[idx_challenge].SecurityContext.Capabilities.Add =
append(deployment.Spec.Template.Spec.Containers[idx_challenge].SecurityContext.Capabilities.Add, "SYS_ADMIN")

deployment.Spec.Template.Spec.Containers[idx_challenge].Resources = corev1.ResourceRequirements{
Limits: corev1.ResourceList{
"cpu": *resource.NewMilliQuantity(900, resource.DecimalSI),
},
Requests: corev1.ResourceList{
"cpu": *resource.NewMilliQuantity(450, resource.DecimalSI),
},
}

volumeMounts := []corev1.VolumeMount{
{
Name: "pow",
Expand Down

0 comments on commit 6a59222

Please sign in to comment.