diff --git a/gremlin-integrations/Chart.yaml b/gremlin-integrations/Chart.yaml index fb904ff..a3b0dac 100644 --- a/gremlin-integrations/Chart.yaml +++ b/gremlin-integrations/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.1.1 +version: 0.1.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/gremlin-integrations/templates/deployment.yaml b/gremlin-integrations/templates/deployment.yaml index 5175232..79e2492 100644 --- a/gremlin-integrations/templates/deployment.yaml +++ b/gremlin-integrations/templates/deployment.yaml @@ -32,6 +32,8 @@ spec: {{- toYaml .Values.securityContext | nindent 12 }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} + resources: +{{- toYaml .Values.gremlin.resources | nindent 12 }} env: - name: GREMLIN_TEAM_ID {{- /* If we aren't managing this secret and a teamID was supplied, assume teamID is not in the external secret */}} diff --git a/gremlin-integrations/tests/resources_test.yaml b/gremlin-integrations/tests/resources_test.yaml new file mode 100644 index 0000000..440be02 --- /dev/null +++ b/gremlin-integrations/tests/resources_test.yaml @@ -0,0 +1,33 @@ +suite: "Gremlin Resources Tests" +templates: + - "templates/deployment.yaml" + +tests: + - it: "should render resources when gremlin.resources is set" + set: + gremlin.resources.limits.cpu: "200m" + gremlin.resources.limits.memory: "256Mi" + gremlin.resources.requests.cpu: "100m" + gremlin.resources.requests.memory: "128Mi" + asserts: + - equal: + path: "spec.template.spec.containers[0].resources.limits.cpu" + value: "200m" + - equal: + path: "spec.template.spec.containers[0].resources.limits.memory" + value: "256Mi" + - equal: + path: "spec.template.spec.containers[0].resources.requests.cpu" + value: "100m" + - equal: + path: "spec.template.spec.containers[0].resources.requests.memory" + value: "128Mi" + + - it: "should set resources to empty map when gremlin.resources is empty" + set: + gremlin.resources: {} + asserts: + - equal: + path: "spec.template.spec.containers[0].resources" + value: {} + diff --git a/gremlin-integrations/values.yaml b/gremlin-integrations/values.yaml index c1ebd2c..9ce7463 100644 --- a/gremlin-integrations/values.yaml +++ b/gremlin-integrations/values.yaml @@ -30,7 +30,6 @@ podSecurityContext: { } securityContext: { } -resources: { } nodeSelector: { } tolerations: [ ] @@ -49,6 +48,13 @@ ssl: certDir: gremlin: + # gremlin.resources - + # Set resource requests and limits + # See: https://kubernetes.io/docs/concepts/configuration/manage-resources-containers + # + # NOTE: This resource specification affects the Gremlin agent which is used for host attacks. This resource + # Attacks targeting other Kubernetes pods will use the resource specification of their target. + resources: {} secret: # Gremlin supports both `certificate` and `secret` types # To manage secrets with helm, set `managed=true` and fill in either the certificate auth or secret auth sections