Browse Source

Initial portieris-armada-app deliverable

This commit introduces the stx-portieris armada app, which is built
through build-helm-charts.sh, which is to be manually uploaded and
applied.

In order to build this app, the portieris-helm and stx-portieris-helm
packages are introduced, with portieris-helm repackaging the helm
charts from upstream portieris, and stx-portieris-helm packaging these
charts to be built into an armada app.

These packages are not included as part of an iso install, so will have
no affect unless the armada application is uploaded.

Placeholder certificates are currently included, and should be removed
once cert-manager integration is complete.  This is unsuitable for a
real-world deployment, and should not be used in production, due to
the availability of the private key to an attacker.

Change-Id: I806063c0f561a20808b4cbc4c4a561be5c806c5b
Story: 2007348
Task: 39597
Signed-off-by: Joseph Richard <joseph.richard@windriver.com>
changes/21/724921/3
Joseph Richard 1 year ago
parent
commit
b2f895c371
21 changed files with 369 additions and 0 deletions
  1. +1
    -0
      centos_build_layer.cfg
  2. +2
    -0
      centos_pkg_dirs
  3. +2
    -0
      centos_pkg_dirs_containers
  4. +1
    -0
      centos_tarball-dl.lst
  5. +8
    -0
      portieris-helm/centos/build_srpm.data
  6. +91
    -0
      portieris-helm/centos/portieris-helm.spec
  7. +19
    -0
      portieris-helm/files/caCert.pem
  8. +1
    -0
      portieris-helm/files/caCert.srl
  9. +3
    -0
      portieris-helm/files/index.yaml
  10. +0
    -0
      portieris-helm/files/metadata.yaml
  11. +12
    -0
      portieris-helm/files/repositories.yaml
  12. +18
    -0
      portieris-helm/files/serverCert.pem
  13. +27
    -0
      portieris-helm/files/serverKey.pem
  14. +5
    -0
      portieris-helm/portieris/README
  15. +3
    -0
      stx-portieris-helm/centos/build_srpm.data
  16. +99
    -0
      stx-portieris-helm/centos/stx-portieris-helm.spec
  17. +5
    -0
      stx-portieris-helm/stx-portieris-helm/README
  18. +3
    -0
      stx-portieris-helm/stx-portieris-helm/files/index.yaml
  19. +5
    -0
      stx-portieris-helm/stx-portieris-helm/files/metadata.yaml
  20. +12
    -0
      stx-portieris-helm/stx-portieris-helm/files/repositories.yaml
  21. +52
    -0
      stx-portieris-helm/stx-portieris-helm/manifests/manifest.yaml

+ 1
- 0
centos_build_layer.cfg View File

@ -0,0 +1 @@
flock

+ 2
- 0
centos_pkg_dirs View File

@ -0,0 +1,2 @@
portieris-helm
stx-portieris-helm

+ 2
- 0
centos_pkg_dirs_containers View File

@ -0,0 +1,2 @@
portieris-helm
stx-portieris-helm

+ 1
- 0
centos_tarball-dl.lst View File

@ -0,0 +1 @@
portieris-0.6.0.tgz#portieris#https://github.com/IBM/portieris/archive/0.6.0.tar.gz#http##

+ 8
- 0
portieris-helm/centos/build_srpm.data View File

@ -0,0 +1,8 @@
TAR_NAME=portieris
VERSION=0.6.0
TAR="$TAR_NAME-$VERSION.tgz"
COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* "
TIS_PATCH_VER=1

+ 91
- 0
portieris-helm/centos/portieris-helm.spec View File

