vCommander Build | Files for this Scenario |
7.0.2 | Download from GitHub |
Kubernetes is an open-source system for deploying and managing containerized applications within a hybrid or cloud environment. Using the Embotics vCommander cloud management platform, you can run a best practices report that compares the current state of a Kubernetes cluster against a set of checks to ensure that the resources (such as pods and containers) deployed on the cluster follow best practices and corporate standards.
This article shows you how to use vCommander 7.0.2 or greater to run a best practices report as a command workflow against a Kubernetes cluster. The best practices report is based on best practices documented by Kubernetes related to configuration, security, and large clusters, as well as on our own experience with Kubernetes.
This article is intended for systems administrators, engineers and IT professionals. Previous experience with Kubernetes is required.
Prerequisites
Before you begin, you must add a Kubernetes cluster as a cloud account (managed system). You can do this in one of two ways:
Add an existing Kubernetes cluster as a vCommander cloud account (managed system). See Adding a Kubernetes Cloud Account (Managed System) in the vCommander User Guide.
Create a new Kubernetes cluster through vCommander and have it automatically added as a vCommander cloud account (managed system). To learn how, search for "Kubernetes" on our Knowledge Base and choose the article for your preferred platform for deploying Kubernetes clusters.
Install the plug-in workflow step packages
This scenario uses the following plug-in workflow steps:
Kubernetes plug-in workflow step package (
wfplugins-k8s.jar
), which provides a plug-in workflow step to add the deployed Kubernetes cluster to vCommander’s inventory as a cloud account (managed system)Text processing plug-in workflow step package (
wfplugins-text.jar
), which provides a plug-in workflow step to manipulate text inputEmail plug-in workflow step package (
wfplugins-email.jar
), which provides a plug-in workflow step to send an email with an optional attachment
Go to Embotics GitHub / Plug-in Workflow-Steps and clone or download the repository. Then in your local version of the repo, browse to the k8s
, text
and email
directories, which contain the Kubernetes, text, and email plug-in workflow step packages.
To learn how to download and install workflow plug-in steps, see Adding plug-in workflow steps.
Import the command workflow
Go to Embotics Git Hub / Scenarios and clone or download the repository.
In vCommander, go to Configuration > Service Request Configuration > Completion Workflows and click Import.
Go to the Scenarios repo that you cloned or downloaded, then from the
Running a Kubernetes Best Practices Report
directory, select the theK8s best practices.yaml
file, and click Open.vCommander automatically validates the workflow and displays the validation results in the Messages area of the Import Workflow dialog.Enter a comment about the workflow in the Description of Changes field, and click Import.
To learn more, see Importing and Exporting Workflow Definitions in the vCommander User Guide.
Optional: Customize the rules and their thresholds
You can optionally customize the rules and their thresholds used by the K8s Best Practices and E-mail command workflow. These rules are defined in a separate configuration file that will be referenced by the Kubernetes Best Practices workflow step.
To customize the set of rules and their thresholds used by the best practices report:
Go to the Scenarios repository that you cloned or downloaded, then from the
Running a Kubernetes Best Practices Reports
directory, copy thedefaultBestPracticesRulesFile.yaml
configuration file to a known location on the vCommander server.Edit the rules and their thresholds as required, then save the file.
Save the file to a known location on the vCommander server.
Configure the command workflow
- In vCommander, go to Configuration > Command Workflows, select the K8s Best Practices and E-Mail workflow, and click Edit.
- In the Command Workflow Configuration dialog, click Next to go to the Steps page.
Configure the Kubernetes Best Practices workflow step. This step runs the checks against the selected Kubernetes cluster.
- Rules File: If you customized the rules and thresholds in the .yaml configuration file, enter the absolute path to the file on the vCommander server, for example,
C:\temp\mybestpractices.workflow.yaml
. If no file is specified, the default set of rules is used.
- Rules File: If you customized the rules and thresholds in the .yaml configuration file, enter the absolute path to the file on the vCommander server, for example,
- Configure the XSLT Transform step. This step processes the output of the previous step.
Output: Specify an absolute path for the output file. The specified directory must already exist.
Stylesheet: Specify the absolute path to a stylesheet file on the vCommander server.
Parameters: Adjust parameter values, such as the report title, as required.
Configure the Email Attachment step. This step emails the output of the previous step.
To: Enter one or more email addresses as required.
Subject: Customize as required.
Body: Customize as required.
- Click Next and Finish.
Run the command workflow
- Select a Kubernetes cluster in the Operational or Deployed view.
- Right-click and select Run Workflow.
In the Select a Workflow dialog, select the workflow and click Run.
The report is generated and emailed to recipients. Below is an example report.