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
23 changes: 23 additions & 0 deletions docs/pages/reference/helm-reference/teleport-cluster.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2322,6 +2322,29 @@ See [the GitHub PR](https://github.com/gravitational/teleport/pull/36251) for te
cpu: 1
memory: 2Gi
```

## `jobResources`

| Type | Default value |
|----------|---------------|
| `object` | `{}` |

[Kubernetes reference](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)

Resource requests/limits which should be configured for pre-deploy jobs.

Jobs currently include config validation and potentially migration hooks.
The resource requirements are typically lower than for the main teleport deployment.
In most cases, you should leave these limits unset.

`values.yaml` example:

```yaml
jobResources:
requests:
cpu: 1
memory: 2Gi
```
## `goMemLimitRatio`

| Type | Default |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ spec:
- name: "teleport-config-check"
image: '{{ if $auth.enterprise }}{{ $auth.enterpriseImage }}{{ else }}{{ $auth.image }}{{ end }}:{{ include "teleport-cluster.version" . }}'
imagePullPolicy: {{ $auth.imagePullPolicy }}
{{- if $auth.jobResources }}
resources:
{{- toYaml $auth.jobResources | nindent 10 }}
{{- end }}
{{- if or $auth.extraEnv $auth.tls.existingCASecretName }}
env:
{{- if (gt (len $auth.extraEnv) 0) }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ spec:
- name: "teleport"
image: '{{ if $proxy.enterprise }}{{ $proxy.enterpriseImage }}{{ else }}{{ $proxy.image }}{{ end }}:{{ include "teleport-cluster.version" . }}'
imagePullPolicy: {{ $proxy.imagePullPolicy }}
{{- if $proxy.jobResources }}
resources:
{{- toYaml $proxy.jobResources | nindent 10 }}
{{- end }}
{{- if or $proxy.extraEnv $proxy.tls.existingCASecretName }}
env:
{{- if (gt (len $proxy.extraEnv) 0) }}
Expand Down
49 changes: 47 additions & 2 deletions examples/chart/teleport-cluster/tests/predeploy_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,66 @@ tests:
- hasDocuments:
count: 0

- it: should not set resources on auth predeploy job when set in values
- it: should not set resources on auth predeploy job when resources set in values
template: auth/predeploy_job.yaml
values:
- ../.lint/resources.yaml
asserts:
- isEmpty:
path: spec.template.spec.containers[0].resources
- it: should not set resources on proxy predeploy job when set in values

- it: should not set resources on proxy predeploy job when resources set in values
template: proxy/predeploy_job.yaml
values:
- ../.lint/resources.yaml
asserts:
- isEmpty:
path: spec.template.spec.containers[0].resources

- it: should set resources on auth predeploy job when jobResources set in values
template: auth/predeploy_job.yaml
values:
- ../.lint/resources.yaml
set:
jobResources:
limits:
memory: 512Mi
requests:
memory: 512Mi
cpu: 1
asserts:
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 512Mi
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 1
- equal:
path: spec.template.spec.containers[0].resources.requests.memory
value: 512Mi

- it: should set resources on proxy predeploy job when jobResources set in values
template: proxy/predeploy_job.yaml
values:
- ../.lint/resources.yaml
set:
jobResources:
limits:
memory: 512Mi
requests:
memory: 512Mi
cpu: 1
asserts:
- equal:
path: spec.template.spec.containers[0].resources.limits.memory
value: 512Mi
- equal:
path: spec.template.spec.containers[0].resources.requests.cpu
value: 1
- equal:
path: spec.template.spec.containers[0].resources.requests.memory
value: 512Mi

- it: should set imagePullSecrets on proxy predeploy job when set in values
template: proxy/predeploy_job.yaml
values:
Expand Down
13 changes: 13 additions & 0 deletions examples/chart/teleport-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,19 @@ resources: {}
# limits:
# memory: "2Gi"

# Resources to request for the teleport pre-deploy jobs.
# https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/
#
# Jobs currently include config validation and potentially migration hooks.
# The resource requirements are typically lower than for the main teleport deployment.
# In most cases, you should leave these limits unset.
jobResources: {}
# requests:
# cpu: "20m"
# memory: "500Mi"
# limits:
# memory: "500Mi"

# goMemLimitRatio configures the GOMEMLIMIT env var set by the chart.
# GOMEMLIMIT instructs the go garbage collector to try to keep allocated memory
# below a given threshold. This is a best-effort attempt, but this helps
Expand Down
Loading