Commit d3f4c6a5 authored by Dimitrios Giannopoulos's avatar Dimitrios Giannopoulos
Browse files

Deployed 05d16990 to develop in public with MkDocs 1.6.0 and mike 2.1.2

parent f794452d
Loading
Loading
Loading
Loading
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+171 −33
Original line number Diff line number Diff line
@@ -1838,6 +1838,17 @@
        
      
      
        <label class="md-nav__link md-nav__link--active" for="__toc">
          
  
  <span class="md-ellipsis">
    HELM Installation aaS Jenkins Example
  </span>
  

          <span class="md-nav__icon md-icon"></span>
        </label>
      
      <a href="./" class="md-nav__link md-nav__link--active">
        
  
@@ -1848,6 +1859,61 @@

      </a>
      
        

<nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  
  
  
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#design-the-jenkins-resource-facing-service" class="md-nav__link">
    <span class="md-ellipsis">
      Design the Jenkins (Resource-Facing) Service
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#expose-the-jenkins-customer-facing-service-to-the-users" class="md-nav__link">
    <span class="md-ellipsis">
      Expose the Jenkins (Customer-Facing) Service to the users
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#order-the-service" class="md-nav__link">
    <span class="md-ellipsis">
      Order the service
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#access-the-jenkins-installation" class="md-nav__link">
    <span class="md-ellipsis">
      Access the Jenkins installation
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
      
    </li>
  

@@ -2666,6 +2732,50 @@
    
  
  
    <label class="md-nav__title" for="__toc">
      <span class="md-nav__icon md-icon"></span>
      Table of contents
    </label>
    <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
      
        <li class="md-nav__item">
  <a href="#design-the-jenkins-resource-facing-service" class="md-nav__link">
    <span class="md-ellipsis">
      Design the Jenkins (Resource-Facing) Service
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#expose-the-jenkins-customer-facing-service-to-the-users" class="md-nav__link">
    <span class="md-ellipsis">
      Expose the Jenkins (Customer-Facing) Service to the users
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#order-the-service" class="md-nav__link">
    <span class="md-ellipsis">
      Order the service
    </span>
  </a>
  
</li>
      
        <li class="md-nav__item">
  <a href="#access-the-jenkins-installation" class="md-nav__link">
    <span class="md-ellipsis">
      Access the Jenkins installation
    </span>
  </a>
  
</li>
      
    </ul>
  
</nav>
                  </div>
                </div>
@@ -2680,20 +2790,26 @@


