Resource limits on Promenade charts

- Update Makefile to more closely match UCP standards
- Add resource limits to any Pods missing them

Change-Id: Ia791a6b207c2baca7dd3141be71aef513c916661
This commit is contained in:
Scott Hussey 2018-03-27 20:48:56 -05:00
parent 3faccce445
commit ccd372a974
15 changed files with 113 additions and 11 deletions

View File

@ -1,6 +1,4 @@
# Copyright 2017 AT&T Intellectual Property. All other rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# Copyright 2017 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
#
@ -15,7 +13,7 @@
HELM ?= helm
HELM_PIDFILE ?= $(abspath ./.helm-pid)
CHARTS := $(patsubst %/.,%,$(wildcard charts/*/.))
CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
.PHONY: all
all: charts
@ -24,12 +22,34 @@ all: charts
charts: $(CHARTS)
@echo Done building charts.
.PHONY: helm-init
helm-init: helm-serve
.PHONY: helm-init-%
helm-init-%: helm-serve
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))
.PHONY: helm-lint-%
helm-lint-%: helm-init-%
@echo Linting chart $*
cd charts;$(HELM) lint $*
.PHONY: dry-run
dry-run: helm-lint $(addprefix dry-run-,$(CHARTS))
.PHONY: dry-run-%
dry-run-%: helm-lint-%
echo Running Dry-Run on chart $*
cd charts;$(HELM) template $*
.PHONY: $(CHARTS)
$(CHARTS): helm-serve
@echo $@
if [ -s $@/requirements.yaml ]; then $(HELM) dep up $@; fi
$(HELM) lint $@
$(HELM) template $@
$(CHARTS): dry-run-$@
$(HELM) package -d charts $@
.PHONY: helm-serve

View File

@ -0,0 +1,18 @@
# Copyright 2017 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
dependencies:
- name: helm-toolkit
repository: http://localhost:8879/charts
version: 0.1.0

View File

@ -38,6 +38,7 @@ spec:
# host.
- name: calico-node
image: {{ .Values.images.node }}
{{ tuple . .Values.pod.resources.calico_node | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
# The location of the Calico etcd cluster.
- name: ETCD_ENDPOINTS

View File

@ -39,6 +39,7 @@ spec:
containers:
- name: calico-policy-controller
image: {{ .Values.images.policy_controller }}
{{ tuple . .Values.pod.resources.calico_policy_controller | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env:
# The location of the Calico etcd cluster.
- name: ETCD_ENDPOINTS

View File

@ -23,3 +23,21 @@ images:
ctl: quay.io/calico/ctl:v1.6.3
node: quay.io/calico/node:v2.6.5
policy_controller: quay.io/calico/kube-controllers:v1.0.2
pod:
resources:
enabled: false
calico_node:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
calico_policy_controller:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"

View File

@ -57,6 +57,7 @@ spec:
- name: coredns
image: {{ .Values.images.tags.coredns | quote }}
imagePullPolicy: {{ .Values.images.pull_policy | quote }}
{{ tuple . .Values.pod.resources.coredns | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }}
args: [ "-conf", "/etc/coredns/Corefile" ]
volumeMounts:
- name: config-volume

View File

@ -26,6 +26,7 @@ spec:
- name: {{ .Release.Name }}-test
image: {{ .Values.images.tags.test }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple . .Values.pod.resources.pod_test | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
command:
- /bin/sh
- -c

View File

@ -37,6 +37,24 @@ service:
name: coredns
ip: 10.96.0.10
pod:
resources:
enabled: false
coredns:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
pod_test:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
monitoring:
prometheus:
enabled: false

View File

@ -30,6 +30,7 @@ spec:
- name: etcd
image: {{ .Values.images.tags.etcd }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.etcd_pod | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
env:
- name: ETCD_NAME
valueFrom:

View File

@ -109,6 +109,13 @@ pod:
limits:
memory: "1024Mi"
cpu: "2000m"
etcd_pod:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
manifests:
configmap_bin: true

View File

@ -25,6 +25,7 @@ spec:
- name: haproxy
image: {{ .Values.images.tags.haproxy }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple . .Values.pod.resources.haproxy_pod | include "helm-toolkit.snippets.kubernetes_resources" | indent 6 }}
hostNetwork: true
env:
- name: HAPROXY_CONF

View File

@ -88,5 +88,12 @@ pod:
limits:
memory: "256Mi"
cpu: "2000m"
haproxy_pod:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "256Mi"
cpu: "2000m"
release_group: null

View File

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

View File

@ -45,7 +45,7 @@ spec:
- name: anchor
image: {{ .Values.images.tags.anchor }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.scheduler | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{ tuple $envAll $envAll.Values.pod.resources.anchor_daemonset | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
command:
- /tmp/bin/anchor
lifecycle:

View File

@ -37,7 +37,14 @@ pod:
timeout: 3600
resources:
enabled: false
scheduler:
anchor_daemonset:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
scheduler_pod:
requests:
memory: "128Mi"
cpu: "100m"