DCAE MOD Flow for Helm Flow (Jakarta)

DCAE MOD Flow for Helm Flow (Jakarta)

 

 

Demo  recording and slides are availabe at :  2022-02-22 DCAE Meeting Notes

Helm Flow Pre-requisite

  • An accessible ChartMuseum registry (internal or external)

  • As the prrovided registry is used both to pull required dependencies and push new generated charts, all common charts used by DCAE components must be available in this registry.

ONAP deployments (gating) will include Chartmuseum installation within ONAP cluster  (charts hosted here - https://github.com/onap/oom/tree/master/kubernetes/platform/components/chartmuseum). 

Dependent charts such as - dcaegen2-services-common, readinessCheck, common, repositoryGenerator, postgres, mongo, serviceAccount, certInitializer should be preloaded into this registry as MOD retrieves them during new MS helm charts creation and linting.  To support the registry initialization, following scripts has been introduced. 

 

Note:  Chartmuseum being a platform component, it has to be enabled on-demand and not available with generic ONAP installation.  To setup chartmuseum and pre-load required charts, follow the ommands listed below in this page)

MOD Updates 

To support the Helm chart generation, following changes were introduced for MOD in Jakarta release

Specification Schema Change

New V3 version of component spec schema introduced - https://github.com/onap/dcaegen2-platform/blob/master/mod/component-json-schemas/component-specification/dcae-cli-v3/component-spec-schema.json

  • Added new “helm” object under “auxilary_docker” properties

    • Includes “applicationEnv”

    • Includes “service” definition

  • Readiness Configuration support

    • docker_healthcheck_http

      • Added HTTP/HTTPS for supported protocol enum list

      • Added “port”

      • Added “initialDelaySeconds”

    • docker_healthcheck_script

      • Added “initialDelaySeconds”

MOD/RuntimeAPI 

Build Updates

New Java module - Helmgenerator-core was introduced for Helm charts generation. MOD/Runtime has been enhanced to include this new dependency (inaddition to Bp-generator for supporting cloudify blueprints flows).

Below is snippet from - https://github.com/onap/dcaegen2-platform/blob/master/mod/runtimeapi/runtime-core/pom.xml

 

Chart Updates

MOD/Runtime Charts has been modified to include under resources, common base templates, Charts.yaml, add-on templates and Values.yaml with placeholder.

 

The Helmgenerator-core modules uses these template to pull the required dependencies and generate new chart for MS onboarded. The parameters in component-spec provided during onboarding is used for final Values.yaml file generation.

Deployment

The MOD/RuntimeAPI introduces new configuration to identify distribution mechanism. Supported artifactType are BLUEPRINT or HELM. 

Blueprint – Distribution to Inventory/Dashboard

Helm – Distribution to ChartMuseum

For Jakarta release, the charts configuration has been set to support HELM distribution by default and configured for ONAP-internal chart-museum registry.  RuntimeAPI Chart updates https://github.com/onap/oom/blob/master/kubernetes/dcaemod/components/dcaemod-runtime-api/values.yaml

 

 

DEMO STEPS

Below is summary of the steps involved.

  1. Chartmuseum Installation

  2. Chartmuseum initialization (pre-load required dependencies)

  3. Deploy MOD and define registry/target on UI

  4. Load v3 specs via OnboardingAPI

  5. Create flow on MOD Designer tool using VES and TCAgen2

  6. Distribution to Runtime

  7. Validation and Deployment

 

1. Chartmuseum Installation

 

Clone OOM repository and deploy optional Chartmuseum component

 

Chartmuseum Deployment
# git clone -b <BRANCH> http://gerrit.onap.org/r/oom --recurse-submodules cd ~/oom/kubernetes/platform/components/chartmuseum helm install -name dev-chartmuseum -n onap . --set global.masterPassword=test1 --set global.pullPolicy=IfNotPresent

 

For easier validation of the charts in registry, you may enable the Nodeport for the chartmuseum service via kubectl (kubectl edit svc -n onap chart-museum) and provide Nodeport

 

Nodeport Enablelment
ports: - name: http nodePort: 30192 port: 80 protocol: TCP targetPort: http selector: app.kubernetes.io/instance: chartmuseum app.kubernetes.io/name: chartmuseum sessionAffinity: None type: NodePort

 

 Once enabled, you can view the registry via browser - http://<k8snodeip>:30192/api/charts

 

Note: This chartmuseum registry is deployed internal to ONAP cluster and is different from the registry setup done part OOM (https://docs.onap.org/projects/onap-oom/en/latest/oom_quickstart_guide.html : step 6) to setup local helm server for serving chart and to push the charts generated from local make/build.