Add app support for FluxCD: snmp
Add new manifest files to the snmp app to enable FluxCD support. Test Plan: - build, ISO image includes in progress fluxcd commits - verify the armada app version of snmp - verify the fluxcd app version of snmp - test snmpwalk for 2c and 3 snmp version - debian: build-pkgs -p stx-snmp-helm Story: 2009138 Task: 45143 Signed-off-by: Giana Francisco <francisco.giana@windriver.com> Change-Id: I14bc6ba4ede2fa4e470d5a6ef64fbca2d7e09ef2
This commit is contained in:
parent
fc80862cd7
commit
81b70ae24a
@ -1 +1,2 @@
|
|||||||
stx-snmp-helm
|
stx-snmp-helm
|
||||||
|
stx-snmp-helm-fluxcd
|
||||||
|
@ -31,6 +31,14 @@ BuildRequires: python-k8sapp-snmp-wheels
|
|||||||
%description
|
%description
|
||||||
StarlingX SNMP Helm Charts
|
StarlingX SNMP Helm Charts
|
||||||
|
|
||||||
|
%package fluxcd
|
||||||
|
Summary: StarlingX SNMP FluxCD Helm Charts
|
||||||
|
Group: base
|
||||||
|
License: Apache-2.0
|
||||||
|
|
||||||
|
%description fluxcd
|
||||||
|
StarlingX SNMP FluxCD Helm Charts
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -n helm-charts-snmp-0-1-0-1.0.0
|
%setup -n helm-charts-snmp-0-1-0-1.0.0
|
||||||
|
|
||||||
@ -38,11 +46,14 @@ StarlingX SNMP Helm Charts
|
|||||||
|
|
||||||
cd helm-charts
|
cd helm-charts
|
||||||
make
|
make
|
||||||
|
|
||||||
|
# switch back to source root
|
||||||
cd -
|
cd -
|
||||||
|
|
||||||
# Create a chart tarball compliant with sysinv kube-app.py
|
# Create a chart tarball compliant with sysinv kube-app.py
|
||||||
%define app_staging %{_builddir}/staging
|
%define app_staging %{_builddir}/staging
|
||||||
%define app_tarball %{app_name}-%{version}-%{tis_patch_ver}.tgz
|
%define app_tarball %{app_name}-%{version}-%{tis_patch_ver}.tgz
|
||||||
|
%define app_tarball_fluxcd %{app_name}-fluxcd-%{version}-%{tis_patch_ver}.tgz
|
||||||
|
|
||||||
# Setup staging
|
# Setup staging
|
||||||
mkdir -p %{app_staging}
|
mkdir -p %{app_staging}
|
||||||
@ -50,9 +61,9 @@ cp files/metadata.yaml %{app_staging}
|
|||||||
cp manifests/*.yaml %{app_staging}
|
cp manifests/*.yaml %{app_staging}
|
||||||
mkdir -p %{app_staging}/charts
|
mkdir -p %{app_staging}/charts
|
||||||
cp helm-charts/*.tgz %{app_staging}/charts
|
cp helm-charts/*.tgz %{app_staging}/charts
|
||||||
cd %{app_staging}
|
|
||||||
|
|
||||||
# Populate metadata
|
# Populate metadata
|
||||||
|
cd %{app_staging}
|
||||||
sed -i 's/@APP_NAME@/%{app_name}/g' %{app_staging}/metadata.yaml
|
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/@APP_VERSION@/%{version}-%{tis_patch_ver}/g' %{app_staging}/metadata.yaml
|
||||||
sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
|
sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
|
||||||
@ -61,17 +72,37 @@ sed -i 's/@HELM_REPO@/%{helm_repo}/g' %{app_staging}/metadata.yaml
|
|||||||
mkdir -p %{app_staging}/plugins
|
mkdir -p %{app_staging}/plugins
|
||||||
cp /plugins/%{app_name}/*.whl %{app_staging}/plugins
|
cp /plugins/%{app_name}/*.whl %{app_staging}/plugins
|
||||||
|
|
||||||
# package it up
|
# calculate checksum of all files in app_staging
|
||||||
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
|
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
|
||||||
|
# package it up
|
||||||
tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ .
|
tar -zcf %{_builddir}/%{app_tarball} -C %{app_staging}/ .
|
||||||
|
|
||||||
|
# switch back to source root
|
||||||
|
cd -
|
||||||
|
|
||||||
|
# Prepare app_staging for fluxcd package
|
||||||
|
rm -f %{app_staging}/snmp_manifest.yaml
|
||||||
|
|
||||||
|
cp -R fluxcd-manifests %{app_staging}/
|
||||||
|
|
||||||
|
# calculate checksum of all files in app_staging
|
||||||
|
cd %{app_staging}
|
||||||
|
find . -type f ! -name '*.md5' -print0 | xargs -0 md5sum > checksum.md5
|
||||||
|
# package fluxcd app
|
||||||
|
tar -zcf %{_builddir}/%{app_tarball_fluxcd} -C %{app_staging}/ .
|
||||||
|
|
||||||
|
# switch back to source root
|
||||||
|
cd -
|
||||||
|
|
||||||
# Cleanup staging
|
# Cleanup staging
|
||||||
rm -fr %{app_staging}
|
rm -fr %{app_staging}
|
||||||
|
|
||||||
%install
|
%install
|
||||||
install -d -m 755 %{buildroot}/%{app_folder}
|
install -d -m 755 %{buildroot}/%{app_folder}
|
||||||
install -p -D -m 755 %{_builddir}/%{app_tarball} %{buildroot}/%{app_folder}
|
install -p -D -m 755 %{_builddir}/%{app_tarball} %{buildroot}/%{app_folder}
|
||||||
|
install -p -D -m 755 %{_builddir}/%{app_tarball_fluxcd} %{buildroot}/%{app_folder}
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%{app_folder}/*
|
%{app_folder}/%{app_tarball}
|
||||||
|
%{app_folder}/%{app_tarball_fluxcd}
|
||||||
|
@ -0,0 +1,13 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
apiVersion: source.toolkit.fluxcd.io/v1beta1
|
||||||
|
kind: HelmRepository
|
||||||
|
metadata:
|
||||||
|
name: stx-platform
|
||||||
|
spec:
|
||||||
|
url: http://192.168.206.1:8080/helm_charts/stx-platform
|
||||||
|
interval: 60m
|
@ -0,0 +1,8 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- helmrepository.yaml
|
@ -0,0 +1,10 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: kube-system
|
@ -0,0 +1,11 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
namespace: kube-system
|
||||||
|
resources:
|
||||||
|
- base
|
||||||
|
- snmp
|
@ -0,0 +1,36 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
apiVersion: "helm.toolkit.fluxcd.io/v2beta1"
|
||||||
|
kind: HelmRelease
|
||||||
|
metadata:
|
||||||
|
name: snmp
|
||||||
|
labels:
|
||||||
|
chart_group: snmp
|
||||||
|
spec:
|
||||||
|
releaseName: ns-snmp
|
||||||
|
chart:
|
||||||
|
spec:
|
||||||
|
chart: snmp
|
||||||
|
version: 1.0.0
|
||||||
|
sourceRef:
|
||||||
|
kind: HelmRepository
|
||||||
|
name: stx-platform
|
||||||
|
interval: 5m
|
||||||
|
timeout: 30m
|
||||||
|
test:
|
||||||
|
enable: false
|
||||||
|
install:
|
||||||
|
disableHooks: false
|
||||||
|
upgrade:
|
||||||
|
disableHooks: false
|
||||||
|
valuesFrom:
|
||||||
|
- kind: Secret
|
||||||
|
name: snmp-static-overrides
|
||||||
|
valuesKey: snmp-static-overrides.yaml
|
||||||
|
- kind: Secret
|
||||||
|
name: snmp-system-overrides
|
||||||
|
valuesKey: snmp-system-overrides.yaml
|
@ -0,0 +1,18 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
||||||
|
namespace: kube-system
|
||||||
|
resources:
|
||||||
|
- helmrelease.yaml
|
||||||
|
secretGenerator:
|
||||||
|
- name: snmp-static-overrides
|
||||||
|
files:
|
||||||
|
- snmp-static-overrides.yaml
|
||||||
|
- name: snmp-system-overrides
|
||||||
|
files:
|
||||||
|
- snmp-system-overrides.yaml
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
@ -0,0 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
@ -0,0 +1,6 @@
|
|||||||
|
#
|
||||||
|
# Copyright (c) 2022 Wind River Systems, Inc.
|
||||||
|
#
|
||||||
|
# SPDX-License-Identifier: Apache-2.0
|
||||||
|
#
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user