Missing resource limits on apiserver pod

- Add resource limits to the static defintion for the
  apiserver pod

Change-Id: I473c67e53da148f92441563187d6e026cf697582
This commit is contained in:
Scott Hussey 2018-04-02 14:25:44 -05:00
parent ccd372a974
commit 88681e754a
4 changed files with 23 additions and 9 deletions

View File

@ -1,4 +1,6 @@
# Copyright 2017 AT&T Intellectual Property. All other rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # Copyright 2018 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License. # you may not use this file except in compliance with the License.
# You may obtain a copy of the License at # You may obtain a copy of the License at
# #
@ -16,24 +18,28 @@ HELM_PIDFILE ?= $(abspath ./.helm-pid)
CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.)) CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
.PHONY: all .PHONY: all
all: charts all: banner charts
banner:
@echo Building charts: $(CHARTS)
.PHONY: charts .PHONY: charts
charts: $(CHARTS) charts: $(CHARTS)
@echo Done building charts. @echo Done building charts.
.PHONY: helm-init .PHONY: helm-init
helm-init: helm-serve helm-init: $(addprefix helm-init-,$(CHARTS))
.PHONY: helm-init-% .PHONY: helm-init-%
helm-init-%: helm-serve helm-init-%: helm-serve
@echo Initializing chart $*
cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up $*; fi cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up $*; fi
.PHONY: lint .PHONY: lint
lint: helm-lint lint: helm-lint
.PHONY: helm-lint .PHONY: helm-lint
helm-lint: helm-serve $(addprefix helm-lint-,$(CHARTS)) helm-lint: $(addprefix helm-lint-,$(CHARTS))
.PHONY: helm-lint-% .PHONY: helm-lint-%
helm-lint-%: helm-init-% helm-lint-%: helm-init-%
@ -41,16 +47,16 @@ helm-lint-%: helm-init-%
cd charts;$(HELM) lint $* cd charts;$(HELM) lint $*
.PHONY: dry-run .PHONY: dry-run
dry-run: helm-lint $(addprefix dry-run-,$(CHARTS)) dry-run: $(addprefix dry-run-,$(CHARTS))
.PHONY: dry-run-% .PHONY: dry-run-%
dry-run-%: helm-lint-% dry-run-%: helm-lint-%
echo Running Dry-Run on chart $* echo Running Dry-Run on chart $*
cd charts;$(HELM) template $* cd charts;$(HELM) template --set pod.resources.enabled=true $*
.PHONY: $(CHARTS) .PHONY: $(CHARTS)
$(CHARTS): dry-run-$@ $(CHARTS): $(addprefix dry-run-,$(CHARTS))
$(HELM) package -d charts $@ $(HELM) package -d charts charts/$@
.PHONY: helm-serve .PHONY: helm-serve
helm-serve: helm-serve:

View File

@ -49,12 +49,12 @@ spec:
- name: anchor - name: anchor
image: {{ .Values.images.tags.anchor }} image: {{ .Values.images.tags.anchor }}
imagePullPolicy: {{ .Values.images.pull_policy }} imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.anchor_pod | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: MANIFEST_PATH - name: MANIFEST_PATH
value: /host{{ .Values.anchor.kubelet.manifest_path }}/{{ .Values.service.name }}.yaml value: /host{{ .Values.anchor.kubelet.manifest_path }}/{{ .Values.service.name }}.yaml
- name: PKI_PATH - name: PKI_PATH
value: /host{{ .Values.apiserver.host_etc_path }}/pki value: /host{{ .Values.apiserver.host_etc_path }}/pki
{{ tuple $envAll $envAll.Values.pod.resources.kubernetes_apiserver | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
command: command:
- /tmp/bin/anchor - /tmp/bin/anchor
lifecycle: lifecycle:

View File

@ -27,6 +27,7 @@ spec:
containers: containers:
- name: apiserver - name: apiserver
image: {{ .Values.images.tags.apiserver }} image: {{ .Values.images.tags.apiserver }}
{{ tuple $envAll $envAll.Values.pod.resources.kubernetes_apiserver | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
env: env:
- name: POD_IP - name: POD_IP
valueFrom: valueFrom:

View File

@ -117,6 +117,13 @@ pod:
timeout: 3600 timeout: 3600
resources: resources:
enabled: false enabled: false
anchor_pod:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
kubernetes_apiserver: kubernetes_apiserver:
requests: requests:
memory: "128Mi" memory: "128Mi"