<h1 id="example-offer-jenkins-as-a-service-via-openslice">Example: Offer Jenkins as a Service via Openslice</h1>
<h2 id="design-the-jenkins-resource-facing-service">Design the Jenkins (Resource-Facing) Service</h2>
<p>Before reading this example please make sure that you went through the <a href="../design_helmaas.md">Design Helm as a Service</a> </p>
<p>We will use the <code>Kind: Application</code> of ArgoCD and create a  ResourceFacingServiceSpecification for Jenkins</p>
<p>In this example, we will use the <code>Kind: Application</code> of ArgoCD and create a ResourceFacingServiceSpecification (RFSS) for Jenkins. Eventually, we will offer Jenkins as a Service.</p>
<pre><code>1. Go to Service Specifications
2. Create New Specification
3. Give a Name, eg. jenkinsrfs
3. Provide a Name, eg. jenkinsrfs
4. Go to Resource Specification Relationships
5. Assign ```Application@argoproj.io/v1alpha1@kubernetes@https://10.10.10.144:6443/```
5. Assign **Application@argoproj.io/v1alpha1@kubernetes@https://10.10.10.144:6443/** as a related Resource Specification
</code></pre>
<blockquote>
<p>Please note that the <em>https://10.10.10.144:6443/</em> part of the Resource Specification's name will vary in different Kubernetes installations. </p>
</blockquote>
<p><img alt="img02.png" src="../img02.png" /></p>
<p>Focus now on the characteristics configuration.</p>
<p>First we need to map the lifecycle of ArgoCD Application to TMF Resource State</p>
<p>Now, we shall focus on the Characteristics' configuration of the created Service Specification. This can be achieved from the the "Service Specification Characteristics" tab.</p>
<p>Specifically, we need to map the lifecycle of ArgoCD Application (e.g. Progressing, Healthy, etc.) to TMF Resource State (e.g. reserved, active, etc.).</p>
<p>In ArgoCD, the field <strong>status.health.status</strong> has the value that we need to check (Healty, Progressing, etc) for the lifecycle of the application. This is captured by the <strong>_CR_CHECK_FIELD</strong> characteristic.</p>
<p>Also, the different ArgoCD lifycycle states must be captured by the respective <strong>_CR_CHECKVAL_xxx</strong> characteristics, as show in the figure below.</p>
<p><img alt="img05.png" src="../img05.png" /></p>
<p>In ArgoCD the field <strong>health.status</strong> has the value that we need to check (Healty, Progressing, etc)</p>
<p>The _CR_SPEC can be designed first in a YAML or json editor. Let's see a YAML definition:</p>
<p>After the state mapping, we must provide the template that ArgoCD will use to deploy the Jenkins HELM Chart as an ArgoCD application. For this, we must populate the <strong>_CR_SPEC</strong> characteristic. The _CR_SPEC can be designed first in a YAML or json editor for better parsing. </p>
<p>Let's see a YAML definition:</p>
<pre><code class="language-yaml">apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
@@ -2708,13 +2824,14 @@ spec:
    name: in-cluster
  source:
    repoURL: https://charts.jenkins.io
    targetRevision: 4.6.1
    targetRevision: 5.3.6
    chart: jenkins
    helm:
      values: |
        controller:
         service:
         type: ClusterIP
         serviceType: ClusterIP
        persistence:
         enabled: false
  syncPolicy:
    automated:
      prune: true
@@ -2727,15 +2844,30 @@ spec:
    - PruneLast=true
    - RespectIgnoreDifferences=true
</code></pre>
<p><strong>NOTICE</strong></p>
<p>On each installation OSOM will change the name of the resource in order to be unique (will have a UUID)</p>
<p><code>name: openslice-jenkins</code> </p>
<p>destination namespace that ArgoCD will use is the name <code>opencrdtest</code></p>
<p><code>destination:
<blockquote>
<p><strong>NOTE 1</strong>: The above template assumes that the Jenkins Server will acquire a <strong>ClusterIP</strong>. The user should handle the external exposure and access of the Jenkins Server, depending on its cluster configuration. Also, <strong>persistency of the data is disabled</strong> to facilitate the deployment without the need to define storage classes and volumes, as this serves as an example. </p>
</blockquote>
<pre><code class="language-yaml">    helm:
      values: |
        controller:
         serviceType: ClusterIP
        persistence:
         enabled: false
</code></pre>
<blockquote>
<p><strong>NOTE 2</strong>: On each installation, OSOM will change the name of the resource in order to be unique (will have a UUID), instead of "openslice-jenkins".</p>
</blockquote>
<pre><code class="language-yaml">name: openslice-jenkins
</code></pre>
<blockquote>
<p><strong>NOTE 3</strong>: The namespace that ArgoCD will use to deploy the Jenkins HELM Chart is the "opencrdtest".</p>
</blockquote>
<p><code>yaml
 destination:
    namespace: opencrdtest</code></p>
