::: {.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-libraryif not loaded, by clicking the install button
Create a Pipelines¶
- Navigate to Pipelines
Click the
CreatebuttonThe form should have the following:
- Set
Nametolab2060- Set the Param
universal-applicationtolab2060
- The value must be the part after
universal-application-in theNamefield.- Set the Param
universal-application-chain-index-overridetorunbook
- This will set the pipeline to apply a configurable application as the last step of the pipeline.
- Set the
iconandcolorfields to your choice.- Click
SaveClick
Add Params- Select
dev/wait-iconsby typing- Select
universal/runbook-during-flexiflowby typingEdit the
dev/wait-iconsparameterMake the list of values:
Click the little
saveiconEdit the
universal/runbook-during-flexiflowparameterMake the values:
Click the little
saveiconThis injects the
wait-timetask 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-startWorkflow.Bare Metal and PXEing VMs will use the
universal-discoverWorkflow.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
AddSet
Nametolab2060Set the
broker/nametocontext-brokerSet the
broker/set-pipelinetouniversal-application-lab2060Click
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-brokerfor thelab2060clusters.These machines were assigned the
universal-application-lab2060pipeline 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
lab2060clusterClick
Actionsand selectWorkflow ModeClusters must be
Workflow Modeeto be removed.Click
Actionsand selectDelete (Cleanup)Click
Cleanupto 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
CreatebuttonThe form should have the following:
- Set
Nametolab2060-cluster- Set the Param
universal-applicationtolab2060-cluster
- The value must be the part after
universal-application-in theNamefield.- Set the Param
universal-application-chain-index-overridetocluster
- 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
SaveClick
Add Params- Select
broker/set-pipelineby typing- Select
universal/runbook-during-flexiflowby typingEdit the
broker/set-pipelineparameterThe value should be set to
universal-application-lab2060.Click the little
saveiconEdit the
universal/runbook-during-flexiflowparameterMake the values:
Click the little
saveiconThis injects the
wait-timetask into the runbook workflow element of the pipeline.
Create a Cluster to validate the Cluster Pipeline¶
- Navigate to Clusters
Click
AddSet
Nametolab2060Set
Cluster Pipelinetolab2060-clusterNOTICE The required parameters changed.
Set the
broker/nametocontext-brokerDo NOT set the
broker/set-pipelineparameterClick
SaveNavigate to the lab2060 Activity view
Notice that this time the cluster continues on to running the
wait-timetask 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
lab2060clusterClick
Actionsand selectWorkflow ModeClusters must be
Workflow Modeeto be removed.Click
Actionsand selectDelete (Cleanup)Click
Cleanupto 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-flexiflowby typingEdit the
universal/cluster-provision-post-flexiflowparameterMake the values:
Click the little
saveiconThis injects the
cluster-wait-for-memberstask 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 totrueinstead of this will cause the same effect.
Create a Cluster to validate the Cluster Pipeline¶
- Navigate to Clusters
Click
AddSet
Nametolab2060Set
Cluster Pipelinetolab2060-clusterNOTICE The required parameters changed.
Set the
broker/nametocontext-brokerDo NOT set the
broker/set-pipelineparameterClick
SaveNavigate to the lab2060 Activity view
Notice that this time the cluster runs
cluster-wait-for-membersand 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-timetask.
Clean up the cluster¶
- Navigate to Clusters
- Select the
lab2060clusterClick
Actionsand selectWorkflow ModeClusters must be
Workflow Modeeto be removed.Click
Actionsand selectDelete (Cleanup)Click
Cleanupto confirmThe cluster will run a workflow to cleanup the machines by asking the broker to remove them. Once complete, the cluster will be removed.