Progress Chef Courier is an enterprise job orchestration and automation platform that allows you to perform any action over your IT fleet with immense flexibility. It allows users to orchestrate timing and targeting dimensions for the action/execution capabilities that all other Chef products provide.
Chef Courier gives you complete control and flexibility over how customers can perform actions on the fleet, enabling IT operators, InfoSec engineers and other administrators to run on-demand jobs. Importantly, it removes the need to build custom solutions for emergency tasks and reactionary work, reducing the burden on your team.
Three different aspects help customers control their fleet:
Whenever: Perform the action anytime – i.e., now, on-demand, scheduled, recurring, or recurring at a specific interval with exception.
Wherever: Target a specific node or a subset of nodes. For example, start with staging, production or a region like the US-East.
Whatever: Perform any action, such as an OS command, a cookbook run, an InSpec scan, or a combination of all these. The output of one command can be passed to another command, or it can be conditional, where a command runs if the previous run succeeds.
A step-by-step guide will help you install and use Chef Courier easily.
Before that, let’s learn about the Progress Chef 360 platform.
Courier is built and installed on the Chef 360 platform, a base platform where you can log in, access the dashboard, create users and manage all administrative tasks.
The vision of Chef 360: A modern, cloud-native DevOps platform that democratizes DevOps by empowering IT operators and DevOps Engineers to manage mission-critical infrastructure securely.
$ curl https://replicated.app/embedded/chef-360/stable -H "Authorization: <YOUR_AUTH_CODE>" -o chef-360-stable.tgz
[Once you are entitled to Chef 360, you’ll receive an Auth code to install the platform.]
$ tar -xvzf chef-360-stable.tgz
$ sudo ./chef-360 install --license license.yaml
To configure Chef 360, log into the Chef 360 Admin Console using the link provided during installation and navigate the configuration options.
Note: Point your machine IP to FQDN.
o Example: Advance configuration and Show Add-on's
o Example: Tenant name: demo
o Tenant TLD: chefdemo.cloud
o Tenant subdomain: chef360
Note: The system automatically updates the port to 31000, which is the port for the API gateway.
After entering your deployment settings, verify that all settings are correct, then select ‘Continue’ to save the configuration.
Chef 360 runs preflight checks to verify the deployment. Once deployed, you should see the current configuration installed, the licensing key and a few other options.
Note: If you face any problems with deployment settings, the Admin Console returns a warning. Correct the settings and select Re-run.
$ chef-courier-cli --help
You need to register the CLIs once you have installed them.
Registration creates a profile on the user machine containing user credentials, roles and permissions.
$ chef-courier-cli register-device --device-name <WORKSTATION_NAME> --profile-name <PROFILE_NAME> --url <TENANT_URL>
Once your workstation is registered, you should view all the details below.
Test your connection by getting the role associated with your user account.
$ chef-courier-cli user-account self get-role --profile <PROFILE_NAME>
You can define skills and enroll nodes while installing and managing abilities with Node Management.
You can perform the following:
A skill is an agent that allows you to perform actions on a node to achieve an outcome. It can be either a canister-based or on-canister-based skill. Skills can be Chef-owned (Infra, InSpec, Courier, etc.) and managed by the customer on Node Management.
The following Chef 360 skills are required or recommended for managing nodes, running actions and returning action results:
Courier Runner Skill: The Courier Runner skill interprets the Courier Job definitions sent to it by the Courier Dispatcher and executes them on the node.
$ chef-node-management-cli management skill create-skill --body-file courier-runner-skill.json
You can create Gohai skills, Shell Interpreter and Restart Interpreter skills in a similar manner. Find more details here.
$ chef-node-management-cli management skill find-all-skills
Skill Assembly: A skill assembly is a rule of skills that must be added to the nodes. For the first step, we will create a default/blank skill assembly and update it later to add more skills.
{
"name": "my-skill-assembly-with-restart",
"skills": [
{
"action": "add",
"skill": {
"name": "courier-runner",
"channel": "stable",
"value": ["1.3.1"]
}
},
{
"action": "add",
"skill": {
"channel": "stable",
"name": "chef-gohai",
"value": ["0.3.1"]
}
},
{
"action": "add",
"skill": {
"name": "shell-interpreter",
"channel": "stable",
"value": ["0.3.1"]
}
}
]
}
Create Settings: Manage configurations required for a skill using Global Defaults or Override Settings.
Global Defaults: This contains key-value pairs that a skill needs to function on a node. By default, all nodes receive settings defined in Global Defaults.
Override Settings: This contains key-value pairs that a skill would need to function on a node. They override settings specified in Global Defaults.
Create node override settings for the Courier Runner and Gohai skills.
o $ chef-node-management-cli management setting create-setting --body-file node-override-setting.json
o $ chef-node-management-cli management setting find-one-setting --settingId <SETTING_ID>
A node cohort provides a common set of override settings, which are required skill settings (like a config.rb for Chef Infra Client today), and a skill assembly, which are skills that are installed or removed from a node after enrollment. This set of skills and settings are applied to every node in a cohort. Nodes must be assigned a node cohort during enrollment.
$ chef-node-management-cli management cohort create-cohort --body-file node-cohort.json
Node enrollment brings nodes under management by Chef 360. You can enroll nodes using a JSON or YAML file.
Requirements:
In this example, we are creating a JSON file for node management.
Note: The SSH key can’t be a multiline string in the JSON payload. Replace new lines with the newline character \n. You can use the following command to replace new lines in a PEM file: $ awk 'NF {sub(/\r/, ""); printf "%s\n",$0;}' <FILENAME.pem>
$ chef-node-management-cli enrollment enroll-node --body-file enroll-linux.json
The above command will place the enrolment request and return a response like the one below, containing the node and enrolment ID.
Check the status of Node Enrollment.
$ chef-node-management-cli status get-status --nodeId <NodeId>
You can find more details about Enrolling Nodes here.
Adding and Installing Skill to Courier Node.
{
"skills": [
{
"action": "add",
"skill": {
"name": "courier-runner",
"channel": "stable",
"value": ["1.3.1"]
}
},
{
"action": "add",
"skill": {
"channel": "stable",
"name": "chef-gohai",
"value": ["0.3.1"]
}
}
]
}
$ chef-node-management-cli management assembly update-assembly --skillAssemblyId --body-file update-skill-assembly-for-courier.json
{ "skills": [ { "action": "add", "skill": { "name": "courier-runner", "channel": "stable", "value": ["1.3.1"] } }, { "action": "add", "skill": { "channel": "stable", "name": "chef-gohai", "value": ["0.3.1"] } }, { "action": "add", "skill": { "name": "shell-interpreter", "channel": "stable", "value": ["0.3.1"] } } ] }
chef-node-management-cli management assembly update-assembly --skillAssemblyId --body-file install-si-to-node.json
A single place in which what, where and when are provided for actions to be performed. This umbrella term is used at the highest level for Courier. Users can define multiple jobs.
Example:
o For job template refer here.
$ chef-courier-cli scheduler jobs add-job --body-file create-job-simple.json
$ chef-courier-cli state instance list-instance-runs --<INSTANCE_ID>
In conclusion, please follow the steps provided in this blog to set up Chef Courier effortlessly. Chef Courier is designed to dissolve barriers between teams and help democratize DevOps. Enjoy seamless functionality and superior performance from the moment you begin using it.
We are confident this product will help you simplify your workflow orchestration tasks. Thank you for choosing our product, and welcome to a new level of efficiency and innovation.
Videos:
Community page: Click here.