env0 / k8s-modules

3 stars 2 forks source link

Chore: Adding resource limits to nfs server #10

Closed avnerenv0 closed 2 years ago

avnerenv0 commented 2 years ago

We got some feedback about not providing resource limits on the nfs server pod, which is standard and best practice for k8s.

Checked our GKE cluster for resource usage and added these limits with some safety margin.

env0-dev[bot] commented 2 years ago

🚀  env0 had composed a PR Plan for environment Google Cloud - Kusheild agent / Google Cloud - Modules:

Plan: 0 to add, 1 to change, 0 to destroy.
Plan Details ``` Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols: ~ update in-place Terraform will perform the following actions: # module.pd_backed_nfs_server.kubectl_manifest.nfs_server_deployment["deployment"] will be updated in-place ~ resource "kubectl_manifest" "nfs_server_deployment" { id = "/apis/apps/v1/namespaces/env0-agent/deployments/env0-nfs-server" name = "env0-nfs-server" ~ yaml_body = (sensitive value) ~ yaml_body_parsed = <<-EOT apiVersion: apps/v1 kind: Deployment metadata: name: env0-nfs-server namespace: env0-agent spec: replicas: 1 selector: matchLabels: role: env0-nfs-server template: metadata: labels: role: env0-nfs-server spec: containers: - image: gcr.io/google_containers/volume-nfs:0.8 name: nfs-server ports: - containerPort: 2049 name: nfs - containerPort: 20048 name: mountd - containerPort: 111 name: rpcbind + resources: + limits: + cpu: 250m + memory: 1000Mi securityContext: privileged: true volumeMounts: - mountPath: /data name: nfs-pvc nodeSelector: topology.kubernetes.io/zone: us-central1-a volumes: - name: nfs-pvc persistentVolumeClaim: claimName: env0-pvc-for-nfs-server EOT # (11 unchanged attributes hidden) } Plan: 0 to add, 1 to change, 0 to destroy. ```

Full Plan Logs on env0

avnerenv0 commented 2 years ago

Add resource limit+request to all our k8s deployments