Jump to: navigation, search

StarlingX/Containers/Applications/HowToAddNewFluxCDAppInSTX

< StarlingX‎ | Containers‎ | Applications
Revision as of 14:25, 9 November 2022 by Leonardo.FagundesLuzSerrano (talk | contribs) (Added info on how to patch an upstream app's charts and a link to info on the fluxCD file structure for STX apps)

This page details steps required to add a new system-managed application's FluxCD Helm charts in StarlingX.

Most of the information for creating a new repo from How to Add New Armada App in STX are still applicable except for the FluxCD directory structure. Start with these steps to create the new repo. The recommended repo naming convention is now: app-<your-app-name>

Example review for creating a new app repo:

Please note that Starlingx is in the process of transitioning from Centos to Debian, with Centos becoming deprecated by the end of 2022. In order to a build STX packages and applications, the developer will need to set up the StarlingX Debian Build Environment. For general information on both the Armada and FluxCD file structures used in STX, please view this page StarlingX/Containers/ConvertingArmadaAppsToFluxCD.


Create FluxCD app

Create a top-level folder for the new app under cgcs-root/stx folder.

In the main app folder, create a centos_tarball-dl.lst file with same content as the one from Step 1 above. Note that the filename is important for this step to work.

$ pwd
/localdisk/designer/<user>/starlingx_master/cgcs-root/stx/app-istio
$ cat centos_tarball-dl.lst
helm-charts-istio-1.13.2.tar.gz#helm-charts-istio#https://github.com/istio/istio/archive/refs/tags/1.13.2.tar.gz#http##
helm-charts-kiali-1.45.0.tar.gz#helm-charts-kiali#https://github.com/kiali/helm-charts/archive/refs/tags/v1.45.0.tar.gz#http##

It is recommended to start off copying another app code structure as starting point and then make necessary changes to various configuration build & configuration files.

Example review for adding a new FluxCD app:

As an overview, this is the directory structure for app-istio:

├── centos_build_layer.cfg
├── centos_iso_image.inc
├── centos_pkg_dirs
├── centos_pkg_dirs_containers
├── centos_stable_docker_images.inc
├── centos_tarball-dl.lst
├── CONTRIBUTING.rst
├── debian_build_layer.cfg
├── debian_pkg_dirs
├── HACKING.rst
├── istio-helm
│   ├── centos
│   │   ├── build_srpm.data
│   │   ├── istio-helm.spec
│   │   └── istio_proxy.stable_docker_image
│   ├── debian
│   │   ├── deb_folder
│   │   │   ├── changelog
│   │   │   ├── control
│   │   │   ├── copyright
│   │   │   ├── istio-helm.install
│   │   │   ├── rules
│   │   │   └── source
│   │   │       └── format
│   │   └── meta_data.yaml
│   └── files
│       ├── index.yaml
│       ├── Makefile
│       ├── metadata.yaml
│       └── repositories.yaml
├── kiali-helm
│   ├── centos
│   │   ├── build_srpm.data
│   │   ├── kiali-helm.spec
│   │   └── kiali.stable_docker_image
│   ├── debian
│   │   ├── deb_folder
│   │   │   ├── changelog
│   │   │   ├── control
│   │   │   ├── copyright
│   │   │   ├── kiali-helm.install
│   │   │   ├── rules
│   │   │   └── source
│   │   │       └── format
│   │   └── meta_data.yaml
│   └── files
│       ├── index.yaml
│       ├── Makefile
│       ├── metadata.yaml
│       └── repositories.yaml
├── python-k8sapp-istio
│   ├── centos
│   │   ├── build_srpm.data
│   │   └── python-k8sapp-istio.spec
│   ├── debian
│   │   ├── deb_folder
│   │   │   ├── changelog
│   │   │   ├── control
│   │   │   ├── copyright
│   │   │   ├── python3-k8sapp-istio.install
│   │   │   ├── python3-k8sapp-istio-wheels.install
│   │   │   ├── rules
│   │   │   └── source
│   │   │       └── format
│   │   └── meta_data.yaml
│   └── k8sapp_istio
│       ├── AUTHORS
│       ├── ChangeLog
│       ├── k8sapp_istio
│       │   ├── common
│       │   │   ├── constants.py
│       │   │   └── __init__.py
│       │   ├── helm
│       │   │   ├── __init__.py
│       │   │   ├── istio_operator.py
│       │   │   └── kiali_server.py
│       │   ├── __init__.py
│       │   └── tests
│       │       ├── __init__.py
│       │       ├── test_istio.py
│       │       └── test_plugins.py
│       ├── LICENSE
│       ├── pylint.rc
│       ├── README.rst
│       ├── requirements.txt
│       ├── setup.cfg
│       ├── setup.py
│       ├── test-requirements.txt
│       ├── tox.ini
│       └── upper-constraints.txt
├── requirements.txt
├── stx-istio-helm
│   ├── centos
│   │   ├── build_srpm.data
│   │   └── stx-istio-helm.spec
│   ├── debian
│   │   ├── deb_folder
│   │   │   ├── changelog
│   │   │   ├── control
│   │   │   ├── copyright
│   │   │   ├── rules
│   │   │   ├── source
│   │   │   │   └── format
│   │   │   └── stx-istio-helm.install
│   │   └── meta_data.yaml
│   └── stx-istio-helm
│       ├── files
│       │   ├── index.yaml
│       │   ├── Makefile
│       │   ├── metadata.yaml
│       │   └── repositories.yaml
│       ├── fluxcd-manifests
│       │   ├── base
│       │   │   ├── helmrepository.yaml
│       │   │   ├── kustomization.yaml
│       │   │   └── namespace.yaml
│       │   ├── istio-operator
│       │   │   ├── helmrelease.yaml
│       │   │   ├── istio-operator-static-overrides.yaml
│       │   │   ├── istio-operator-system-overrides.yaml
│        │   │   ├── istio-operator.yaml
│       │   │   └── kustomization.yaml
│       │   ├── kiali-server
│       │   │   ├── helmrelease.yaml
│       │   │   ├── kiali-server-static-overrides.yaml
│       │   │   ├── kiali-server-system-overrides.yaml
│       │   │   ├── kustomization.yaml
│       │   │   └── namespace.yaml
│       │   └── kustomization.yaml
│       └── helm-charts
│           └── Makefile
├── stx-kiali-helm
├── test-requirements.txt
└── tox.ini

The file structure does receive minor updates over time, so for the current version as well as the contents of each file in this application example, please check the following link

The debian folder contents are set up according to the following guide StarlingX/DebianBuildStructure. For more in-depth information on the configuration options available for each file, the developer may wish to consult the Debian source package documentation. In general, it is recommended to use an already available app as a template since most of the configuration options available aren't required.

Updating charts from upstream apps in debian

In case there is a need to update the helm charts provided by an upstream app, the procedure is similar to what is done to patch debian packages, as explained in StarlingX/DebianBuildStructure.

In short, the stx-app-NAME-helm/debian/meta_data.yaml is responsible for defining the upstream tarball to be downloaded by the build system. Then, patches to the files in the tarball can be added to the folder stx-app-NAME-helm/debian/patches/ The order in which they are applied is defined in the file stx-app-NAME-helm/debian/patches/series

Please view this commit as an example: https://review.opendev.org/c/starlingx/platform-armada-app/+/858737