Merge "Chart: Update Armada charts and make target"

This commit is contained in:
Zuul 2018-05-30 20:24:18 +00:00 committed by Gerrit Code Review
commit 19efc1ad03
7 changed files with 99 additions and 21 deletions

View File

@ -20,7 +20,7 @@ IMAGE_TAG ?= latest
HELM ?= helm HELM ?= helm
LABEL ?= commit-id LABEL ?= commit-id
PYTHON = python3 PYTHON = python3
CHART = armada CHARTS := $(patsubst charts/%/.,%,$(wildcard charts/*/.))
IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG} IMAGE := ${DOCKER_REGISTRY}/${IMAGE_PREFIX}/${IMAGE_NAME}:${IMAGE_TAG}
# VERSION INFO # VERSION INFO
@ -108,6 +108,9 @@ protoc:
.PHONY: clean .PHONY: clean
clean: clean:
rm -rf build rm -rf build
rm -f charts/*.tgz
rm -f charts/*/requirements.lock
rm -rf charts/*/charts
# testing checks # testing checks
.PHONY: tests .PHONY: tests
@ -138,13 +141,41 @@ lint: test-pep8 helm_lint
test-pep8: check-tox test-pep8: check-tox
tox -e pep8 tox -e pep8
.PHONY: helm-lint chartbanner:
helm_lint: @echo Building charts: $(CHARTS)
@tools/helm_tk.sh $(HELM)
$(HELM) dep up charts/$(CHART)
$(HELM) lint charts/$(CHART)
.PHONY: charts .PHONY: charts
charts: clean charts: $(CHARTS)
$(HELM) dep up charts/$(CHART) @echo Done building charts.
$(HELM) package charts/$(CHART)
.PHONY: helm-init
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: helm-serve
helm-serve:
./tools/helm_tk.sh $(HELM) $(HELM_PIDFILE)
.PHONY: helm-lint
helm-lint: $(addprefix helm-lint-,$(CHARTS))
.PHONY: helm-lint-%
helm-lint-%: helm-init-%
@echo Linting chart $*
cd charts;$(HELM) lint $*
.PHONY: dry-run
dry-run: $(addprefix dry-run-,$(CHARTS))
.PHONY: dry-run-%
dry-run-%: helm-lint-%
echo Running Dry-Run on chart $*
cd charts;$(HELM) template --set pod.resources.enabled=true $*
.PHONY: $(CHARTS)
$(CHARTS): $(addprefix dry-run-,$(CHARTS)) chartbanner
$(HELM) package -d charts charts/$@

View File

@ -14,12 +14,15 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.configmap_bin }}
--- ---
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: armada-bin name: armada-bin
data: data:
image-repo-sync.sh: |
{{- include "helm-toolkit.scripts.image_repo_sync" . | indent 4 }}
ks-service.sh: | ks-service.sh: |
{{- include "helm-toolkit.scripts.keystone_service" . | indent 4 }} {{- include "helm-toolkit.scripts.keystone_service" . | indent 4 }}
ks-endpoints.sh: | ks-endpoints.sh: |
@ -28,3 +31,4 @@ data:
{{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }} {{- include "helm-toolkit.scripts.keystone_user" . | indent 4 }}
ks-domain-user.sh: | ks-domain-user.sh: |
{{- include "helm-toolkit.scripts.keystone_domain_user" . | indent 4 }} {{- include "helm-toolkit.scripts.keystone_domain_user" . | indent 4 }}
{{- end }}

View File

@ -16,11 +16,10 @@ limitations under the License.
{{- if .Values.manifests.deployment_api }} {{- if .Values.manifests.deployment_api }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.static.api }}
{{- $mounts_armada_api := .Values.pod.mounts.armada_api.armada_api }} {{- $mounts_armada_api := .Values.pod.mounts.armada_api.armada_api }}
{{- $mounts_armada_api_init := .Values.pod.mounts.armada_api.init_container }} {{- $mounts_armada_api_init := .Values.pod.mounts.armada_api.init_container }}
{{- $serviceAccountName := "armada-api" }} {{- $serviceAccountName := "armada-api" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "api" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRole kind: ClusterRole
@ -88,11 +87,10 @@ spec:
{{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }} {{ .Values.labels.node_selector_key }}: {{ .Values.labels.node_selector_value }}
terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }} terminationGracePeriodSeconds: {{ .Values.pod.lifecycle.termination_grace_period.api.timeout | default "30" }}
initContainers: initContainers:
{{ tuple $envAll $dependencies $mounts_armada_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }} {{ tuple $envAll "api" $mounts_armada_api_init | include "helm-toolkit.snippets.kubernetes_entrypoint_init_container" | indent 8 }}
containers: containers:
- name: armada-api - name: armada-api
image: {{ .Values.images.tags.api }} {{ tuple $envAll "api" | include "helm-toolkit.snippets.image" | indent 10 }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.api | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
{{- if .Values.pod.env.armada_api }} {{- if .Values.pod.env.armada_api }}
env: env:

View File

@ -0,0 +1,4 @@
{{- if and .Values.manifests.job_image_repo_sync .Values.images.local_registry.active }}
{{- $imageRepoSyncJob := dict "envAll" . "serviceName" "armada" -}}
{{ $imageRepoSyncJob | include "helm-toolkit.manifests.job_image_repo_sync" }}
{{- end }}

View File

@ -24,13 +24,19 @@ labels:
node_selector_value: enabled node_selector_value: enabled
images: images:
pull_policy: IfNotPresent
tags: tags:
api: 'quay.io/attcomdev/armada:latest' api: 'quay.io/attcomdev/armada:latest'
dep_check: 'quay.io/stackanetes/kubernetes-entrypoint:v0.3.1' dep_check: 'quay.io/stackanetes/kubernetes-entrypoint:v0.3.1'
ks_endpoints: 'docker.io/openstackhelm/heat:newton' ks_endpoints: 'docker.io/openstackhelm/heat:newton'
ks_service: 'docker.io/openstackhelm/heat:newton' ks_service: 'docker.io/openstackhelm/heat:newton'
ks_user: 'docker.io/openstackhelm/heat:newton' ks_user: 'docker.io/openstackhelm/heat:newton'
image_repo_sync: docker.io/docker:17.07.0
pull_policy: "IfNotPresent"
local_registry:
active: false
exclude:
- dep_check
- image_repo_sync
network: network:
api: api:
@ -46,6 +52,14 @@ network:
port: 31903 port: 31903
dependencies: dependencies:
dynamic:
common:
local_image_registry:
jobs:
- armada-image-repo-sync
services:
- endpoint: node
service: local_image_registry
static: static:
api: api:
jobs: jobs:
@ -68,6 +82,10 @@ dependencies:
services: services:
- endpoint: internal - endpoint: internal
service: identity service: identity
image_repo_sync:
services:
- endpoint: internal
service: local_image_registry
# typically overridden by environmental # typically overridden by environmental
# values, but should include all endpoints # values, but should include all endpoints
@ -120,6 +138,18 @@ endpoints:
default: http default: http
host_fqdn_override: host_fqdn_override:
default: null default: null
local_image_registry:
name: docker-registry
namespace: docker-registry
hosts:
default: localhost
internal: docker-registry
node: localhost
host_fqdn_override:
default: null
port:
registry:
node: 5000
secrets: secrets:
identity: identity:
@ -231,6 +261,13 @@ pod:
requests: requests:
memory: "128Mi" memory: "128Mi"
cpu: "100m" cpu: "100m"
image_repo_sync:
requests:
memory: "128Mi"
cpu: "100m"
limits:
memory: "1024Mi"
cpu: "2000m"
test: test:
api: api:
limits: limits:
@ -245,6 +282,7 @@ manifests:
configmap_etc: true configmap_etc: true
deployment_api: true deployment_api: true
ingress_api: true ingress_api: true
job_image_repo_sync: true
job_ks_endpoints: true job_ks_endpoints: true
job_ks_service: true job_ks_service: true
job_ks_user: true job_ks_user: true

View File

@ -16,9 +16,8 @@ limitations under the License.
{{- if .Values.manifests.deployment_tiller }} {{- if .Values.manifests.deployment_tiller }}
{{- $envAll := . }} {{- $envAll := . }}
{{- $dependencies := .Values.dependencies.tiller_deploy }}
{{- $serviceAccountName := "tiller-deploy" }} {{- $serviceAccountName := "tiller-deploy" }}
{{ tuple $envAll $dependencies $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }} {{ tuple $envAll "tiller_deploy" $serviceAccountName | include "helm-toolkit.snippets.kubernetes_pod_rbac_serviceaccount" }}
--- ---
apiVersion: rbac.authorization.k8s.io/v1beta1 apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding kind: ClusterRoleBinding
@ -60,8 +59,7 @@ spec:
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $serviceAccountName }}
containers: containers:
- name: tiller - name: tiller
image: {{ .Values.images.tags.tiller }} {{ tuple $envAll "tiller" | include "helm-toolkit.snippets.image" | indent 10 }}
imagePullPolicy: {{ .Values.images.pull_policy }}
{{ tuple $envAll $envAll.Values.pod.resources.tiller | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} {{ tuple $envAll $envAll.Values.pod.resources.tiller | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }}
env: env:
- name: TILLER_NAMESPACE - name: TILLER_NAMESPACE

View File

@ -15,13 +15,18 @@
# namespace: "kube-system" # namespace: "kube-system"
dependencies: dependencies:
static:
tiller_deploy: tiller_deploy:
images: images:
tags: tags:
tiller: gcr.io/kubernetes-helm/tiller:v2.7.2 tiller: gcr.io/kubernetes-helm/tiller:v2.7.2
pull_policy: "IfNotPresent" pull_policy: "IfNotPresent"
local_registry:
# NOTE(portdirect): this tiller chart does not support image pulling
active: false
exclude:
- tiller
deployment: deployment:
# NOTE: Current replica is hard-coded to 1. This is a placeholder variable # NOTE: Current replica is hard-coded to 1. This is a placeholder variable