Skip to content

Commit

Permalink
Backport of Net 10114 consul is under resourced when deploying to crc…
Browse files Browse the repository at this point in the history
… local version of open shift into release/1.5.x (#4200)

* backport of commit 2fecfa9

* backport of commit 640a792

* backport of commit 8ef3b40

* backport of commit a083db0

* backport of commit 0050297

* et 10114 consul is under resourced when deploying to crc local version of open shift (#4184)

* cert managerkubectl get pods

* make resources for webhook cert manager configurable

* changelog entry

* Update charts/consul/values.yaml

* make gateway resources configurable

* update changelog

---------

Co-authored-by: Sarah Alsmiller <sarah.alsmiller@hashicorp.com>
Co-authored-by: sarahalsmiller <100602640+sarahalsmiller@users.noreply.github.com>
  • Loading branch information
3 people authored Jul 22, 2024
1 parent fc4c536 commit 491b729
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 12 deletions.
4 changes: 4 additions & 0 deletions .changelog/4184.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
```release-note:improvement
* helm: Adds `webhookCertManager.resources` field which can be configured to override the `resource` settings for the `webhook-cert-manager` deployment.
* helm: Adds `connectInject.apiGateway.managedGatewayClass.resourceJob.resources` field which can be configured to override the `resource` settings for the `gateway-resources-job` job.
```
9 changes: 3 additions & 6 deletions charts/consul/templates/gateway-resources-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,13 +89,10 @@ spec:
{{- if .Values.connectInject.apiGateway.managedGatewayClass.metrics.port }}
- -metrics-port={{ .Values.connectInject.apiGateway.managedGatewayClass.metrics.port }}
{{- end }}
{{- with .Values.connectInject.apiGateway.managedGatewayClass.resourceJob.resources }}
resources:
requests:
memory: "50Mi"
cpu: "50m"
limits:
memory: "50Mi"
cpu: "50m"
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /consul/config
Expand Down
9 changes: 3 additions & 6 deletions charts/consul/templates/webhook-cert-manager-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@ spec:
{{ template "consul.imagePullPolicy" . }}
name: webhook-cert-manager
{{- include "consul.restrictedSecurityContext" . | nindent 8 }}
{{- with .Values.webhookCertManager.resources }}
resources:
limits:
cpu: 100m
memory: 50Mi
requests:
cpu: 100m
memory: 50Mi
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
- name: config
mountPath: /bootstrap/config
Expand Down
56 changes: 56 additions & 0 deletions charts/consul/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2456,6 +2456,35 @@ connectInject:
# will be the 80 + the number defined below.
mapPrivilegedContainerPorts: 0

# This value contains settings related to the gateway_resources_job that runs on helm install
resourceJob:
# The resource requests (CPU, memory, etc.) for the server-acl-init and server-acl-init-cleanup pods.
# This should be a YAML map corresponding to a Kubernetes
# [`ResourceRequirements``](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#resourcerequirements-v1-core)
# object.
#
# Example:
#
# ```yaml
# resources:
# requests:
# memory: '200Mi'
# cpu: '100m'
# limits:
# memory: '200Mi'
# cpu: '100m'
# ```
#
# @recurse: false
# @type: map
resources:
requests:
memory: "50Mi"
cpu: "50m"
limits:
memory: "50Mi"
cpu: "50m"

# Configuration for the ServiceAccount created for the api-gateway component
serviceAccount:
# This value defines additional annotations for the client service account. This should be formatted as a multi-line
Expand Down Expand Up @@ -3466,6 +3495,33 @@ webhookCertManager:
# @type: string
nodeSelector: null

# The resource requests (CPU, memory, etc.) for the server-acl-init and server-acl-init-cleanup pods.
# This should be a YAML map corresponding to a Kubernetes
# [`ResourceRequirements``](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.27/#resourcerequirements-v1-core)
# object.
#
# Example:
#
# ```yaml
# resources:
# requests:
# memory: '200Mi'
# cpu: '100m'
# limits:
# memory: '200Mi'
# cpu: '100m'
# ```
#
# @recurse: false
# @type: map
resources:
requests:
memory: "50Mi"
cpu: "100m"
limits:
memory: "50Mi"
cpu: "100m"

# Configures a demo Prometheus installation.
prometheus:
# When true, the Helm chart will install a demo Prometheus server instance
Expand Down

0 comments on commit 491b729

Please sign in to comment.