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 input

  • Email 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

  1. Go to Embotics Git Hub / Scenarios and clone or download the repository.

  2. In vCommander, go to Configuration > Service Request Configuration > Completion Workflows and click Import.

  3. Go to the Scenarios repo that you cloned or downloaded, then from the Running a Kubernetes Best Practices Report directory, select the the K8s 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.

  4. 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:

  1. Go to the Scenarios repository that you cloned or downloaded, then from the Running a Kubernetes Best Practices Reports directory, copy the defaultBestPracticesRulesFile.yaml configuration file to a known location on the vCommander server.

  2. Edit the rules and their thresholds as required, then save the file.

  3. Save the file to a known location on the vCommander server.

Configure the command workflow

  1. In vCommander, go to Configuration > Command Workflows, select the K8s Best Practices and E-Mail workflow, and click Edit
  2. In the Command Workflow Configuration dialog, click Next to go to the Steps page.
  3. 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.
  4. 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.

  5. 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.

  6. Click Next and Finish.

Run the command workflow

  1. Select a Kubernetes cluster in the Operational or Deployed view.
  2. Right-click and select Run Workflow.
  3. 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.