From 746ed54be7c22245545a279b8cef83bb7730e625 Mon Sep 17 00:00:00 2001 From: Christos Tranoris <tranoris@gmail.com> Date: Wed, 3 Jul 2024 15:43:07 +0300 Subject: [PATCH] update #9 --- .../CRIDGE/CRIDGEforDevelopers.md | 2 +- .../ExposingCRDs_aaS_Example_Calculator.md | 52 +++++----- .../kubernetes/ExposingKubernetesResources.md | 6 +- .../kubernetes/design_helmaas.md | 67 +++++++++++++ .../HELM_Installation_aaS_Jenkins_Example.md | 94 +++++-------------- mkdocs.yml | 2 +- 6 files changed, 126 insertions(+), 97 deletions(-) diff --git a/doc/architecture/CRIDGE/CRIDGEforDevelopers.md b/doc/architecture/CRIDGE/CRIDGEforDevelopers.md index 03eaa432..c8e707fc 100644 --- a/doc/architecture/CRIDGE/CRIDGEforDevelopers.md +++ b/doc/architecture/CRIDGE/CRIDGEforDevelopers.md @@ -217,7 +217,7 @@ OSOM sends to CRIDGE a message with the following information: ## What's next? - See examples of exposing operators via OpenSlice: - - [Exposing Kubernetes Operators as a Service : Offering "Calculator as a Service" through OpenSlice](ExposingCRDs_aaS_Example_Calculator.md) + - [Exposing Kubernetes Operators as a Service : Offering "Calculator as a Service" through OpenSlice](../../service_design/examples/ExposingCRDs_aaS_Example_Calculator/ExposingCRDs_aaS_Example_Calculator.md) diff --git a/doc/service_design/examples/ExposingCRDs_aaS_Example_Calculator/ExposingCRDs_aaS_Example_Calculator.md b/doc/service_design/examples/ExposingCRDs_aaS_Example_Calculator/ExposingCRDs_aaS_Example_Calculator.md index f7751d88..6d9dd152 100644 --- a/doc/service_design/examples/ExposingCRDs_aaS_Example_Calculator/ExposingCRDs_aaS_Example_Calculator.md +++ b/doc/service_design/examples/ExposingCRDs_aaS_Example_Calculator/ExposingCRDs_aaS_Example_Calculator.md @@ -113,11 +113,13 @@ As soon as the CRD is deployed in the cluster (e.g. by your admin via kubctl or - Having this OpenSlice can manage resources in multiple clusters -<img src="img07.png" > + + > See also the detailed characteristics. See how OpenSlice makes all characteristics automatically flat and expanded with key-value style -<img src="img08.png" width=1024px> + + --- # Expose to Users @@ -127,10 +129,9 @@ As soon as the CRD is deployed in the cluster (e.g. by your admin via kubctl or From the UI menu create a new Service Specification + -<img src="img09.png" width=1024px> -<img src="img10.png" width=1024px> - + @@ -158,7 +159,8 @@ spec: ``` -<img src="img11.png" width=1024px> + + > However the values are fixed. How do we allow a user to pass parameters through OpenSlice @@ -174,10 +176,7 @@ Create a new CustomerFacingServiceSpecification - Add the following characteristics as the image shows: -<img src="cfs_img12.png" width=1024px> - - - + ### Allow users to pass new values through OpenSlice @@ -191,10 +190,14 @@ We need to Create LCM rules in CustomerFacingServiceSpecification: - we will create one rule that will pass the parameters while the service is active (SUPERVISION phase) - The rules will be the same -<img src="img12.png" width=1024px> + + + If we see one rule it will look like the following: -<img src="img13.png" width=1024px> + + + - We need to change the _CR_SPEC characteristic of the referenced ResourceFacingServiceSpecification - First bring a block from Service>Relationships>Service Refs and drop the "Service MyCalculatorRFS" block @@ -220,22 +223,25 @@ If we see the SUPERVISION rule it will look like the following: - Add as name the "status.result" -<img src="img13_1.png" width=1024px> + + + + -<img src="img14.png" width=1024px> Expose it then to a catalogue for orders through the Service Categories and Service Catalogs -<img src="img15.png"> + + ### Order the Service When a user orders the service, it will look like this: -<img src="img16.png" width=1024px> + @@ -244,20 +250,22 @@ When a user orders the service, it will look like this: - The Actual resources are running in the Kubernetes cluster managed by OpenSlice - The result is in the characteristic status.result of the running service -<img src="img17.png" width=800px> -<img src="img18.png" width=1024px> + + + + ### Modify the running service The user can modify the service -<img src="img19.png" width=1024px> +  + + - After a while the update is applied to the cluster, the controller will pick up the resource update and patch the resource - OpenSlice (via CRIDGE service) updates the Resource in Resource Inventory and OSOM updates the Services in Service Inventory - The result will be available to the respective characteristic "Result" after a few seconds, as need to go through various steps (OpenSlice orchestrator, down to kubernetes, to Calculator controller and back) - -<img src="img20.png" width=1024px> - \ No newline at end of file +  \ No newline at end of file diff --git a/doc/service_design/kubernetes/ExposingKubernetesResources.md b/doc/service_design/kubernetes/ExposingKubernetesResources.md index 0a64cdd9..441b5763 100644 --- a/doc/service_design/kubernetes/ExposingKubernetesResources.md +++ b/doc/service_design/kubernetes/ExposingKubernetesResources.md @@ -34,7 +34,8 @@ OpenSlice is capable of exposing Kubernetes Resources and Definitions as Service The following image illustrates the approach. -<img src="img01.png" width=1024px> + + 1. A CRD in a cluster will be mapped in TMF model as a Resource specification and therefore can be exposed as a service specification in a catalog 2. Service Orders can be created for this service specification. @@ -116,8 +117,7 @@ The following specific characteristics are **added**: 2.3. You Expose configurable values for users to configure during service order -<img src="img06.png" width=1024px> - + # Service Orchestration and CRDs/CRs diff --git a/doc/service_design/kubernetes/design_helmaas.md b/doc/service_design/kubernetes/design_helmaas.md index e69de29b..a4722cdd 100644 --- a/doc/service_design/kubernetes/design_helmaas.md +++ b/doc/service_design/kubernetes/design_helmaas.md @@ -0,0 +1,67 @@ +# Expose HELM charts as Service Specifications +Manage Helm charts installations via OpenSlice Service Specifications and Service Orders. +## Intended Audience: Service Designers + + +> Kubernetes is an orchestration system for automating software deployment, scaling, and management. One can interact though the Kubernetes API and it has a set of objects ready for use out of the box. + +> Helm is a tool that automates the creation, packaging, configuration, and deployment of Kubernetes applications by combining your configuration files into a single reusable package + +> At the heart of Helm is the packaging format called charts. Each chart comprises one or more Kubernetes manifests -- and a given chart can have child charts and dependent charts, as well. Using Helm charts: + +> - Reduces the complexity of deploying Microservices +> - Enhances deployment speed +> - Developers already know the technology + +> There are many Helm charts and Helm repositories there that are ready to be used + +> Enable loose coupling and more orchestration scenarios + +> Developers create and deploy applications in things they already know (e.g. Helm charts) + +> Use the TMF models as wrapper entities around Helm charts + + +Use OpenSlice to expose them in service catalogs and deploy them in complex scenarios (service bundles) involving also other systems: + + - Include e.g. RAN controllers, + - Pass values through life cycle rules from one service to another, + - Manage multiple Helms in multiple clusters + + +## The installation of HELM charts is based on OpenSlice CRD support + +Please read more [here](../ExposingKubernetesResources.md) + + +For installing HELM charts we will use ArgoCD a well known Kubernetes-native continuous deployment (CD) tool + +> ArgoCD is a Kubernetes-native continuous deployment (CD) tool + +> While just deploying Heml charts is just a scenario for ArgoCD , in future one can exploit it for many things + +> Despite some other tools like FluxCD, it provides also a UI which is useful for management and troubleshooting + + +We will mainly use the CRD of ```Kind: Application``` that ArgoCD can manage + + + +Before proceeding, install ArgoCD in your management cluster, by following ArgoCD instructions + +As soon as you install ArgoCD, OpenSlice is automatically aware for specific new Kinds. The one we will use is is the ```Kind: Application``` that ArgoCD can manage under the apiGroup argoproj.io + +Browse to Resource Specifications. You will see an entry like the following: + +```Application@argoproj.io/v1alpha1@kubernetes@https://10.10.10.144:6443/``` + +see image: + + + + + +## What's next + + +See the [Example: Offer Jenkins as a Service via Openslice](helm/HELM_Installation_aaS_Jenkins_Example.md) diff --git a/doc/service_design/kubernetes/helm/HELM_Installation_aaS_Jenkins_Example.md b/doc/service_design/kubernetes/helm/HELM_Installation_aaS_Jenkins_Example.md index ca199519..671a53ea 100644 --- a/doc/service_design/kubernetes/helm/HELM_Installation_aaS_Jenkins_Example.md +++ b/doc/service_design/kubernetes/helm/HELM_Installation_aaS_Jenkins_Example.md @@ -1,66 +1,7 @@ -# Expose HELM charts as Service Specifications -Manage Helm charts installations via OpenSlice Service Specifications and Service Orders. -## Intended Audience: Service Designers - - -> Kubernetes is an orchestration system for automating software deployment, scaling, and management. One can interact though the Kubernetes API and it has a set of objects ready for use out of the box. - -> Helm is a tool that automates the creation, packaging, configuration, and deployment of Kubernetes applications by combining your configuration files into a single reusable package - -> At the heart of Helm is the packaging format called charts. Each chart comprises one or more Kubernetes manifests -- and a given chart can have child charts and dependent charts, as well. Using Helm charts: - -> - Reduces the complexity of deploying Microservices -> - Enhances deployment speed -> - Developers already know the technology - -> There are many Helm charts and Helm repositories there that are ready to be used - -> Enable loose coupling and more orchestration scenarios - -> Developers create and deploy applications in things they already know (e.g. Helm charts) - -> Use the TMF models as wrapper entities around Helm charts - - -Use OpenSlice to expose them in service catalogs and deploy them in complex scenarios (service bundles) involving also other systems: - - - Include e.g. RAN controllers, - - Pass values through life cycle rules from one service to another, - - Manage multiple Helms in multiple clusters - - -## The installation of HELM charts is based on OpenSlice CRD support - -Please read more [here](../ExposingKubernetesResources.md) - - -For installing HELM charts we will use ArgoCD a well known Kubernetes-native continuous deployment (CD) tool - -> ArgoCD is a Kubernetes-native continuous deployment (CD) tool - -> While just deploying Heml charts is just a scenario for ArgoCD , in future one can exploit it for many things - -> Despite some other tools like FluxCD, it provides also a UI which is useful for management and troubleshooting - - -We will mainly use the CRD of ```Kind: Application``` that ArgoCD can manage - - - -Before proceeding, install ArgoCD in your management cluster, by following ArgoCD instructions - -As soon as you install ArgoCD, OpenSlice is automatically aware for specific new Kinds. The one we will use is is the ```Kind: Application``` that ArgoCD can manage under the apiGroup argoproj.io - -Browse to Resource Specifications. You will see an entry like the following: - -```Application@argoproj.io/v1alpha1@kubernetes@https://10.10.10.144:6443/``` - -see image: - -<img src="img01.png" width=1024px> - # Example: Offer Jenkins as a Service via Openslice +Before reading this example please make sure that you went through the [Design Helm as a Service](../design_helmaas.md) + We will use the ```Kind: Application``` of ArgoCD and create a ResourceFacingServiceSpecification for Jenkins 1. Go to Service Specifications @@ -69,15 +10,16 @@ We will use the ```Kind: Application``` of ArgoCD and create a ResourceFacingSe 4. Go to Resource Specification Relationships 5. Assign ```Application@argoproj.io/v1alpha1@kubernetes@https://10.10.10.144:6443/``` -<img src="img02.png" width=640px> + Focus now on the characteristics configuration. First we need to map the lifecycle of ArgoCD Application to TMF Resource State -<img src="img05.png" width=640px> + + In ArgoCD the field **health.status** has the value that we need to check (Healty, Progressing, etc) @@ -138,7 +80,9 @@ On each installation OSOM will change the name of the resource in order to be un **To avoid this we will create a simple pre-provision rule to change the namespace properly** See the following image: -<img src="img06.png" > + + + 1. Drag-Drop the _CR_SPEC characteristic of jenkinsrfs from the Service>Text blocks 2. Drag-Drop Text>Formatted text block @@ -156,12 +100,17 @@ Expose then as CustomerFacingServiceSpecification by using the previous RFSS as 2. Go to Service Specification Relationships and assign Jenkinsrfs 3. Add also a Logo if you wish -<img src="img03.png" width=640px> -<img src="img04.png" width=640px> + + + + Expose it now to a Category and a Catalog to be available for ordering. -<img src="img061.png" > + + + + # Order the service @@ -171,7 +120,9 @@ Order the service from the catalog. Soon the order will be completed and the Services will be active -<img src="img07.png" width=640px> + + + # How to access the Jenkins installation: @@ -179,13 +130,16 @@ From the Supporting services of the Service Order, select the ResourceFacingServ The ResourceFacingService has also supporting resources in resource inventory. -<img src="img08.png" width=640px> + + + One is the resource reference to the application (e.g. _cr_tmpname_...), the other is a secret (e.g. cr87893...). Click to go to the secret resource (This is in the Resource inventory of OpenSlice) -<img src="img09.png" width=640px> + + Use them to login in your Jenkins. diff --git a/mkdocs.yml b/mkdocs.yml index 276f80f9..3fc87d29 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -112,7 +112,7 @@ nav: - Support for Kubernetes: - Introduction: ./service_design/kubernetes/intro.md - Exposing Kubernetes Resources: ./service_design/kubernetes/ExposingKubernetesResources.md - - Design Helm aaService: ./service_design/kubernetes/helm/HELM_Installation_aaS_Jenkins_Example.md + - Design Helm as a Service: ./service_design/kubernetes/helm/design_helmaas.md - Support for NFV: - Design NFV Services: ./service_design/nfv/design_nfv_services.md - LCM Rules: -- GitLab