::: {.index} pair: Override Cluster and Machine Pipelines; Labs :::
2060 Override Cluster and Machine Pipelines¶
Overview¶
- Id: 2060
- Time: 20 Minutes
- Enabled: Yes
- Difficulty: intermediate
- Tags: core, iac, pipelines
- Concepts: clusters, pipelines, params
Objective¶
Create application specific pipeline overrides based on standardized pipelines
In this lab, the User will create a Pipeline and use it to build clusters.
Business ROI: Using standardized pipelines helps ensure consistent operational results without restricting business imperatives for use-case specific needs.
Prerequisites¶
Required Labs:
- 1020
Summary¶
Add the Dev Library Content Pack¶
- Navigate to the Catalog
- Find the
`dev-library
\<https://portal.rackn.io/#/e/0.0.0.0/catalog/dev-library>`__ using the search bar- Install or Update
dev-library
if not loaded, by clicking the install button
Create a Pipelines¶
- Navigate to Pipelines
Click the
Create
buttonThe form should have the following:
- Set
Name
tolab2060
- Set the Param
universal-application
tolab2060
- The value must be the part after
universal-application-
in theName
field.- Set the Param
universal-application-chain-index-override
torunbook
- This will set the pipeline to apply a configurable application as the last step of the pipeline.
- Set the
icon
andcolor
fields to your choice.- Click
Save
Click
Add Params
- Select
dev/wait-icons
by typing- Select
universal/runbook-during-flexiflow
by typingEdit the
dev/wait-icons
parameterMake the list of values:
Click the little
save
iconEdit the
universal/runbook-during-flexiflow
parameterMake the values:
Click the little
save
iconThis injects the
wait-time
task into the runbook workflow element of the pipeline.
Look at the Pipeline Object¶
Review the Runbook Workflow Entrypoints
This view shows the Workflows chains in the Pipeline.
Containers and VMs will enter through
universal-start
Workflow.Bare Metal and PXEing VMs will use the
universal-discover
Workflow.Review the JSON
This view shows the raw JSON object for the Pipeline. The view can also show YAML.
A button in the upper right,
Enable Editing
, allows for direct editing of the object.
Create a Cluster to validate the Pipeline¶
- Navigate to Clusters
Click
Add
Set
Name
tolab2060
Set the
broker/name
tocontext-broker
Set the
broker/set-pipeline
touniversal-application-lab2060
Click
Save
Review the Machines Created by the Cluster¶
- Navigate to Machines
Notice the Machines with names starting with
lab2060-
The machines were created by the
context-broker
for thelab2060
clusters.These machines were assigned the
universal-application-lab2060
pipeline and are running that now. The icons of the machine should be cycling through the list in the pipeline.The task is set to
wait-time
.
Clean up the cluster¶
- Navigate to Clusters
- Select the
lab2060
clusterClick
Actions
and selectWorkflow Mode
Clusters must be
Workflow Modee
to be removed.Click
Actions
and selectDelete (Cleanup)
Click
Cleanup
to confirmThe cluster will run a workflow to cleanup the machines by asking the broker to remove them. Once complete, the cluster will be removed.
Create Cluster Pipeline¶
- Navigate to Pipelines
Click the
Create
buttonThe form should have the following:
- Set
Name
tolab2060-cluster
- Set the Param
universal-application
tolab2060-cluster
- The value must be the part after
universal-application-
in theName
field.- Set the Param
universal-application-chain-index-override
tocluster
- This will set the pipeline to follow set of workflows to create a cluster.
- Set the Meta required params field to
broker/name
- This will require that the cluster page ask for that field. This is a space-separated list.
- Click
Save
Click
Add Params
- Select
broker/set-pipeline
by typing- Select
universal/runbook-during-flexiflow
by typingEdit the
broker/set-pipeline
parameterThe value should be set to
universal-application-lab2060
.Click the little
save
iconEdit the
universal/runbook-during-flexiflow
parameterMake the values:
Click the little
save
iconThis injects the
wait-time
task into the runbook workflow element of the pipeline.
Create a Cluster to validate the Cluster Pipeline¶
- Navigate to Clusters
Click
Add
Set
Name
tolab2060
Set
Cluster Pipeline
tolab2060-cluster
NOTICE The required parameters changed.
Set the
broker/name
tocontext-broker
Do NOT set the
broker/set-pipeline
parameterClick
Save
Navigate to the lab2060 Activity view
Notice that this time the cluster continues on to running the
wait-time
task after creating the cluster machines.Navigate to Machines
If this is done quickly, the machines will not have necessarily completed all there initialization and pipeline completion. The Cluster pipeline defaults to not waiting for machines to complete their pipelines before the cluster continues. This can be changed.
Clean up the cluster¶
- Navigate to Clusters
- Select the
lab2060
clusterClick
Actions
and selectWorkflow Mode
Clusters must be
Workflow Modee
to be removed.Click
Actions
and selectDelete (Cleanup)
Click
Cleanup
to confirmThe cluster will run a workflow to cleanup the machines by asking the broker to remove them. Once complete, the cluster will be removed.
Update Cluster Pipeline to Wait for Machines¶
- Navigate to lab2060-cluster Pipeline
- Click
Add Params
- Select
universal/cluster-provision-post-flexiflow
by typingEdit the
universal/cluster-provision-post-flexiflow
parameterMake the values:
Click the little
save
iconThis injects the
cluster-wait-for-members
task into the cluster provision workflow element of the pipeline.This shows injection of tasks. Alternatively, there is a parameter for this already,
cluster/wait-for-members
. Setting this totrue
instead of this will cause the same effect.
Create a Cluster to validate the Cluster Pipeline¶
- Navigate to Clusters
Click
Add
Set
Name
tolab2060
Set
Cluster Pipeline
tolab2060-cluster
NOTICE The required parameters changed.
Set the
broker/name
tocontext-broker
Do NOT set the
broker/set-pipeline
parameterClick
Save
Navigate to the lab2060 Activity view
Notice that this time the cluster runs
cluster-wait-for-members
and pauses waiting for the machines to finish.Navigate to Machines
If this is done quickly, the machines will not have necessarily completed all there initialization and pipeline completion. Once all the machines finish, the cluster will then run the
wait-time
task.
Clean up the cluster¶
- Navigate to Clusters
- Select the
lab2060
clusterClick
Actions
and selectWorkflow Mode
Clusters must be
Workflow Modee
to be removed.Click
Actions
and selectDelete (Cleanup)
Click
Cleanup
to confirmThe cluster will run a workflow to cleanup the machines by asking the broker to remove them. Once complete, the cluster will be removed.