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 obtain a copy of the License at
#
@ -16,24 +18,28 @@ HELM_PIDFILE ?= $(abspath ./.helm-pid)
CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
.PHONY: all
all: charts
all: banner charts
banner:
@echo Building charts: $(CHARTS)
.PHONY: charts
charts: $(CHARTS)
@echo Done building charts.
.PHONY: helm-init
helm-init: helm-serve
helm-init: $(addprefix helm-init-,$(CHARTS))
.PHONY: helm-init-%
helm-init-%: helm-serve
@echo Initializing chart $*
cd charts;if [ -s $*/requirements.yaml ]; then echo "Initializing $*";$(HELM) dep up $*; fi
.PHONY: lint
lint: helm-lint
.PHONY: helm-lint
helm-lint: helm-serve $(addprefix helm-lint-,$(CHARTS))
helm-lint: $(addprefix helm-lint-,$(CHARTS))
.PHONY: helm-lint-%
helm-lint-%: helm-init-%
@ -41,16 +47,16 @@ helm-lint-%: helm-init-%
cd charts;$(HELM) lint $*
.PHONY: dry-run
dry-run: helm-lint $(addprefix dry-run-,$(CHARTS))
dry-run: $(addprefix dry-run-,$(CHARTS))
.PHONY: dry-run-%
dry-run-%: helm-lint-%
echo Running Dry-Run on chart $*
cd charts;$(HELM) template $*
cd charts;$(HELM) template --set pod.resources.enabled=true $*
.PHONY: $(CHARTS)
$(CHARTS): dry-run-$@
$(HELM) package -d charts $@
$(CHARTS): $(addprefix dry-run-,$(CHARTS))
$(HELM) package -d charts charts/$@
.PHONY: helm-serve
helm-serve:

View File

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

View File

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

View File

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