Skip to content

Commit

Permalink
Merge pull request #181 from cloudbees-days/cd-ro-workshop
Browse files Browse the repository at this point in the history
up to release from pipeline
  • Loading branch information
zvercodebender committed Sep 20, 2023
2 parents cb3b722 + b3d540b commit 1d7c638
Show file tree
Hide file tree
Showing 34 changed files with 35 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,15 @@ Next you'll define the cluster reference.
| Configuration name | `k8s-Workshop` | A reference to a configuration that lets CD/RO know where to use Helm |
| Namespace | `my-username-qa` | The Kubernetes namespace where your application will be deployed. You should update this to be YOUR_USERNAME-qa. |
| Kubeconfig context | | This allows you to target a specific cluster if your configuration is pointed at multiple. For this workshop you can leave this blank. |
| Utility resource name | `kubectl` | This is the name to identify the utility resource |
| Resource | `kubectl` | This is the agent which will communicate with the Kubernetes cluster |
| Utility resource name | `k8s-agent` | This is the name to identify the utility resource |
| Resource | `k8s-agent-0` | This is the agent which will communicate with the Kubernetes cluster |

![New cluster - part 3](new-environment-4.png)

The last step in configuring our microservice application is to map the microservice (hello-app) to your environment (QA). To do that click on the ![Add mapping](AddMapping.png) button and map your application

| ![mapping](mappingTile.ppng) | ![mapped](mapedApplication.png) |
|--------|--------|
| ![mapping](mappingTile.png) | ![mapped](mapedApplication.png) |


## Running the deployment
Expand All @@ -203,7 +204,7 @@ You can click the top list item to see more detail on the overall run and you ca

### Visiting our application

