Table of Contents

Kubectl

kubectl is the command-line tool used to interact with Kubernetes clusters. Kubectl allows developers and administrators to deploy applications, inspect and manage cluster resources, and troubleshoot issues directly from the terminal.

https://formulae.brew.sh/formula/kubernetes-cli

`kubectl` is the command-line tool that serves as the primary interface for interacting with Kubernetes clusters. It empowers you to deploy applications, inspect and manage cluster resources, view logs, execute commands within containers, and perform a wide range of administrative tasks.

Key Features

Benefits

Code Examples

1. **Get a List of Pods:**

```bash kubectl get pods ```

This command retrieves a list of all pods running in the current namespace.

2. **Describe a Pod:**

```bash kubectl describe pod my-pod ```

This command provides detailed information about a specific pod named “my-pod.”

3. **View Logs of a Container:**

```bash kubectl logs my-pod -c my-container ```

This command displays the logs from the “my-container” container within the “my-pod” pod.

Additional Resources

(DevOps deployment navbar)

Return to GitOps, DevOps deployment, Kubernetes-Docker, Linux configuration (Unix shell initialization - bash profile) Ansible-Terraform, Package manager, Package management, Packages, Configuration, Configuration automation, Deployment automation, Continuous deployment, Delivery, Continuous delivery, Integration, Continuous integration, CI-CD, CI/CD, Version control, GitHub, GitHub Actions, GitHub CLI, AWS Cloud Shell, AWS Tools for PowerShell, Azure Cloud Shell, Azure PowerShell, Google Cloud Shell, Oracle Cloud Shell (Oracle Cloud Infrastructure Cloud Shell), IBM Cloud Shell, Linode Cloud Shell, DigitalOcean Cloud Shell, GitHub Codespaces IDE, AWS Cloud9 IDE, Databricks Cloud Shell, JetBrains, Azure DevOps, JetBrains TeamCity, Management, Configuration management

kubectl controls the Kubernetes cluster manager.

Find more information at: https://kubernetes.io/docs/reference/kubectl/overview/

Basic kubectl Commands (Beginner):

expose it as a new Kubernetes service

Basic kubectl Commands (Intermediate):

by resources and label selector

kubectl Deploy Commands:

controller

replication controller

kubectl Cluster Management Commands:

kubectl Troubleshooting and Debugging Commands:

nodes

kubectl Advanced Commands:

resources

kubectl Settings Commands:

zsh)

Other Commands:

“group/version”

Usage:

 kubectl [flags] [options]

Use “kubectl <command> –help” for more information about a given command. Use “kubectl options” for a list of global command-line options (applies to all commands).