@ -0,0 +1,91 @@
# Application tunables (maps to metadata)
%global app_name stx-portieris
%global helm_repo starlingx
#%global helm_folder /usr/lib/helm
#%global armada_folder /usr/lib/armada
#%global app_folder /usr/local/share/applications/helm
# Install location
%global app_folder /usr/local/share/applications/helm
# Build variables
%global helm_folder /usr/lib/helm
Summary: StarlingX portieris Helm charts
Name: portieris-helm
Version: 0.6.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: Wind River <info@windriver.com>
URL: unknown
Source0: portieris-%{version}.tgz
Source1: repositories.yaml
Source2: index.yaml
Source3: caCert.pem
Source4: caCert.srl
Source5: serverCert.pem
Source6: serverKey.pem
BuildArch: noarch
BuildRequires: helm
%description
StarlingX portieris charts
%prep
%setup -n portieris
%build
# initialize helm
# helm init --client-only does not work if there is no networking
# The following commands do essentially the same as: helm init
%define helm_home %{getenv:HOME}/.helm
mkdir %{helm_home}
mkdir %{helm_home}/repository
mkdir %{helm_home}/repository/cache
mkdir %{helm_home}/repository/local
mkdir %{helm_home}/plugins
mkdir %{helm_home}/starters
mkdir %{helm_home}/cache
mkdir %{helm_home}/cache/archive
# Stage a repository file that only has a local repo
cp %{SOURCE1} %{helm_home}/repository/repositories.yaml
# Stage a local repo index that can be updated by the build
cp %{SOURCE2} %{helm_home}/repository/local/index.yaml
# Host a server for the charts
helm serve --repo-path . &
helm repo rm local
helm repo add local http://localhost:8879/charts
# Create a chart tarball compliant with sysinv kube-app.py
%define app_staging %{_builddir}/staging
%define app_tarball portieris-%{version}.tgz
# Make the charts. These produce a tgz file
make helm.package
cd %{_builddir}/portieris
tar -xvf %{app_tarball}
mkdir $PWD/portieris/certs
cp %{SOURCE3} $PWD/portieris/certs
cp %{SOURCE4} $PWD/portieris/certs
cp %{SOURCE5} $PWD/portieris/certs
cp %{SOURCE6} $PWD/portieris/certs
tar -zcf %{app_tarball} portieris
cd -
# Terminate helm server (the last backgrounded task)
kill %1
%install
install -d -m 755 ${RPM_BUILD_ROOT}%{helm_folder}
install -p -D -m 755 %{_builddir}/portieris/%{app_tarball} ${RPM_BUILD_ROOT}%{helm_folder}
%files
%defattr(-,root,root,-)
%{helm_folder}/*

+ 19
- 0
portieris-helm/files/caCert.pem View File

@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDAzCCAeugAwIBAgIJAPM3ehKOEOZWMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV
BAMMDHBvcnRpZXJpc19jYTAgFw0yMDA0MzAwMTE4MDBaGA8yMjk0MDIxMzAxMTgw
MFowFzEVMBMGA1UEAwwMcG9ydGllcmlzX2NhMIIBIjANBgkqhkiG9w0BAQEFAAOC
AQ8AMIIBCgKCAQEAwC+YN0JGTFq2fpqi4AGq6P5uzjJDON/LYHzh93McA44MZAzj
I5LnDKmnPpQsXkvzwnUAldNjOgH9dUo4URw5lq5br9cTP7hVUzrdoUxOr7nsk/N8
gviO1mEIDZXSYoJBMd6wizOBy7mO+Upf5luaxty2AC5/GKI7BemlCC2FH6+ioYC/
lOYNHEWrF2HExHWnEhu9L3lWPqL4ulmMUOJ3PH4UQHkT6mhnODgPP1kddCOjvUrn
YRbovU5T65PoQd8/ImSOgKV2vpNO5a8oRmPwoXyqESbMDLGhEsGvMk99DYYtID+x
HRPcl2vnZnX4IpTr29SEyc7z/gjQoUYEgZ0RJwIDAQABo1AwTjAdBgNVHQ4EFgQU
/+5P9my7zIYeyyc9afQjVNhEudwwHwYDVR0jBBgwFoAU/+5P9my7zIYeyyc9afQj
VNhEudwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEAEhzqqz2c2CKD
cAuhijmW6f+bOQZBLMz6GS+N20MhTgWBPXeoeFBwK+P2ukTOJXbOUu9VSmH8NdsW
7cLQgyjKDOVQUTtgtuOgZyng3H9Fp1SzRDmj3SX/lS+bfX7B6CSJ28NKhhIvAQC/
adsIHZv7ef8dsE4v9sojyJIpSQVnrhtMwlOL2/lOMHbYtwBg0e/Fgipqhzb2O4GJ
1aNayHIZTAsKdNxBmQ1oXdioSnj+zTP5Mhiwa9oup+w9gfHPc//FKUCqIPQINky8
naXwE+J8yjWG+HVWbFN33cO3uPS2IbX1BJaY+kfCaLv0X5KoTRlXcx4Y6WbfDuth
P1gM9y9/NA==
-----END CERTIFICATE-----

+ 1
- 0
portieris-helm/files/caCert.srl View File

@ -0,0 +1 @@
9EB4619C5A555553

+ 3
- 0
portieris-helm/files/index.yaml View File

@ -0,0 +1,3 @@
apiVersion: v1
entries: {}
generated: 2019-01-07T12:33:46.098166523-06:00

+ 0
- 0
portieris-helm/files/metadata.yaml View File


+ 12
- 0
portieris-helm/files/repositories.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
generated: 2019-01-02T15:19:36.215111369-06:00
repositories:
- caFile: ""
cache: /builddir/.helm/repository/cache/local-index.yaml
certFile: ""
keyFile: ""
name: local
password: ""
url: http://127.0.0.1:8879/charts
username: ""

+ 18
- 0
portieris-helm/files/serverCert.pem View File

@ -0,0 +1,18 @@
-----BEGIN CERTIFICATE-----
MIIC+TCCAeGgAwIBAgIJAJ60YZxaVVVTMA0GCSqGSIb3DQEBCwUAMBcxFTATBgNV
B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Uaj+MCgYEA2cIqCh0zAbyPVx/+iF3m
oRNE1gyHW9/x3VU4dTRHlYp8g8+QIkw5cr/TydgQ9UA9TEIM8looWORofni8RUKb
4T+Drer9mdys8Di0F0v4HD135vQ7BJ/ewMGa1FzDHjMzJlc/bQ/42rJbskcY1Qgs
JkBaqtAAJyZLhwugDYslBu8CgYB7gEYRF9gL5TibqHF3Ao3tItgKCzXS7fz1hO4v
gS2Xp0tU49bEQSgyNt7+27WHdH0YHGF7vYheCR46XDjPW57iOF/UwNDxQhsCwzfC
OcU7hfZsHAFiTRF6Ms9XLrIFD1VHlwMBr6pqyE45Mo497SIEboJ8uqg/DJ81cyjJ
4K8bXQKBgB+bNhkscllp0wbkB554sY8M2UatPkmZ8iic7zpw+q+enxPDwXiCQADl
EruzbZxHClimju+lnpdamY0Ox6hPyv1H9uENL275kO8zXRljVOqSayRUH1XHwnW5
0mxxe0uFxosui/6mogq3wOsLwVsHj39vWqKE7/frwfb/PZHuvHCe
-----END RSA PRIVATE KEY-----

+ 5
- 0
portieris-helm/portieris/README View File

@ -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.

+ 3
- 0
stx-portieris-helm/centos/build_srpm.data View File

@ -0,0 +1,3 @@
SRC_DIR="stx-portieris-helm"
TIS_PATCH_VER=0

+ 99
- 0
stx-portieris-helm/centos/stx-portieris-helm.spec View File

@ -0,0 +1,99 @@
# Application tunables (maps to metadata)
%global app_name stx-portieris
%global helm_repo starlingx
%global helm_folder /usr/lib/helm
%global armada_folder /usr/lib/armada
%global app_folder /usr/local/share/applications/helm
%global toolkit_version 0.1.0
%global helmchart_version 0.1.0
Summary: StarlingX Portieris Armada Helm Charts
Name: stx-portieris-helm
Version: 1.0
Release: %{tis_patch_ver}%{?_tis_dist}
License: Apache-2.0
Group: base
Packager: Wind River <info@windriver.com>
URL: unknown
Source0: %{name}-%{version}.tar.gz
BuildArch: noarch
BuildRequires: helm
BuildRequires: portieris-helm
Requires: portieris-helm
%description
StarlingX Portieris Armada Helm Charts
%prep
%setup
%build
# initialize helm and build the toolkit
# helm init --client-only does not work if there is no networking
# The following commands do essentially the same as: helm init
%define helm_home %{getenv:HOME}/.helm
mkdir %{helm_home}
mkdir %{helm_home}/repository
mkdir %{helm_home}/repository/cache
mkdir %{helm_home}/repository/local
mkdir %{helm_home}/plugins
mkdir %{helm_home}/starters
mkdir %{helm_home}/cache
mkdir %{helm_home}/cache/archive
# Stage a repository file that only has a local repo
cp files/repositories.yaml %{helm_home}/repository/repositories.yaml
# Stage a local repo index that can be updated by the build
cp files/index.yaml %{helm_home}/repository/local/index.yaml
# Host a server for the charts
helm serve --repo-path . &
helm repo rm local
helm repo add local http://localhost:8879/charts
# terminate helm server (the last backgrounded task)
kill %1
# Create a chart tarball compliant with sysinv kube-app.py
%define app_staging %{_builddir}/staging
%define app_tarball %{app_name}-%{version}-%{tis_patch_ver}.tgz
# Setup staging
mkdir -p %{app_staging}
cp files/metadata.yaml %{app_staging}
cp manifests/*.yaml %{app_staging}
mkdir -p %{app_staging}/charts
#cp helm-charts/*.tgz %{app_staging}/charts
cp %{helm_folder}/portieris*.tgz %{app_staging}/charts
cd %{app_staging}
# Populate metadata
sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml
sed -i 's/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml
sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
# package it up
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ .
# Cleanup staging
rm -fr %{app_staging}
%install
install -d -m 755 %{buildroot}/%{app_folder}
install -p -D -m 755 %{_builddir}/%{app_tarball} %{buildroot}/%{app_folder}
install -d -m 755 %{buildroot}/%{helm_folder}
install -p -D -m 755 %{helm_folder}/portieris*.tgz %{buildroot}/%{helm_folder}
install -d -m 755 %{buildroot}/%{armada_folder}
install -p -D -m 755 manifests/*.yaml %{buildroot}/%{armada_folder}
%files
%defattr(-,root,root,-)
%{helm_folder}/*
%{armada_folder}/*
%{app_folder}/*

+ 5
- 0
stx-portieris-helm/stx-portieris-helm/README View File

@ -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 common charts.

+ 3
- 0
stx-portieris-helm/stx-portieris-helm/files/index.yaml View File

@ -0,0 +1,3 @@
apiVersion: v1
entries: {}
generated: 2019-01-07T12:33:46.098166523-06:00

+ 5
- 0
stx-portieris-helm/stx-portieris-helm/files/metadata.yaml View File

@ -0,0 +1,5 @@
maintain_user_overrides: true
app_name: @APP_NAME@
app_version: @APP_VERSION@
helm_repo: @HELM_REPO@

+ 12
- 0
stx-portieris-helm/stx-portieris-helm/files/repositories.yaml View File

@ -0,0 +1,12 @@
apiVersion: v1
generated: 2019-01-02T15:19:36.215111369-06:00
repositories:
- caFile: ""
cache: /builddir/.helm/repository/cache/local-index.yaml
certFile: ""
keyFile: ""
name: local
password: ""
url: http://127.0.0.1:8879/charts
username: ""

+ 52
- 0
stx-portieris-helm/stx-portieris-helm/manifests/manifest.yaml View File

@ -0,0 +1,52 @@
---
schema: armada/Chart/v1
metadata:
schema: metadata/Document/v1
name: portieris
data:
chart_name: portieris
release: portieris
namespace: default
wait:
timeout: 300
labels:
app: portieris
install:
no_hooks: false
upgrade:
no_hooks: false
source:
type: tar
location: http://172.17.0.1/helm_charts/starlingx/portieris-0.6.0.tgz
subpath: portieris
reference: master
dependencies: []
values:
namespace: default
images:
tags:
portieris: docker.io/ibmcom/portieris:0.6.0
image:
host: docker.io/ibmcom
image: portieris
tags: 0.6.0
IBMContainerService: false
---
schema: armada/ChartGroup/v1
metadata:
schema: metadata/Document/v1
name: portieris
data:
description: "StarlingX Portieris"
sequenced: true
chart_group:
- portieris
---
schema: armada/Manifest/v1
metadata:
schema: metadata/Document/v1
name: portieris-manifest
data:
release_prefix: 'stx'
chart_groups:
- portieris

Loading…
Cancel
Save