Skip to content
Snippets Groups Projects
Commit f22b9c90 authored by Matteo Di Carlo's avatar Matteo Di Carlo
Browse files

Resolve ST-476 "Subcharts architecture"

parent 982c37fa
No related branches found
No related tags found
No related merge requests found
......@@ -463,11 +463,12 @@ test-chart:
stage: test
tags:
- docker-executor
image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.1
image: nexus.engageska-portugal.pt/ska-docker/deploy:0.4.2
script:
- export KUBE_NAMESPACE="ci-ska-docker-$CI_COMMIT_SHORT_SHA"
- cd charts/
- kubectl version
- helm version
- make install-chart
- make wait
- make test
......@@ -494,7 +495,7 @@ push:
- make DOCKER_REGISTRY_USER=$DOCKER_REGISTRY_FOLDER DOCKER_REGISTRY_HOST=$DOCKER_REGISTRY_HOST push
variables:
CHARTS_TO_PUBLISH: tango-base archiver tango-util
CHARTS_TO_PUBLISH: tango-util tango-base archiver
# Ensure your .gitlab-ci.yml has "publish" stage defined!
include:
- project: 'ska-telescope/templates-repository'
......
......@@ -7,14 +7,16 @@ MARK ?= all
IMAGE_TO_TEST ?= nexus.engageska-portugal.pt/ska-docker/tango-vscode:0.2.7## docker image that will be run for testing purpose
TEST_RUNNER = test-makefile-runner-$(CI_JOB_ID)-$(KUBE_NAMESPACE)-$(RELEASE_NAME)##name of the pod running the k8s_tests
TANGO_HOST=$(shell helm get values ${RELEASE_NAME} -a -n ${KUBE_NAMESPACE} | grep tango_host | head -1 | cut -d':' -f2 | cut -d' ' -f2):10000
CHART_TO_PUB ?= ska-docker## list of charts to be published on gitlab -- umbrella charts for testing purpose
CHARTS ?= tango-util tango-base archiver ska-docker## list of charts to be published on gitlab -- umbrella charts for testing purpose
CI_PROJECT_PATH_SLUG ?= ska-docker
CI_ENVIRONMENT_SLUG ?= ska-docker
.DEFAULT_GOAL := help
clean: ## clean out references to chart tgz's
@rm -f ./*/charts/*.tgz ./*/Chart.lock ./*/requirements.lock ../repository/*
k8s: ## Which kubernetes are we connected to
@echo "Kubernetes cluster-info:"
@kubectl cluster-info
......@@ -47,17 +49,21 @@ help: ## show this help.
package: ## package charts
@echo "Packaging helm charts. Any existing file won't be overwritten."; \
mkdir -p ../tmp
@for i in $(CHART_TO_PUB); do \
helm package $${i} --destination ../tmp > /dev/null; \
@for i in $(CHARTS); do \
helm package $${i} --dependency-update --destination ../tmp > /dev/null; \
done; \
mkdir -p ../repository && cp -n ../tmp/* ../repository; \
cd ../repository && helm repo index .; \
rm -rf ../tmp
install-chart: namespace## install the helm chart with name RELEASE_NAME and path UMBRELLA_CHART_PATH on the namespace KUBE_NAMESPACE
@sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ska-docker/values.yaml > generated_values.yaml; \
dep-up: ## update dependencies for every charts in the env var CHARTS
@for i in $(CHARTS); do \
helm dependency update $${i}; \
done;
install-chart: clean dep-up namespace## install the helm chart with name RELEASE_NAME and path UMBRELLA_CHART_PATH on the namespace KUBE_NAMESPACE
@sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ci-values.yaml > generated_values.yaml; \
sed -e 's/CI_ENVIRONMENT_SLUG/$(CI_ENVIRONMENT_SLUG)/' generated_values.yaml > values.yaml; \
helm dependency update $(UMBRELLA_CHART_PATH); \
helm install $(RELEASE_NAME) \
--set minikube=$(MINIKUBE) \
--values values.yaml \
......@@ -65,11 +71,9 @@ install-chart: namespace## install the helm chart with name RELEASE_NAME and pat
rm generated_values.yaml; \
rm values.yaml
template-chart: ## install the helm chart with name RELEASE_NAME and path UMBRELLA_CHART_PATH on the namespace KUBE_NAMESPACE
@sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ska-docker/values.yaml > generated_values.yaml; \
template-chart: clean dep-up## install the helm chart with name RELEASE_NAME and path UMBRELLA_CHART_PATH on the namespace KUBE_NAMESPACE
@sed -e 's/CI_PROJECT_PATH_SLUG/$(CI_PROJECT_PATH_SLUG)/' ci-values.yaml > generated_values.yaml; \
sed -e 's/CI_ENVIRONMENT_SLUG/$(CI_ENVIRONMENT_SLUG)/' generated_values.yaml > values.yaml; \
helm dependency update $(UMBRELLA_CHART_PATH); \
helm template $(RELEASE_NAME) \
--set minikube=$(MINIKUBE) \
--values values.yaml \
......@@ -78,13 +82,13 @@ template-chart: ## install the helm chart with name RELEASE_NAME and path UMBREL
rm values.yaml
uninstall-chart: ## uninstall the ska-docker helm chart on the namespace ska-docker
helm template $(RELEASE_NAME) $(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE) | kubectl delete -f - ; \
@helm template $(RELEASE_NAME) $(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE) | kubectl delete -f - ; \
helm uninstall $(RELEASE_NAME) --namespace $(KUBE_NAMESPACE)
reinstall-chart: uninstall-chart install-chart ## reinstall the ska-docker helm chart on the namespace ska-docker
upgrade-chart: ## upgrade the ska-docker helm chart on the namespace ska-docker
helm upgrade --set minikube=$(MINIKUBE) $(RELEASE_NAME) $(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE)
@helm upgrade --set minikube=$(MINIKUBE) $(RELEASE_NAME) $(UMBRELLA_CHART_PATH) --namespace $(KUBE_NAMESPACE)
chart_lint: ## lint check the helm chart
@helm lint $(UMBRELLA_CHART_PATH) \
......
apiVersion: v1
apiVersion: v2
appVersion: "1.0"
description: A Helm chart for deploying the HDB++ archiver for the MVP on Kubernetes
name: archiver
version: 0.2.1
version: 0.2.2
appVersion: 1.16.0
icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png
dependencies:
- name: tango-util
version: 0.2.0
repository: file://../tango-util
# The archiver cannot have the tango-base since we allow only one level in the chart hierarchies
# - name: tango-base
# version: 0.2.1
# repository: file://../tango-base
# condition: tango-base.enabled,global.sub-system.tango-base.enabled
global:
annotations:
app.gitlab.com/app: CI_PROJECT_PATH_SLUG
app.gitlab.com/env: CI_ENVIRONMENT_SLUG
# by setting this parameter we can disable the lower level sub-system tango-base, archiver and webjive
# sub-system:
# tango-base:
# enabled: false
# archiver:
# enabled: false
# webjive:
# enabled: false
# tango-base:
# enabled: true
\ No newline at end of file
......@@ -2,15 +2,17 @@ apiVersion: v2
appVersion: "1.0"
description: A Helm chart for deploying the TANGO base system on Kubernetes
name: ska-docker
version: 0.1.2
version: 0.1.3
icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png
dependencies:
- name: tango-util
version: 0.2.0
repository: file://../tango-util
- name: tango-base
version: 0.2.0
version: 0.2.1
repository: file://../tango-base
condition: tango-base.enabled,global.sub-system.tango-base.enabled
- name: archiver
version: 0.2.1
version: 0.2.2
repository: file://../archiver
condition: archiver.enabled,global.sub-system.archiver.enabled
......@@ -20,6 +20,14 @@ global:
image: tango-dsconfig
tag: 1.5.0
pullPolicy: IfNotPresent
# by setting this parameter we can disable the lower level sub-system tango-base, archiver and webjive
# sub-system:
# tango-base:
# enabled: false
# archiver:
# enabled: false
# webjive:
# enabled: false
tango-base:
itango:
......@@ -35,4 +43,3 @@ tango-base:
ingress:
enabled: true
hostname: tango-base.minikube.local
......@@ -2,5 +2,9 @@ apiVersion: v2
appVersion: "1.0"
description: A Helm chart for deploying the TANGO base system on Kubernetes
name: tango-base
version: 0.2.0
version: 0.2.1
icon: https://www.skatelescope.org/wp-content/uploads/2016/07/09545_NEW_LOGO_2014.png
dependencies:
- name: tango-util
version: 0.2.0
repository: file://../tango-util
\ No newline at end of file
dependencies:
- name: tango-util
repository: file:///home/ubuntu/ska-docker/charts/tango-util
version: 0.1.0
digest: sha256:a2faecd91edca175823640f5a28f6d467481fc2139ec44ea8a67e39409f6cf93
generated: "2020-09-10T14:40:38.2031008Z"
......@@ -3,7 +3,7 @@ entries:
ska-docker:
- apiVersion: v2
appVersion: "1.0"
created: "2020-09-16T14:35:46.411669622Z"
created: "2020-09-24T14:22:01.30783136Z"
dependencies:
- name: tango-util
repository: file://../tango-util
......@@ -21,4 +21,4 @@ entries:
urls:
- ska-docker-0.1.2.tgz
version: 0.1.2
generated: "2020-09-16T14:35:46.40556769Z"
generated: "2020-09-24T14:22:01.300552941Z"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment