diff --git a/Makefile b/Makefile index 1d1c5134..e1c2ebc4 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/charts/calico/requirements.yaml b/charts/calico/requirements.yaml new file mode 100644 index 00000000..7496230c --- /dev/null +++ b/charts/calico/requirements.yaml @@ -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 diff --git a/charts/calico/templates/daemonset-node.yaml b/charts/calico/templates/daemonset-node.yaml index 938f02f6..4b94f092 100644 --- a/charts/calico/templates/daemonset-node.yaml +++ b/charts/calico/templates/daemonset-node.yaml @@ -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 diff --git a/charts/calico/templates/deployment-policy-controller.yaml b/charts/calico/templates/deployment-policy-controller.yaml index 302a0e4a..b38ebded 100644 --- a/charts/calico/templates/deployment-policy-controller.yaml +++ b/charts/calico/templates/deployment-policy-controller.yaml @@ -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 diff --git a/charts/calico/values.yaml b/charts/calico/values.yaml index faa97571..f63e2524 100644 --- a/charts/calico/values.yaml +++ b/charts/calico/values.yaml @@ -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" diff --git a/charts/coredns/templates/deployment.yaml b/charts/coredns/templates/deployment.yaml index bd44f48a..72c4fc6b 100644 --- a/charts/coredns/templates/deployment.yaml +++ b/charts/coredns/templates/deployment.yaml @@ -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 diff --git a/charts/coredns/templates/pod-test.yaml b/charts/coredns/templates/pod-test.yaml index 1e87bfc3..25c9a116 100644 --- a/charts/coredns/templates/pod-test.yaml +++ b/charts/coredns/templates/pod-test.yaml @@ -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 diff --git a/charts/coredns/values.yaml b/charts/coredns/values.yaml index 73f441b7..23fb5e07 100644 --- a/charts/coredns/values.yaml +++ b/charts/coredns/values.yaml @@ -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 diff --git a/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl b/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl index c2ae0dcd..3f22a154 100644 --- a/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl +++ b/charts/etcd/templates/etc/_kubernetes-etcd.yaml.tpl @@ -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: diff --git a/charts/etcd/values.yaml b/charts/etcd/values.yaml index e3cd519c..b4920d02 100644 --- a/charts/etcd/values.yaml +++ b/charts/etcd/values.yaml @@ -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 diff --git a/charts/haproxy/templates/etc/_haproxy.yaml.tpl b/charts/haproxy/templates/etc/_haproxy.yaml.tpl index 6a6230b5..c4141b3c 100644 --- a/charts/haproxy/templates/etc/_haproxy.yaml.tpl +++ b/charts/haproxy/templates/etc/_haproxy.yaml.tpl @@ -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 diff --git a/charts/haproxy/values.yaml b/charts/haproxy/values.yaml index 4dbc155c..2b325a86 100644 --- a/charts/haproxy/values.yaml +++ b/charts/haproxy/values.yaml @@ -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 diff --git a/charts/scheduler/templates/etc/_kubernetes-scheduler.yaml.tpl b/charts/scheduler/templates/etc/_kubernetes-scheduler.yaml.tpl index 97fdc9be..bf7a960e 100644 --- a/charts/scheduler/templates/etc/_kubernetes-scheduler.yaml.tpl +++ b/charts/scheduler/templates/etc/_kubernetes-scheduler.yaml.tpl @@ -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: diff --git a/charts/scheduler/templates/daemonset.yaml b/charts/scheduler/templates/sched-anchor.yaml similarity index 95% rename from charts/scheduler/templates/daemonset.yaml rename to charts/scheduler/templates/sched-anchor.yaml index 1c6ed399..e40080cb 100644 --- a/charts/scheduler/templates/daemonset.yaml +++ b/charts/scheduler/templates/sched-anchor.yaml @@ -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: diff --git a/charts/scheduler/values.yaml b/charts/scheduler/values.yaml index 935c4de3..ad5053a0 100644 --- a/charts/scheduler/values.yaml +++ b/charts/scheduler/values.yaml @@ -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"