Nodelet
What is a Nodelet?
A nodelet is a software agent that is installed and run on each node as a component of the Platform9 Managed Kubernetes (PMK) stack within a cluster. The nodelet agent provides multiple functions on both the Primary/Master and the worker nodes. This includes the installation and configuration of multiple Kubernetes services including etcd, containerd, Docker, networking, webhooks, and various other components.
Nodelet Phases
Drain All Pods (Stop Only)
Role: Master Worker
If invoked, this task drains the node before implementing a stop function on other tasks. When the _pf9-kube_ service begins draining the node, it executes a priority stop function. This ensures the task is prioritized over the stop function of other tasks.
CLI
Advantages of Using the CLI
Because a CLI does not utilize a graphical user interface (or GUI), it is oftentimes overshadowed by the more user-friendly, visual-based interfaces that a mouse and keyboard affords. What is not apparent is that behind the GUI are many of the same commands which drive the functionality of a program. The strength of the CLI is speed, efficiency, and customization with decreased memory consumption. In addition, It allows for experienced users to create scripts to automate repetitive tasks as well as chain command together to achieve a greater level of customization and capabilities than when using a single mouse click.
Many new users express the steeper learning curve as the primary downside of using the CLI. Additionally, there is less room for error, and understanding the large number of command options available to utilize can be daunting. New users can be stymied when trying to remember a command, its syntax, and the available flags and options it affords. Some relief is granted via the use of quick reference guides that are widely available. Users will often find that the ongoing usage of the CLI will increase productivity over time.
Caution should be exercised when running commands as the root user. Running an errant or malformed command can cause severe issues and damage the system, up to and including needing a full system restore. The only time clients should run commands as a root user are when configuring the underlying file system.
Best practice dictates creating secondary user(s) with limited permission sets. Additionally, backup copies of files or folder should be made before editing any important system configuration files or folders.
The following section specifies the nodeletd phase related commands used to interact with the k8s stack via the CLI.
Nodelet CLI Syntax
_opt_pf9_nodelet_nodeletd phases [command]Phases Help
The help flag defines the list of available options when running the nodelet phases command.
Phases List
This command lists the available phases by passing the list option.
Phases Stop
This command stops the pf9-kube stack.
Phases Start
This command starts the pf9-kube stack.
Phases Restart
This command restarts the pf9-kube stack.
Phases Status
The verbose flag provides information on the condition and state of the pf9-kube stack.
Note: CLI output will contain info about the various phases that run before the following table is displayed. This info is also contained in the /var/log/pf9/kube/kube.log file.
Node Health
The curl command below provides an overview of the health of the specific node. The $TOKEN refers to a temporary authentication token utilized to verify the service user, which removes the need for an interactive authentication method. The DU reference is in regard to the deployment unit that operates the platform9's server-side components. The $UUID is the universal unique identifier for an object in the cluster. A sample output of the command is shown below.
The last_failed_status_check field is cleared 10 minutes after the status check is successful.
The pf9_kube_service_state tries to simulate the node state as reported by the hostAgent. The values this field can report on are described in the table below.
OK
Everything is fine.
Converging
Starting pf9-kube failed and this is the initial attempt to restart it.
Retrying
Starting pf9-kube failed and Nodelet has tries less than 10 times to start pf9-kube.
Failed
Starting pf9-kube failed and Nodelet has tried more than 10 times to start pf9-kube.
Was this helpful?
