diff options
author | Tomasz Wrobel <tomasz.wrobel@nokia.com> | 2021-05-18 16:04:25 +0200 |
---|---|---|
committer | Michael Morris <michael.morris@est.tech> | 2021-05-21 10:18:10 +0000 |
commit | ac69ef1da7e87ee2602b3790ec680be4c1f74cf3 (patch) | |
tree | c87fdcdb7e07efe07dfd1137bd1cb4714dc051c2 | |
parent | 4224d9be19ab8b558340ea58fa507fb9867d19bf (diff) |
Add Documentation of SDC-Helm-Validator container
Issue-ID: SDC-3185
Signed-off-by: Tomasz Wrobel <tomasz.wrobel@nokia.com>
Change-Id: I85972698bb4e0b42694acf1d97980e45cda0d81d
Signed-off-by: Joanna Jeremicz <joanna.jeremicz@nokia.com>
-rw-r--r-- | docs/conf.py | 14 | ||||
-rw-r--r-- | docs/configuration.rst | 8 | ||||
-rw-r--r-- | docs/delivery.rst | 3 | ||||
-rw-r--r-- | docs/index.rst | 1 | ||||
-rw-r--r-- | docs/onboardingpackages.rst | 2 | ||||
-rw-r--r-- | docs/sdc-helm-validator.rst | 130 |
6 files changed, 157 insertions, 1 deletions
diff --git a/docs/conf.py b/docs/conf.py index 4b24057691..e78ac0c30c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,7 +12,21 @@ intersphinx_mapping = {} intersphinx_mapping['onap-doc'] = ('{}/en/%s'.format(doc_onap_url) % branch, None) + +def prepare_rst_epilog(): + git_branch = branch + if git_branch == 'latest': + git_branch = 'master' + return """ +.. |sdc-helm-validator-open-api| replace:: SDC Helm Validator OpenAPI.yaml +.. _sdc-helm-validator-open-api: https://gerrit.onap.org/r/gitweb?p=sdc/sdc-helm-validator.git;a=blob_plain;f=OpenAPI.yaml;hb=refs/heads/{branch} +""".format(branch=git_branch) + +rst_epilog = prepare_rst_epilog() + html_last_updated_fmt = '%d-%b-%y %H:%M' def setup(app): app.add_stylesheet("css/ribbon.css") + + diff --git a/docs/configuration.rst b/docs/configuration.rst index f839a1f314..2438504d92 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -81,6 +81,14 @@ environment.json "VnfRepo": { "vnfRepoPort": "8702", "vnfRepoHost": "10.0.14.1" + }, + "HelmValidator": { + "validator_enabled": true, + "helm_version": "3.5.2", + "deployable": true, + "lintable": false, + "strict_lintable": false, + "validator_url": "http://sdc-helm-validator:8080/validate" } }, "override_attributes": { diff --git a/docs/delivery.rst b/docs/delivery.rst index 5e055a7ba9..7fd907f9aa 100644 --- a/docs/delivery.rst +++ b/docs/delivery.rst @@ -37,7 +37,8 @@ Overview +---------------------+----------------------------------------------------------------------------+------------------------------------------------+ | sdc-WFD-FE | SDC Workflow **Frontend** Jetty server | Starts Jetty with our application. | +---------------------+----------------------------------------------------------------------------+------------------------------------------------+ - +| sdc-helm-validator | SDC container for Helm package validation | Starts server with our application. | ++---------------------+----------------------------------------------------------------------------+------------------------------------------------+ Deployement dependency map diff --git a/docs/index.rst b/docs/index.rst index e1aa94997b..0d1a6a3931 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,3 +23,4 @@ SDC Documentation sdcsdks.rst dcaedesigner.rst workflow.rst + sdc-helm-validator.rst diff --git a/docs/onboardingpackages.rst b/docs/onboardingpackages.rst index 63bc152df4..82e5334172 100644 --- a/docs/onboardingpackages.rst +++ b/docs/onboardingpackages.rst @@ -61,6 +61,8 @@ Basic Helm package support for CNF The helm package support is new since Guilin release, helm chart packaged as tgz file can be onboarded and distributed. The support is limited for this first release. +Since Istanbul release there is also an additional helm chart validation step during package onboarding process. More information: :ref:`SDC Helm Validator <sdc_helm_validator>`. + Package Types applicable to Resource Types ------------------------------------------ VF diff --git a/docs/sdc-helm-validator.rst b/docs/sdc-helm-validator.rst new file mode 100644 index 0000000000..cb4c85f211 --- /dev/null +++ b/docs/sdc-helm-validator.rst @@ -0,0 +1,130 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 +.. Copyright 2021 NOKIA + +.. _sdc_helm_validator: + +SDC Helm Validator +============================== + + +General information +------------------------------ + +This application can be used to validate CNF Helm charts using a Helm Client. It allows to select Helm version, which will be used to execute validation. + +More information could be found in project repository, see :ref:`sdc_helm_validator_repository`. + + + +Offered API +----------- + +.. Latest Open API model: :download:`OpenAPI.yaml <https://gerrit.onap.org/r/gitweb?p=sdc/sdc-helm-validator.git;a=blob_plain;f=OpenAPI.yaml;hb=refs/heads/master>` + + +Latest Open API model: |sdc-helm-validator-open-api|_ + + +Validation +---------- +Application executes two types of validation: + +* Deployable (basic validation) - verify correct chart rendering. +* Lint (optional) - verify syntax of charts, it can be turned on/off by request parameter. + +**Request parameters:** + +* versionDesired - Helm Client version, which will be used to validation (list of supported versions can be received */versions* endpoint), available formats: + + - Semantic version [X.Y.Z] e.g 3.5.2 + - Major version [vX] - uses latest of available major version, e.g: v3 uses latest 3.Y.Z version. + +* isLinted - turn on/off lint validation +* isStrictLinted - turn on/off strict lint - if lint validation detects any warning, it marks chart as invalid. + + +Example usage +------------- + +**Supported versions** (/versions) +Request: + +.. code-block:: bash + + curl -X 'GET' \ + 'http://<host>:<port>/versions' \ + -H 'accept: */*' + +E.g: + +.. code-block:: bash + + curl -X 'GET' \ + 'http://localhost:8080/versions' \ + -H 'accept: */*' + +Sample response: + +.. code-block:: json + + {"versions": + ["3.5.2", + "3.4.1", + "3.3.4"]} + +**Validation** (/validate) + +Request: + +.. code-block:: bash + + curl -X 'POST' \ + 'http://<HOST>:<PORT>/validate' \ + -H 'accept: application/json' \ + -H 'Content-Type: multipart/form-data' \ + -F 'versionDesired=<Helm client version>' \ + -F 'file=@<path to file in .tgz format>;type=application/x-compressed-tar' \ + -F 'isLinted=true' \ + -F 'isStrictLinted=true' + +E.g: + +.. code-block:: bash + + curl -X 'POST' \ + 'http://localhost:8080/validate' \ + -H 'accept: application/json' \ + -H 'Content-Type: multipart/form-data' \ + -F 'versionDesired=3.5.2' \ + -F 'file=@correct-apiVersion-v2.tgz;type=application/x-compressed-tar' \ + -F 'isLinted=true' \ + -F 'isStrictLinted=true' + +Sample response: + +.. code-block:: json + + { + "renderErrors": [], + "lintWarning": [], + "lintError": [], + "versionUsed": "3.5.2", + "valid": true, + "deployable": true + } + + + +Usage within SDC +---------------- + +The Helm validator is triggered by the SDC onboarding BE in CNF package onboarding use-cases. + + +.. _sdc_helm_validator_repository: + +Project repository +------------------ + +`SDC Helm Validator repository <https://gerrit.onap.org/r/admin/repos/sdc/sdc-helm-validator>`_ |