Now we can visit the application we just deployed by visiting the URL from the values definition of our application. This will be in the form of `https://my-username.cdro-workshop.cb-demos.io`.
Now we can visit the application we just deployed by visiting the URL from the values definition of our application. This will be in the form of [https://my-username.cdro-workshop.cb-demos.io](https://my-username.cdro-workshop.cb-demos.io).

You should see the name of your username and the environment QA listed.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 22 additions & 16 deletions labs/cloudbees-cdro-v2/content/labs/05_environments.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@ In the previous lab we took a look at the application modeling process and setup

## Reviewing the environment we've created

Let's take a look at the environment we created in the previous lab in more detail. On the *Hierarchy Menu* on the left side of the screen, you can click on the "Environment: QA" link at the bottom. This will bring you to the environment page.
Let's take a look at the environment we created in the previous lab in more detail. To look at the environments click on the hamburger menu an then click on *Environments*.

|---|---|
| ![environmentSelectionMenu](environmentSelectionMenu.png) | ![environmentList](environmentList.png) |


![Click on environment](click-environment.png)

Expand Down Expand Up @@ -59,15 +63,15 @@ You can also navigate there via the main menu (aka the *burger menu*) by going t

![App menu](app-burger-menu.png)

To add a new environment, click the large plus button on the right side of the QA environment.
To add a new environment, click the large plus button bellow the QA environment.

![New environment button](prod-1.png)

You'll now see a familiar "New environment" block with a "New cluster" block inside of it. We are essentially going to repeat our steps from the previous lab.
You'll now see a familiar "Add environment". We are essentially going to repeat our steps from the previous lab.

![New environment block](prod-2.png)

First, click on the "New Cluster" button in the inner block. This will pop up the New environment modal. Like before, you'll just click "Next", leaving the default option of "New environment".
Fill out the environment parameters to define our production environment.

![New environment modal](prod-3.png)

Expand All @@ -78,28 +82,30 @@ This will look remarkably similar to before. We'll just replace the values of QA
| Environment name | `Production` | The name to identify your environment |
| Project | Select your project | The project inside which this environment will be stored |
| Environment description | *Optional* | A field to give textual details about this environment |
| Utility resource name | `k8s-agent` | This is the name to identify the utility resource |
| Resource | `k8s-agent` | This is the agent which will communicate with the Kubernetes cluster |
2

Once the environment is created you can create cluster references by clicking on the `Add cluster reference` button.

![New environment modal](prod-3a.png)

| Field | Value | Description |
|-------------------------|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------|
| Cluster name | `default` | A name to identify this cluster |
| Cluster description | *Optional* | A field to give textual details about this cluster |
| Configuration provider | `Kubernetes (via Helm)` | The type of environment you're defining |
| Configuration name | `helm` | A reference to a configuration that lets CD/RO know where to use Helm |
| Configuration name | `k8s-worshop` | A reference to a configuration that lets CD/RO know where to use Helm |
| Namespace | `my-username-prod` | The Kubernetes namespace where your application will be deployed. You should update this to be YOUR_USERNAME-prod. |
| Kubeconfig context | | This allows you to target a specific cluster if your configuration is pointed at multiple. For this workshop you can leave this blank. |
| Utility resource name | `k8s-agent` | This is the name to identify the utility resource |
| Resource | `k8s-agent` | This is the agent which will communicate with the Kubernetes cluster |

![New environment form](prod-4.png)

Next we need to map this new environment to the application.


![Map new environment](prod-5.png)

Drag the arrow into the Kubernetes cluster within the Production environment.
![Map environment](prod-6.png)
The last step in configuring our microservice application is to map the microservice (hello-app) to your environment (Production). To do that click on the ![Add mapping](AddMapping.png) button and map your application

You'll have a popup asking you to confirm the mapping. Go ahead and click "OK".
|--------|--------|
| ![mapping](prod-5.png) | ![mapped](prod-6.png) |

![Map environment - confirm](prod-7.png)

Now you're ready to deploy into the production environment. Like before, you can click the "Deploy" button, but this time select the Production environment.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/env-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/env-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/envvars-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/prod-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/prod-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/prod-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/prod-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/prod-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/prod-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file modified labs/cloudbees-cdro-v2/content/labs/05_environments/rerun-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -31,17 +31,17 @@ _Alternatively, you can delete tasks by clicking on the "more" menu on the task
Which ever way you deleted it, you should now see 0 Tasks in that stage.
![Empty stage](7.png)

Now it is time to create a new task. Go ahead and click the **Add** button in the bottom of the stage. Go ahead and call it `Deploy to QA`.
Now it is time to create a new task. Go ahead and click the **Add task** button in the bottom of the stage. Go ahead and call it `Deploy to QA`.

![New task](8.png)

Next, click on **Select Task Type** and choose the **Deployer** option from under the **Native** section.
Next, click on **Define** and choose the **Deployer** option from under the **Native** section.
![New task](9.png)

Then, click on **Define** to configure this task.
![Configure new task](10.png)

Since we're only working with a single application, we can ignore these settings and just click **OK**. This is where you can change the behavior of how it chooses to deploy multiple applications.
Since we're only working with a single application, we can ignore these settings and just click **Save changes**. This is where you can change the behavior of how it chooses to deploy multiple applications.

Now we're done with the QA stage.

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pipeline 'pipeline_Base', {
actualParameter = [
'branch': 'main',
'commit': '',
'config': '/projects/CloudBees/pluginConfigurations/cb-bot',
'config': '/projects/Workshop/pluginConfigurations/cb-bot',
'depth': '',
'gitRepoFolder': '/tmp/demo-app',
'mirror': 'false',
Expand All @@ -63,7 +63,7 @@ pipeline 'pipeline_Base', {
task 'Get latest SonarQube scan results', {
actualParameter = [
'config': '/projects/Default/pluginConfigurations/SonarQube',
'config': '/projects/Workshop/pluginConfigurations/cb-demos-sonar',
'resultFormat': 'propertysheet',
'resultSonarProperty': '/myJob/getLastSonarMetrics',
'sonarMetricsComplexity': 'all',
Expand All @@ -76,9 +76,9 @@ pipeline 'pipeline_Base', {
'sonarMetricsReliability': 'all',
'sonarMetricsSecurity': 'all',
'sonarMetricsTests': 'all',
'sonarProjectKey': 'demo-app',
'sonarProjectName': 'demo-app',
'sonarProjectVersion': '',
'sonarProjectKey': 'petclinic',
'sonarProjectName': 'petclinic',
'sonarProjectVersion': '2.2.0.BUILD-SNAPSHOT',
'sonarTaskId': '',
'sonarTimeout': '',
]
Expand Down

0 comments on commit 1d7c638

Please sign in to comment.