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
2 changes: 1 addition & 1 deletion gremlin-integrations/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions gremlin-integrations/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 */}}
Expand Down
33 changes: 33 additions & 0 deletions gremlin-integrations/tests/resources_test.yaml
Original file line number Diff line number Diff line change
@@ -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: {}

8 changes: 7 additions & 1 deletion gremlin-integrations/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ podSecurityContext: { }

securityContext: { }

resources: { }
nodeSelector: { }

tolerations: [ ]
Expand All @@ -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
Expand Down