<p><strong>This implies that ArgoCD installs the Jenkins always in the same namespace</strong></p>
<p><strong>To avoid this we will create a simple pre-provision rule to change the namespace properly</strong></p>
<p>See the following image: </p>
<p><strong>The latter implies that ArgoCD will always install Jenkins in the same namespace.</strong></p>
<p><strong>To avoid this we will create a simple LCM rule (pre-provision) to change the namespace accordingly with a unique ID, generated with every new Service Order.</strong></p>
<p>The LCM rule can be created from the "Life Cycle Rules" tab, pressing the "Create new rule" button. The following image contains the LCM rule that needs to be created for this purpose:</p>
<p><img alt="img06.png" src="../img06.png" /></p>
<ol>
<li>Drag-Drop the _CR_SPEC block (Set characteristic value) of jenkinsrfs from the Service &gt; Text blocks</li>
@@ -2747,29 +2879,35 @@ spec:
<li>Drag-Drop the Service &gt; Context &gt; Current Service Order block and select the ID from the drop-down menu. Attach it to the List block of the previous step.</li>
<li>Save the PRE_PROVISION Rule</li>
</ol>
<h1 id="expose-the-service-to-your-users">Expose the service to your users</h1>
<p>Expose then as CustomerFacingServiceSpecification by using the previous RFSS as Service Specification Relationship </p>
<h2 id="expose-the-jenkins-customer-facing-service-to-the-users">Expose the Jenkins (Customer-Facing) Service to the users</h2>
<p>To expose a service towards the users, the designer must create the respective CustomerFacingServiceSpecification, by using the previously designed RFSS as a related service.</p>
<ol>
<li>Create a Jenkins service and mark as Bundle and save it </li>
<li>Go to Service Specification Relationships and assign Jenkinsrfs</li>
<li>Add also a Logo if you wish</li>
<li>Go to Service Specifications</li>
<li>Create New Specification</li>
<li>Create a Jenkins service, mark as Bundle (to enable Service Specification Relationships) and save it </li>
<li>Go to the "Service Specification Relationships" tab and assign Jenkinsrfs</li>
<li>(Optionally) Add a logo, from the respective "Logo" tab, if you wish</li>
</ol>
<p><img alt="img03.png" src="../img03.png" /></p>
<p><img alt="img04.png" src="../img04.png" /></p>
<p>Expose it now to a Category and a Catalog to be available for ordering.</p>
<p>Next, expose it through an already created Service Catalog and Service Category so as to make it visible to the users, thus available for ordering.</p>
<p><img alt="img061.png" src="../img061.png" /></p>
<h1 id="order-the-service">Order the service</h1>
<p>Order the service from the catalog. </p>
<p>Soon the order will be completed and the Services will be active</p>
<h2 id="order-the-service">Order the service</h2>
<p>Order the service from the assigned Service Catalog &gt; Service Category. </p>
<p>As soon as the Service Order is in <strong>ACKNOWLEDGED</strong> state, it will be processed and eventually completed rendering the services active, as seen in the figure below:</p>
<p><img alt="img07.png" src="../img07.png" /></p>
<h1 id="how-to-access-the-jenkins-installation">How to access the Jenkins installation:</h1>
<p>From the Supporting services of the Service Order, select the ResourceFacingService (jenkinsrfs)</p>
<p>The ResourceFacingService has also supporting resources in resource inventory.</p>
<h2 id="access-the-jenkins-installation">Access the Jenkins installation</h2>
<p>Starting from the Service Order overview and specifically the Order Item #1 tab &gt; Supporting Services, select the ResourceFacingService (jenkinsrfs).</p>
<p>Accordingly, the ResourceFacingService has supporting resources from the resource inventory. The latter are available through the "Supporting Resources" tab.</p>
<p><img alt="img08.png" src="../img08.png" /></p>
<p>One is the resource reference to the application (e.g. <em>cr_tmpname</em>...), the other is a secret (e.g. cr87893...). </p>
<p>Click to go to the secret resource (This is in the Resource inventory of OpenSlice)</p>
<p>The supporting resources of the Jenkins service are:</p>
<ul>
<li>A resource reference to the application (e.g. <em>cr_tmpname</em>...)</li>
<li>A secret resource (e.g. cr87893...). </li>
</ul>
<p>Select the secret resource, which will navigate you to the Resource Inventory page of OpenSlice. There, you may find the login credentials encoded as Base64. </p>
<p><img alt="img09.png" src="../img09.png" /></p>
<p>Use them to login in your Jenkins.</p>
<p>Use a Base64 decoder to parse the credentials and use them to login in your Jenkins installation, through the exposed Jenkis Server UI.</p>
<blockquote>
<p>Exposing Jenkins externally is a matter of cluster configuration and request (nodeport, load balancing, etc), thus is not a topic for this example</p>
</blockquote>