Skip to content

Commit

Permalink
Support configuring resources requests and limits for all containers …
Browse files Browse the repository at this point in the history
…of tidb cluster (#853)

* Support confiugring resources requests and limits for all containers of tidb cluster

Signed-off-by: Aylei <rayingecho@gmail.com>
  • Loading branch information
aylei authored and tennix committed Aug 30, 2019
1 parent e63f267 commit 8f81b48
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 0 deletions.
2 changes: 2 additions & 0 deletions charts/tidb-cluster/templates/drainer-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
mountPath: /data
- name: config
mountPath: /etc/drainer
resources:
{{ toYaml .Values.binlog.drainer.resources | indent 10 }}
volumes:
- name: config
configMap:
Expand Down
4 changes: 4 additions & 0 deletions charts/tidb-cluster/templates/monitor-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ spec:
readOnly: false
- name: monitor-data
mountPath: /data
resources:
{{ toYaml .Values.monitor.initializer.resources | indent 10 }}
containers:
- name: prometheus
image: {{ .Values.monitor.prometheus.image }}
Expand Down Expand Up @@ -129,6 +131,8 @@ spec:
- name: prometheus-rules
mountPath: /prometheus-rules
readOnly: false
resources:
{{ toYaml .Values.monitor.reloader.resources | indent 10 }}
{{- end }}
{{- if .Values.monitor.grafana.create }}
- name: grafana
Expand Down
2 changes: 2 additions & 0 deletions charts/tidb-cluster/templates/pump-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ spec:
mountPath: /data
- name: config
mountPath: /etc/pump
resources:
{{ toYaml .Values.binlog.pump.resources | indent 10 }}
volumes:
- name: config
configMap:
Expand Down
2 changes: 2 additions & 0 deletions charts/tidb-cluster/templates/scheduled-backup-cronjob.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ spec:
mountPath: "/gcp"
readOnly: true
{{- end }}
resources:
{{ toYaml .Values.scheduledBackup.resources | indent 14 }}
env:
- name: POD_NAME
valueFrom:
Expand Down
2 changes: 2 additions & 0 deletions charts/tidb-cluster/templates/tidb-initializer-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ spec:
mountPath: /data
readOnly: true
{{- end }}
resources:
{{ toYaml .Values.tidb.initializer.resources | indent 10 }}
volumes:
- name: password
secret:
Expand Down
45 changes: 45 additions & 0 deletions charts/tidb-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,15 @@ tidb:
cpu: 20m
memory: 5Mi

initializer:
resources: {}
# limits:
# cpu: 100m
# memory: 100Mi
# requests:
# cpu: 100m
# memory: 100Mi

# tidb plugin configuration
plugin:
# enable plugin or not
Expand Down Expand Up @@ -337,12 +346,26 @@ monitor:
initializer:
image: pingcap/tidb-monitor-initializer:v3.0.1
imagePullPolicy: IfNotPresent
resources: {}
# limits:
# cpu: 50m
# memory: 64Mi
# requests:
# cpu: 50m
# memory: 64Mi
reloader:
create: true
image: pingcap/tidb-monitor-reloader:v1.0.0
imagePullPolicy: IfNotPresent
service:
type: NodePort
resources: {}
# limits:
# cpu: 50m
# memory: 64Mi
# requests:
# cpu: 50m
# memory: 64Mi
grafana:
create: true
image: grafana/grafana:6.0.1
Expand Down Expand Up @@ -418,6 +441,13 @@ binlog:
gc: 7
# number of seconds between heartbeat ticks (in 2 seconds)
heartbeatInterval: 2
resources:
limits: {}
# cpu: 8000m
# memory: 8Gi
requests: {}
# cpu: 4000m
# memory: 4Gi

# Please refer to https://github.com/pingcap/tidb-binlog/blob/master/cmd/pump/pump.toml for the default
# pump configurations (change to the tags of your pump version),
Expand Down Expand Up @@ -480,6 +510,13 @@ binlog:
# zookeeperAddrs: "127.0.0.1:2181"
# kafkaAddrs: "127.0.0.1:9092"
# kafkaVersion: "0.8.2.0"
resources:
limits: {}
# cpu: 8000m
# memory: 8Gi
requests: {}
# cpu: 4000m
# memory: 4Gi

# Please refer to https://github.com/pingcap/tidb-binlog/blob/master/cmd/drainer/drainer.toml for the default
# drainer configurations (change to the tags of your drainer version),
Expand Down Expand Up @@ -560,6 +597,14 @@ scheduledBackup:
# kubectl create secret generic s3-backup-secret --from-literal=access_key=<access-key> --from-literal=secret_key=<secret-key>
# secretName: s3-backup-secret

resources:
limits: {}
# cpu: 8000m
# memory: 8Gi
requests: {}
# cpu: 4000m
# memory: 4Gi

importer:
create: false
image: pingcap/tidb-lightning:v3.0.1
Expand Down

0 comments on commit 8f81b48

Please sign in to comment.