### Install and Enable Cockpit WS Container Service Source: https://github.com/cockpit-project/cockpit/blob/main/containers/ws/README.md Install the Cockpit web service container and configure it to start automatically on boot using systemctl. ```bash podman container runlabel INSTALL quay.io/cockpit/ws systemctl enable cockpit.service ``` -------------------------------- ### GetInitialSetupDefaults Source: https://github.com/cockpit-project/cockpit/wiki/Bootstrapping-a-network-of-Cockpit-managed-machine Retrieves the default parameters for the initial setup of a machine. This method is useful for populating setup dialogs with sensible defaults. ```APIDOC ## GetInitialSetupDefaults ### Description Retrieves the default parameters for the initial setup of a machine. This method is useful for populating setup dialogs with sensible defaults. ### Method DBUS Call ### Interface com.redhat.Cockpit.Manager ### Method Signature GetInitialSetupDefaults(parameters: a{sv}) returns (defaults: a{sv}) ### Parameters #### Input Parameters - **parameters** (a{sv}) - A dictionary of string keys and variant values. This parameter is typically used to pass probing information. #### Output Parameters - **defaults** (a{sv}) - A dictionary of string keys and variant values representing the default setup parameters. ``` -------------------------------- ### Init Command Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/protocol.md An example of the 'init' command, used for establishing a new transport connection. It includes fields like version, capabilities, and host. ```json { "command": "init", "version": 1, "capabilities": ["dbus", "shell"], "channel-seed": "a1b2c3d4e5f6", "host": "localhost", "os-release": { "NAME": "Fedora", "VERSION_ID": "38" }, "packages": ["cockpit", "podman"], "superuser": "require" } ``` -------------------------------- ### Enable Multipath Support Source: https://github.com/cockpit-project/cockpit/wiki/Storage---Multipath Commands to install multipath support and enable it. This is the initial setup required for multipath devices. ```bash # dnf install device-mapper-multipath # mpathconf --enable # multipathd reconfigure || systemctl start multipathd ``` -------------------------------- ### Start Manual Test VM Source: https://github.com/cockpit-project/cockpit/blob/main/test/README.md Starts a virtual machine for manual interactive testing. The output will provide SSH and web access details. ```bash bots/vm-run -s cockpit.socket arch ``` -------------------------------- ### Enable and Start Kubernetes Services Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-Kubernetes:-Add-cluster-node Ensure that the necessary Kubernetes services are enabled to start on boot and are currently running on the new node. ```bash systemctl enable kubelet kube-proxy flanneld systemctl start kubelet kube-proxy flanneld ``` -------------------------------- ### PAM Configuration Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/man/pages/pam_ssh_add.8.adoc Example PAM configuration showing how to integrate pam_ssh_add for authentication and session management. It should be used alongside an actual authentication module like pam_unix.so. ```pam auth required pam_unix.so auth optional pam_ssh_add.so session optional pam_ssh_add.so ``` -------------------------------- ### InitialSetup Source: https://github.com/cockpit-project/cockpit/wiki/Bootstrapping-a-network-of-Cockpit-managed-machine Performs the initial setup of a machine using the provided parameters. This method is called after gathering defaults and user-specified configurations. ```APIDOC ## InitialSetup ### Description Performs the initial setup of a machine using the provided parameters. This method is called after gathering defaults and user-specified configurations. ### Method DBUS Call ### Interface com.redhat.Cockpit.Manager ### Method Signature InitialSetup(parameters: a{sv}) ### Parameters #### Input Parameters - **parameters** (a{sv}) - A dictionary of string keys and variant values containing the configuration for the initial setup. This includes details like hostname, web server enablement, domain information, and account configurations. ``` -------------------------------- ### Example Bridge Command with Tag Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc Demonstrates how to spawn a new command using a specific tag with the example-bridge utility. ```bash TAG=tag2 /example-bridge --tag tag2 ``` -------------------------------- ### Specify Available Devices for Installation Source: https://github.com/cockpit-project/cockpit/blob/main/doc/anaconda.md Use the 'available_devices' entry to inform Cockpit which top-level block devices can be used for OS installation. This should not include partitions or complex device types. ```json { "available_devices": [ "/dev/sda" ] } ``` -------------------------------- ### Install Certbot and Let's Encrypt Apache Plugin Source: https://github.com/cockpit-project/cockpit/wiki/Proxying-Cockpit-over-Apache-with-LetsEncrypt Install the necessary tools to obtain and manage Let's Encrypt TLS/SSL certificates for Apache. ```bash sudo apt install letsencrypt python-letsencrypt-apache ``` -------------------------------- ### List Installed Packages Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc Use the `cockpit-bridge --packages` command to list all packages installed on the server. Output may vary based on the user running the command. ```bash $ cockpit-bridge --packages ``` -------------------------------- ### Install from Upstream Sources Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Build and install Cockpit from its source code. Includes steps for copying PAM configurations on different distribution families. ```bash make sudo make install ``` ```bash sudo cp tools/cockpit.pam /etc/pam.d/cockpit ``` ```bash sudo cp tools/cockpit.debian.pam /etc/pam.d/cockpit ``` -------------------------------- ### Basic manifest.json Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc A simple manifest.json file showing version, requirements, and a tool definition. ```json { "version": 0, "require": { "cockpit": "120" }, "tools": { "mytool": { "label": "My Tool", "path": "tool.html" } } } ``` -------------------------------- ### Enabling and Starting Redis and pmproxy Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/feature-pcp.adoc Enable and start the `redis` and `pmproxy` services to expose PCP metrics to other machines over TCP. This is a prerequisite for remote metric collection. ```bash systemctl enable --now redis pmproxy ``` -------------------------------- ### SELinux Export Command Output Example Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-SELinux-export-import This is an example of the output generated by the `sudo semanage export` command, which forms the basis of the SELinux configuration export file. ```shell boolean -D login -D interface -D user -D port -D node -D fcontext -D module -D boolean -m -1 virt_sandbox_use_all_caps boolean -m -1 virt_use_nfs fcontext -a -f a -t chrome_sandbox_exec_t '/usr/lib/chrome-sandbox' fcontext -a -f a -t bin_t '/usr/lib/chromium-browser' fcontext -a -f a -t bin_t '/usr/lib/chromium-browser/chromium-browser.sh' fcontext -a -f a -t cockpit_ws_exec_t '/usr/libexec/cockpit-ssh' ``` -------------------------------- ### File Replace Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cockpit-file.adoc Shows how to write new content to a file. Handles successful replacement and errors. ```javascript cockpit.file("/path/to/file").replace("my new content\n") .then(tag => { ... }) .catch(error => { ... }); ``` -------------------------------- ### Simple File Read Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cockpit-file.adoc Demonstrates reading a file using its path. Handles successful reads and errors. ```javascript cockpit.file("/path/to/file").read() .then((content, tag) => { ... }) .catch(error => { ... }); ``` -------------------------------- ### Create and Install systemd-sysext Extension Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Generates and installs a systemd-sysext extension for Cockpit, allowing local changes to be tested without modifying the base system. This is useful for rapid development and testing. ```bash tools/make-sysext ``` -------------------------------- ### Set Up Git Pre-Rebase Hook Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Install a git pre-rebase hook to manage drawbacks associated with git submodules. ```bash ln -s ../../tools/git-hook-pre-rebase .git/hooks/pre-rebase ``` -------------------------------- ### Set Up Git Pre-Push Hook Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Install a git pre-push hook to automatically run static code checks before pushing commits. ```bash ln -s ../../tools/git-hook-pre-push .git/hooks/pre-push ``` -------------------------------- ### manifest.json with Conditions Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc Example of manifest.json using conditions to check for file existence and non-existence before enabling a tool. ```json { "version": 0, "require": { "cockpit": "120" }, "conditions": [ {"path-exists": "/usr/bin/mytool"}, {"path-exists": "/etc/mytool.conf"}, {"path-not-exist": "/etc/incompatible-tool"} ], "tools": { "mytool": { "label": "My Tool", "path": "tool.html" } } } ``` -------------------------------- ### Samba AD Certificate Mapping Configuration Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cert-authentication.adoc Provides an example configuration snippet for setting up certificate mapping rules in SSSD for Samba Active Directory. This is necessary when using the textual 'userCertificate' attribute. ```ini [certmap/example.com/adcerts] ``` -------------------------------- ### Cockpit Component URL Structure Examples Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/urls.adoc These examples illustrate the general structure of URLs used for Cockpit components, including variations for host identification and embedding. ```text /cockpit/@localhost/package/component.html#/hash ``` ```text /cockpit/$checksum/package/component.html#/hash ``` ```text /cockpit/@server.example.com/package/component.html#/hash ``` ```text /cockpit+embedder/@localhost/package/component.html#/hash ``` -------------------------------- ### Install yum changelog plugin and view changelogs Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-System-Updates-for-dnf,-yum,-apt-hosts Installs the yum-plugin-changelog and then performs a yum update to display package changelogs. The update is run with `--assumeno` to avoid applying the update, and changelog sections are parsed from the output. ```bash # yum install -y yum-plugin-changelog # yum --changelog update ``` -------------------------------- ### Start Broadway Daemon and Applications Source: https://github.com/cockpit-project/cockpit/blob/main/examples/gtk-broadway/gtk.html This snippet starts the 'broadwayd' process and, upon receiving a message (indicating it's ready), loads the broadway_js function and launches the applications. This ensures that the necessary backend services are running before attempting to display GTK applications. ```javascript var started = false; var broadwayd = process(["broadwayd", ":5"]); broadwayd.addEventListener("message", function(ev, payload) { if (!started) { started = true; broadway_js(); applications(); } }); ``` -------------------------------- ### Set Up Git Post-Commit Hook Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Install a git post-commit hook to run static code checks after each commit. ```bash ln -s ../../tools/git-hook-post-commit .git/hooks/post-commit ``` -------------------------------- ### Recompile and Install SELinux Policy Source: https://github.com/cockpit-project/cockpit/blob/main/selinux/HACKING.md This command sequence recompiles the Cockpit SELinux policy, copies it to a remote target, and installs it using `semodule`. Use this for rapid iteration after local configuration. ```bash make cockpit.pp && scp cockpit.pp c:/tmp/ && ssh c semodule -i /tmp/cockpit.pp ``` -------------------------------- ### Run QUnit Tests Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Starts a test server for QUnit (JavaScript) tests. It provides a URL to access tests in a browser. ```bash ./test-server ``` -------------------------------- ### Enter Development Container Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Enter the created development container to start working on Cockpit. Your home directory and D-Bus are shared with the host. ```bash toolbox enter cockpit ``` -------------------------------- ### Build Dependencies from Spec File Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Uses DNF to automatically install build dependencies based on the Cockpit RPM specification file. ```bash sudo dnf builddep --spec tools/cockpit.spec ``` -------------------------------- ### Get Previous Release Tag (Bash/Zsh) Source: https://github.com/cockpit-project/cockpit/wiki/ReleaseProcess Retrieves the most recent Git tag, which is used to determine the starting point for new release notes and versioning. ```bash PREV=$(git describe --abbrev=0 --tags); echo $PREV ``` -------------------------------- ### Prepare OS Image for Testing Source: https://github.com/cockpit-project/cockpit/blob/main/test/README.md Builds and installs Cockpit into a VM using the default OS image. Use --help for special modes like skipping unit tests or using a container image. ```bash test/image-prepare ``` -------------------------------- ### Get Previous Release Tag (Fish) Source: https://github.com/cockpit-project/cockpit/wiki/ReleaseProcess Retrieves the most recent Git tag using Fish shell syntax, used for determining the starting point for new release notes and versioning. ```fish set PREV $(git describe --abbrev=0 --tags); echo $PREV ``` -------------------------------- ### PolicyKit Rule for Managing Systemd Units Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/feature-systemd.adoc An example PolicyKit rule written in JavaScript that grants specific permissions to users in a group for managing systemd units like starting, stopping, or restarting services. ```javascript polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.systemd1.manage-units") { if (subject.isInGroup("operators") && action.lookup("unit") == "httpd.service") { var verb = action.lookup("verb"); if (verb == "start" || verb == "stop" || verb == "restart") { return polkit.Result.YES; } } } }); ``` -------------------------------- ### Enable dnf Automatic Installation Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-System-Updates-for-dnf,-yum,-apt-hosts Installs the dnf-automatic package and enables its systemd timer for daily update downloads and installations. Use this to automate dnf updates. ```sh dnf install dnf-automatic systemctl enable --now dnf-automatic-install.timer ``` -------------------------------- ### Install unattended-upgrades for apt Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-System-Updates-for-dnf,-yum,-apt-hosts Installs the unattended-upgrades package, which is the primary tool for managing automatic updates on Debian-based systems. ```sh apt-get install -y unattended-upgrades ``` -------------------------------- ### Install Testing Dependencies Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Installs essential packages required for running tests within the Cockpit project on Fedora/CentOS. ```bash sudo dnf install curl expect xz rpm-build chromium-headless dbus-daemon \n libvirt-daemon-driver-storage-core libvirt-daemon-driver-qemu libvirt-client python3-libvirt \n python3-pyyaml ``` -------------------------------- ### Join a Domain using realm command Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/feature-realmd.adoc This command-line example shows how to join a system to a domain using the realm utility. It prompts for administrator credentials. ```bash $ realm join example.com Password for Administrator: ``` -------------------------------- ### Start a Test Domain VM Source: https://github.com/cockpit-project/cockpit/blob/main/pkg/systemd/README-realmd.md Initiates a virtual machine for running test domain services. This is the first step in setting up a local test environment for domain integration. ```bash $ bots/vm-run --network services ``` -------------------------------- ### Install NPM on Debian/Ubuntu Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Installs the Node Package Manager (NPM) on Debian or Ubuntu systems using APT. ```bash sudo apt install npm ``` -------------------------------- ### Install NPM on Fedora/CentOS Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Installs the Node Package Manager (NPM) on Fedora or CentOS systems using DNF. ```bash sudo dnf install npm ``` -------------------------------- ### Record Desktop for Video Capture Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Use this command to record your screen for feature demonstrations. Ensure `recordmydesktop` is installed. This command is specific to X11 environments. ```bash recordmydesktop -x 1 -y 200 --width 1024 --height 576 \ --fps 24 --freq 44100 --v_bitrate 2000000 ``` -------------------------------- ### Install Cockpit Packages with rpm-ostree Source: https://github.com/cockpit-project/cockpit/blob/main/containers/ws/README.md Install necessary Cockpit packages on CoreOS systems using rpm-ostree. This is typically followed by a reboot. ```bash rpm-ostree install cockpit-system cockpit-ostree cockpit-podman reboot ``` -------------------------------- ### Open Channel Command Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/protocol.md Demonstrates the 'open' command used to establish a new communication channel. It specifies parameters like channel ID, payload type, and host. ```json { "command": "open", "channel": "my-new-channel", "payload": "json", "host": "remote.example.com", "user": "admin", "superuser": "try", "flow-control": true, "send-acks": "bytes" } ``` -------------------------------- ### Prepare Build Environment Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Run autogen.sh to prepare the build tree and download dependencies. Use this instead of ./configure when working with a Git clone. ```bash ./autogen.sh --prefix=/usr --enable-debug ``` -------------------------------- ### Install firewalld and Remove UFW on Ubuntu Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-Firewall Installs the firewalld package and removes UFW on Ubuntu systems. This command is used when standardizing on firewalld. ```bash sudo apt install firewalld ufw- sudo systemctl enable --now firewalld ``` -------------------------------- ### Cockpit HTTP Client Constructor with Options Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cockpit-http.adoc Demonstrates creating an HTTP client instance with various configuration options including address, headers, port, and TLS settings. ```javascript http = cockpit.http({ "address": "localhost", "headers": { "Authorization": "Basic dXNlcjpwYXNzd29yZA==" }, "port": 443, "tls": { "validate": true, "authority": { "file": "/etc/pki/tls/certs/ca-bundle.crt" }, "certificate": { "data": "-----BEGIN CERTIFICATE-----\nMIIDsDCCA..." }, "key": { "data": "-----BEGIN RSA PRIVATE KEY-----\nMIIEogIBA..." } } }); ``` -------------------------------- ### Example Package File Layout Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc Illustrates the typical directory structure for a Cockpit package named 'my-package', including the essential manifest.json and other component files. ```text /usr/share/cockpit/ my-package/ manifest.json file.html some.js ``` -------------------------------- ### Manifest Override Example Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc An example of a manifest override file using JSON Merge Patch to hide a menu item and reorder another. ```json { "menu": { "logs": null, "services": { "order": -1 } } } ``` -------------------------------- ### Install Node Modules for Package.json Changes Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Run this command after modifying package.json to create a new cache of Node.js modules by running npm install. ```bash tools/node-modules install ``` -------------------------------- ### Stop and Remove systemd-sysext Extension Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Stops and removes the currently installed systemd-sysext extension for Cockpit. This command reverts the system to its state before the extension was installed. ```bash tools/make-sysext stop ``` -------------------------------- ### Start Retrieving Live Metrics Data Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cockpit-metrics.adoc Initiates the retrieval of live metrics data as it becomes available. This method starts the real-time data stream. ```javascript metrics.follow() ``` -------------------------------- ### Show dnf security updates Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-System-Updates-for-dnf,-yum,-apt-hosts This command lists available security-related updates. There is no direct command to only install security updates, but the list can be used to manually install them. ```bash dnf updateinfo info security ``` -------------------------------- ### Obtain Kerberos Ticket Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/sso.adoc Obtain a Kerberos ticket for a user in the EXAMPLE.COM domain using the kinit command. ```bash kinit user@EXAMPLE.COM ``` -------------------------------- ### List Upgradable Packages with apt Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-System-Updates-for-dnf,-yum,-apt-hosts Use this command to list the number, names, and versions of packages with available updates. It requires updating the package list first. ```bash apt-get -qq update; apt list --upgradable ``` -------------------------------- ### Launch Chrome with Delegation Whitelist Argument Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/sso.adoc Launch Google Chrome with command-line arguments to specify allowed authentication servers and delegation URIs. ```bash google-chrome --auth-server-whitelist=*example.com --auth-negotiate-delegate-whitelist=*example.com ``` -------------------------------- ### Install C Compilation Build Dependencies Source: https://github.com/cockpit-project/cockpit/blob/main/HACKING.md Installs DNF utilities and Python macros necessary for building RPM packages, specifically for compiling C components of Cockpit. ```bash sudo dnf install dnf-utils python-srpm-macros ``` -------------------------------- ### Launch Chrome with SSO Whitelist Argument Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/sso.adoc Launch Google Chrome with command-line arguments to specify allowed authentication servers. ```bash google-chrome --auth-server-whitelist=*example.com ``` -------------------------------- ### cockpit.init() Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cockpit-util.adoc Requests initialization of the Cockpit client library, ensuring the transport is connected and ready for channel creation. Populates `cockpit.info`. ```APIDOC ## cockpit.init() ### Description Requests initialization of the Cockpit client library. This will ensure that the transport is connected and we are ready to create channels. It also populates the `cockpit.info` field. This function returns a promise. Initialization isn't complete until the promise has resolved. You can either `await` it or call `.then()` on it. ### Returns - Promise: A promise that resolves when initialization is complete. ``` -------------------------------- ### Build ws Container with Local Build Tree Source: https://github.com/cockpit-project/cockpit/blob/main/containers/README.md Builds the 'ws' container using binaries and pages from the local build tree for faster iteration. Requires the project to be built on the same OS as the container and configured with '--prefix=/usr'. ```bash make ws-container-build-tree ``` -------------------------------- ### Manifest.json Example with Dynamic Variables Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/packages.adoc This example demonstrates using dynamic variables from open command values within the 'environ' and 'spawn' properties of a bridge definition in manifest.json. The variables are enclosed in ${}. ```json { "bridges": [ { "match": { "payload": "example" }, "environ": [ "TAG=${tag}" ], "spawn: [ "/example-bridge", "--tag", "${tag}" ], "problem": "access-denied" } ] } ``` -------------------------------- ### Performing an HTTP GET Request Source: https://github.com/cockpit-project/cockpit/blob/main/doc/modules/guide/pages/cockpit-http.adoc Initiates an HTTP GET request to a specified path. Supports query parameters and custom headers. Returns a Promise that resolves on success or rejects on failure. ```javascript request = http.get(path, [params, [headers]]) ``` -------------------------------- ### Indicate System BIOS or EFI Installation Source: https://github.com/cockpit-project/cockpit/blob/main/doc/anaconda.md Set the 'efi' flag to true or false to indicate whether the installation is for a BIOS or EFI system. This influences the types of special partitions that can be easily created. ```json { "efi": true } ``` -------------------------------- ### View apt Updates Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-System-Updates-for-dnf,-yum,-apt-hosts Use this command to see a human-readable and structured description of available updates for apt. ```bash apt list --upgradable ``` -------------------------------- ### Create Apache Virtual Host for Cockpit Source: https://github.com/cockpit-project/cockpit/wiki/Proxying-Cockpit-over-Apache-with-LetsEncrypt Set up a basic Apache virtual host configuration to serve Cockpit. Ensure the ServerName matches your domain. ```apache ServerName cockpit.your-domain.com ``` -------------------------------- ### Kubernetes Node Definition Example Source: https://github.com/cockpit-project/cockpit/wiki/Feature:-Kubernetes:-Add-cluster-node An example JSON file defining a Kubernetes node, which can be used with `kubectl create -f` to add the machine to the cluster. This definition includes essential capacity information like memory and CPUs. ```json { "apiVersion": "v1", "kind": "Node", "metadata": { "name": "node1", "labels": { "kubernetes.io/hostname": "node1" } }, "spec": { "podCIDR": "10.244.0.0/24" } } ```