diff --git a/docs/ExposingKubernetesResources.md b/docs/ExposingKubernetesResources.md index a4a0208cc84bb22f2719507848e402d034fe3312..0a64cdd9d89ed6f246166081133c290a06780d30 100644 --- a/docs/ExposingKubernetesResources.md +++ b/docs/ExposingKubernetesResources.md @@ -58,6 +58,16 @@ The following image illustrates the approach. **A CRD by default is exposed as a Resource Specification** +To ensure unique names across the clusters that OpenSlice can manage, the name of a CRD is constructed as follows: + +```Kind @ ApiGroup/version @ ContextCluster @ masterURL``` + +For example you might see resource Specifications like: + + - ```Application@argoproj.io/v1alpha1@kubernetes@https://10.10.10.144:6443/``` + - ```IPAddressPool@metallb.io/v1beta1@kubernetes@https://10.10.10.144:6443/``` + - ```Provider@pkg.crossplane.io/v1@kubernetes@https://10.10.10.144:6443/``` + All attributes of the CRD are translated into characteristics The following specific characteristics are **added**: diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/HELM_Installation_aaS_Jenkins_Example.md b/docs/HELM_Installation_aaS_Jenkins_Example/HELM_Installation_aaS_Jenkins_Example.md index 6309c55a0bbdda7ba98929944fc0b2afeb51882b..308832387e1151e426e36ed8fdf42192096d2826 100644 --- a/docs/HELM_Installation_aaS_Jenkins_Example/HELM_Installation_aaS_Jenkins_Example.md +++ b/docs/HELM_Installation_aaS_Jenkins_Example/HELM_Installation_aaS_Jenkins_Example.md @@ -10,6 +10,171 @@ Manage Helm charts installations via OpenSlice Service Specifications and Servic > - 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 care 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 + +We will use the ```Kind: Application``` of ArgoCD and create a ResourceFacingServiceSpecification for Jenkins +1. Go to Service Specifications +2. Create New Specification +3. Give a Name, eg. jenkinsrfs +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) + + +The _CR_SPEC can be designed first in a YAML or json editor. Let's see a YAML definition: + + + ``` + +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: + finalizers: + - resources-finalizer.argocd.argoproj.io + name: openslice-jenkins + namespace: argocd +spec: + project: default + destination: + namespace: opencrdtest + name: in-cluster + source: + repoURL: https://charts.jenkins.io + targetRevision: 4.6.1 + chart: jenkins + helm: + values: | + controller: + service: + type: ClusterIP + syncPolicy: + automated: + prune: true + selfHeal: true + allowEmpty: false + syncOptions: + - Validate=false + - CreateNamespace=true + - PrunePropagationPolicy=foreground + - PruneLast=true + - RespectIgnoreDifferences=true +``` + +**NOTICE** + +On each installation OSOM will change the name of the resource in order to be unique (will have a UUID) + + ```name: openslice-jenkins``` + + destination namespace that ArgoCD will use is the name ```opencrdtest``` + + ```destination: + namespace: opencrdtest + ``` + +**This causea an issue that ArgoCD installs the Jenkins akways in the same namespace** + +**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 +3. Drag-Drop Text>Multi-line text input block +4. Copy paste the YAML text +5. Change the spec: destination:namespace to the value %s +6. Drag-Drop Lists>Create list with block delete 2 items (click the gear icon). Connect it to formatted text block +7. Drag-Drop Context>Current Service Order block and select the id. Connect it to the List +8. Save the PRE_PROVISION Rule + + +Expose then as CustomerFacingServiceSpecification by using the previous RFSS as Service Specification Relationship +1. Create a Jenkins service and mark as Bundle and save it +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. Y + +#Order the service + +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: + +From the Supporting services of the Service Order, select the ResourceFacingService (jenkinsrfs) + +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. + + +> Exposing Jenkins to you external is a matter of cluster configuration and request (nodeport, load balancing, etc)! This is not a topic for this example + diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/img01.png b/docs/HELM_Installation_aaS_Jenkins_Example/img01.png new file mode 100644 index 0000000000000000000000000000000000000000..bbe29df97934dd4438f39f2f3e0e0e443ba0e4d3 Binary files /dev/null and b/docs/HELM_Installation_aaS_Jenkins_Example/img01.png differ diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/img02.png b/docs/HELM_Installation_aaS_Jenkins_Example/img02.png new file mode 100644 index 0000000000000000000000000000000000000000..c3719c6c04d5e04fc126d5d8388e8862a524ba2b Binary files /dev/null and b/docs/HELM_Installation_aaS_Jenkins_Example/img02.png differ diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/img03.png b/docs/HELM_Installation_aaS_Jenkins_Example/img03.png new file mode 100644 index 0000000000000000000000000000000000000000..fa3d7327fa68743d247aef9842ace2262cdeb84e Binary files /dev/null and b/docs/HELM_Installation_aaS_Jenkins_Example/img03.png differ diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/img04.png b/docs/HELM_Installation_aaS_Jenkins_Example/img04.png new file mode 100644 index 0000000000000000000000000000000000000000..8a6c0bf1deb000fc1fd494317bbe0a318eb1d3e5 Binary files /dev/null and b/docs/HELM_Installation_aaS_Jenkins_Example/img04.png differ diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/img05.png b/docs/HELM_Installation_aaS_Jenkins_Example/img05.png new file mode 100644 index 0000000000000000000000000000000000000000..ace9a1d34563b84cdc3318cb1cfb77251ee98d7c Binary files /dev/null and b/docs/HELM_Installation_aaS_Jenkins_Example/img05.png differ diff --git a/docs/HELM_Installation_aaS_Jenkins_Example/img06.png b/docs/HELM_Installation_aaS_Jenkins_Example/img06.png new file mode 100644 index 0000000000000000000000000000000000000000..2089e793a2c668e24dab0597c7c2965700b57f5f Binary files /dev/null and b/docs/HELM_Installation_aaS_Jenkins_Example/img06.png differ