diff --git a/kubernetes/README b/kubernetes/README index 672912dd73..533a957b3d 100644 --- a/kubernetes/README +++ b/kubernetes/README @@ -2,16 +2,38 @@ The expected layout for this subdirectory is as follows: kubernetes |-- applications -| `-- stx-openstack -| `-- manifest.yaml +| `-- +| `-- -helm RPM +| `-- centos +| `-- build_srpm.data +| `-- -helm.spec +| `-- -helm +| `-- manifests +| `-- main-manifest.yaml +| `-- alt-manifest-1.yaml +| `-- ... +| `-- alt-manifest-N.yaml +| `-- custom chart 1 +| `-- Chart.yaml +| `-- ... +| `-- ... +| `-- custom chart N +| `-- Chart.yaml +| `-- ... |-- helm-charts -| `-- placeholder -| `-- placeholder.txt +| `-- chart +| `-- chart `-- README -The idea is that all our custom helm charts would go under "helm-charts". Each -chart would get a subdirectory. +The idea is that all our custom helm charts that are common across applications +would go under "helm-charts". Each chart would get a subdirectory. -Custom applications would generally consist of an armada manifest referencing -multiple helm charts (both ours and upstream ones). These applications would -each get their own subdirectory under "applications". +Custom applications would generally consist of one or more armada manifest +referencing multiple helm charts (both ours and upstream ones). The application +is packaged as an RPM. These application RPM are used to produce the build +artifacts (helm tarballs + armada manifests) but are not installed on the +system. These artifacts are extracted later for proper application packaging +with additional required metadata (TBD). + +These applications would each get their own subdirectory under +"applications". diff --git a/kubernetes/applications/stx-openstack/stx-openstack-helm/centos/build_srpm.data b/kubernetes/applications/stx-openstack/stx-openstack-helm/centos/build_srpm.data new file mode 100644 index 0000000000..5fb9f681ab --- /dev/null +++ b/kubernetes/applications/stx-openstack/stx-openstack-helm/centos/build_srpm.data @@ -0,0 +1,2 @@ +SRC_DIR="stx-openstack-helm" +TIS_PATCH_VER=1 diff --git a/kubernetes/applications/stx-openstack/stx-openstack-helm/centos/stx-openstack-helm.spec b/kubernetes/applications/stx-openstack/stx-openstack-helm/centos/stx-openstack-helm.spec new file mode 100644 index 0000000000..80e5d0cd7e --- /dev/null +++ b/kubernetes/applications/stx-openstack/stx-openstack-helm/centos/stx-openstack-helm.spec @@ -0,0 +1,54 @@ +%global helm_folder /usr/lib/helm +%global armada_folder /usr/lib/armada +%global toolkit_version 0.1.0 +%global helmchart_version 0.1.0 + +Summary: StarlingX Openstack Application Helm charts +Name: stx-openstack-helm +Version: 1.0 +Release: %{tis_patch_ver}%{?_tis_dist} +License: Apache-2.0 +Group: base +Packager: Wind River +URL: unknown + +Source0: %{name}-%{version}.tar.gz +BuildArch: noarch + +BuildRequires: helm +BuildRequires: openstack-helm-infra +Requires: openstack-helm-infra + +%description +StarlingX Openstack Application Helm charts + +%prep +%setup + +%build +# initialize helm and stage the toolkit +helm init --client-only +# Host a server for the charts +cp %{helm_folder}/helm-toolkit-%{toolkit_version}.tgz . +helm serve --repo-path . & +helm repo rm local +helm repo add local http://localhost:8879/charts + +# Make the charts. These produce a tgz file +make nova-api-proxy + +# remove helm-toolkit. This will be packaged with openstack-helm-infra +rm ./helm-toolkit-%{toolkit_version}.tgz + +%install +# helm_folder is created by openstack-helm-infra +install -d -m 755 ${RPM_BUILD_ROOT}%{helm_folder} +install -p -D -m 755 *.tgz ${RPM_BUILD_ROOT}%{helm_folder} +install -d -m 755 ${RPM_BUILD_ROOT}%{armada_folder} +install -p -D -m 755 manifests/*.yaml ${RPM_BUILD_ROOT}%{armada_folder} + +%files +#helm_folder is owned by openstack-helm-infra +%defattr(-,root,root,-) +%{helm_folder}/* +%{armada_folder}/* diff --git a/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/Makefile b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/Makefile new file mode 100644 index 0000000000..5cf4447e12 --- /dev/null +++ b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/Makefile @@ -0,0 +1,43 @@ +# +# Copyright 2017 The Openstack-Helm Authors. +# +# Copyright (c) 2018 Wind River Systems, Inc. +# +# SPDX-License-Identifier: Apache-2.0 +# +# It's necessary to set this because some environments don't link sh -> bash. +SHELL := /bin/bash +TASK := build + +EXCLUDES := helm-toolkit doc tests tools logs tmp +CHARTS := helm-toolkit $(filter-out $(EXCLUDES), $(patsubst %/.,%,$(wildcard */.))) + +.PHONY: $(EXCLUDES) $(CHARTS) + +all: $(CHARTS) + +$(CHARTS): + @if [ -d $@ ]; then \ + echo; \ + echo "===== Processing [$@] chart ====="; \ + make $(TASK)-$@; \ + fi + +init-%: + if [ -f $*/Makefile ]; then make -C $*; fi + if [ -f $*/requirements.yaml ]; then helm dep up $*; fi + +lint-%: init-% + if [ -d $* ]; then helm lint $*; fi + +build-%: lint-% + if [ -d $* ]; then helm package $*; fi + +clean: + @echo "Clean all build artifacts" + rm -f */templates/_partials.tpl */templates/_globals.tpl + rm -f *tgz */charts/*tgz */requirements.lock + rm -rf */charts */tmpcharts + +%: + @: diff --git a/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/README b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/README new file mode 100644 index 0000000000..4ad6110183 --- /dev/null +++ b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/README @@ -0,0 +1,5 @@ +This directory contains all StarlingX charts that need to be built for this +application. Some charts are common across applications. These common charts +reside in the stx-config/kubernetes/helm-charts directory. To include these in +this application update the build_srpm.data file and use the COPY_LIST_TO_TAR +mechanism to populate these commom charts. diff --git a/kubernetes/applications/stx-openstack/manifest.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml similarity index 100% rename from kubernetes/applications/stx-openstack/manifest.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/manifests/manifest.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/Chart.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/Chart.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/Chart.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/Chart.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/requirements.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/requirements.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/requirements.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/requirements.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/bin/_nova-api-proxy.sh.tpl b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/bin/_nova-api-proxy.sh.tpl similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/bin/_nova-api-proxy.sh.tpl rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/bin/_nova-api-proxy.sh.tpl diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/configmap-bin.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/configmap-bin.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/configmap-bin.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/configmap-bin.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/configmap-etc.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/configmap-etc.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/configmap-etc.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/configmap-etc.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/deployment.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/deployment.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/deployment.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/deployment.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/image_repo_sync.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/image_repo_sync.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/image_repo_sync.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/image_repo_sync.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/ingress.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/ingress.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/ingress.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/ingress.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/job-ks-endpoints.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/job-ks-endpoints.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/job-ks-endpoints.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/job-ks-endpoints.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/secret-ingress-tls.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/secret-ingress-tls.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/secret-ingress-tls.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/secret-ingress-tls.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/secret-keystone.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/secret-keystone.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/secret-keystone.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/secret-keystone.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/templates/service.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/service.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/templates/service.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/templates/service.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/values.yaml b/kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/values.yaml similarity index 100% rename from kubernetes/helm-charts/nova-api-proxy/values.yaml rename to kubernetes/applications/stx-openstack/stx-openstack-helm/stx-openstack-helm/nova-api-proxy/values.yaml diff --git a/kubernetes/helm-charts/nova-api-proxy/charts/helm-toolkit-0.1.0.tgz b/kubernetes/helm-charts/nova-api-proxy/charts/helm-toolkit-0.1.0.tgz deleted file mode 100644 index 65f25969d2..0000000000 Binary files a/kubernetes/helm-charts/nova-api-proxy/charts/helm-toolkit-0.1.0.tgz and /dev/null differ diff --git a/tox.ini b/tox.ini index 48cee9974e..8f375d7d54 100644 --- a/tox.ini +++ b/tox.ini @@ -26,7 +26,9 @@ commands = -i E006,E010" bash -c "find {toxinidir} \ - \( -name .tox -o -path {toxinidir}/kubernetes/helm-charts -prune \) \ + \( -name .tox \ + -o -path {toxinidir}/kubernetes/applications -prune \ + -o -path {toxinidir}/kubernetes/helm-charts -prune \) \ -o -type f -name '*.yaml' \ -print0 | xargs -0 yamllint -f parsable \ -c {toxinidir}/.yamllint"