Commit 7042e1be authored by Jason Plum's avatar Jason Plum

Explicitly set resources.requests.cpu on initContainers

Part of #542.

Set explicit `init.resources.requests.cpu: 50m` and populate into `initContainer`s for all non-Job charts within the repository.
parent 78fb9a5d
Pipeline #25230474 failed with stages
in 25 minutes and 36 seconds
---
title: Explicitly set resources.requests.cpu=50m on initContainers to enforce reduced
resources
merge_request: 369
author:
type: changed
......@@ -39,6 +39,8 @@ spec:
- name: gitaly-secrets
mountPath: /init-secrets
readOnly: false
resources:
{{ toYaml .Values.init.resources | indent 12 }}
securityContext:
runAsUser: 1000
fsGroup: 1000
......
......@@ -20,6 +20,9 @@ serviceName: gitaly
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
global:
# imagePullPolicy: IfNotPresent
......
......@@ -31,6 +31,8 @@ spec:
- name: shell-secrets
mountPath: /init-secrets
readOnly: false
resources:
{{ toYaml .Values.init.resources | indent 12 }}
securityContext:
runAsUser: 1000
fsGroup: 1000
......
......@@ -15,6 +15,9 @@ service:
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
global:
# imagePullPolicy: IfNotPresent
......
......@@ -95,6 +95,8 @@ spec:
- name: sidekiq-secrets
mountPath: /sidekiq-secrets
readOnly: false
resources:
{{ toYaml $.Values.init.resources | indent 12 }}
- name: dependencies
image: "{{ $image }}"
{{ template "gitlab.imagePullPolicy" $ }}
......@@ -118,6 +120,8 @@ spec:
- name: sidekiq-secrets
mountPath: '/etc/gitlab'
readOnly: true
resources:
{{ toYaml $.Values.init.resources | indent 12 }}
{{- include "pullsecrets" $.Values.image | indent 6}}
containers:
- name: {{ $name }}
......
......@@ -10,6 +10,9 @@ image:
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
enabled: true
......
......@@ -35,6 +35,8 @@ spec:
- name: task-runner-secrets
mountPath: /init-secrets
readOnly: false
resources:
{{ toYaml .Values.init.resources | indent 12 }}
{{- include "pullsecrets" .Values.image | indent 6}}
containers:
- name: {{ .Chart.Name }}
......
......@@ -7,6 +7,9 @@ image:
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
enabled: true
global:
......
......@@ -59,6 +59,8 @@ spec:
- name: unicorn-secrets
mountPath: /init-secrets
readOnly: false
resources:
{{ toYaml .Values.init.resources | indent 12 }}
- name: dependencies
image: "{{ .Values.image.repository }}:{{ coalesce .Values.image.tag (include "gitlab.versionTag" . ) }}"
{{ template "gitlab.imagePullPolicy" . }}
......@@ -79,6 +81,8 @@ spec:
- name: unicorn-secrets
mountPath: '/etc/gitlab'
readOnly: true
resources:
{{ toYaml .Values.init.resources | indent 12 }}
{{- include "pullsecrets" .Values.image | indent 6}}
containers:
- name: {{ .Chart.Name }}
......
......@@ -9,6 +9,9 @@ image:
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
metrics:
enabled: true
annotations:
......
......@@ -65,6 +65,8 @@ spec:
mountPath: /config
- name: minio-server-config
mountPath: /minio
resources:
{{ toYaml .Values.init.resources | indent 12 }}
{{- include "pullsecrets" .Values | indent 6}}
containers:
- name: minio
......
......@@ -44,7 +44,9 @@ init:
pullPolicy: "IfNotPresent"
script: |-
sed -e '[email protected][email protected]'"$(cat /config/accesskey)"'@' -e '[email protected][email protected]'"$(cat /config/secretkey)"'@' /config/config.json > /minio/config.json
resources:
requests:
cpu: 50m
## Set default Minio config file path, volume mount path and
## number of nodes (only used for Minio distributed mode)
## Distributed Minio ref: https://docs.minio.io/docs/distributed-minio-quickstart-guide
......
......@@ -66,6 +66,8 @@ spec:
- name: {{ .Release.Name }}-metrics
mountPath: /metrics
readOnly: false
resources:
{{ toYaml .Values.init.resources | indent 12 }}
serviceAccountName: {{ template "redis-ha.serviceAccountName" . }}
{{- if .Values.nodeSelector }}
nodeSelector:
......
......@@ -31,6 +31,9 @@ image:
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
## replicas number for each component
replicas:
servers: 3
......
......@@ -41,6 +41,8 @@ spec:
- name: {{ .Release.Name }}-metrics
mountPath: /metrics
readOnly: false
resources:
{{ toYaml .Values.init.resources | indent 12 }}
{{- include "pullsecrets" .Values.image | indent 6}}
containers:
- name: redis
......
......@@ -6,6 +6,9 @@ image:
init:
image: busybox
tag: latest
resources:
requests:
cpu: 50m
service:
name: redis
type: ClusterIP
......
......@@ -56,6 +56,8 @@ spec:
mountPath: /config
- name: registry-server-config
mountPath: /registry
resources:
{{ toYaml .Values.init.resources | indent 12 }}
{{- include "pullsecrets" .Values.image | indent 6}}
containers:
- name: registry
......
......@@ -49,6 +49,9 @@ init:
image: "busybox"
tag: "latest"
pullPolicy: "IfNotPresent"
resources:
requests:
cpu: 50m
script: |-
if [ -e /config/accesskey ] ; then
sed -e '[email protected][email protected]'"$(cat /config/accesskey)"'@' -e '[email protected][email protected]'"$(cat /config/secretkey)"'@' /config/config.yml > /registry/config.yml
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment