• kubernetes shortcuts

Most useful kubernetes Shortcuts

Par Hichem

Posté le March 06, 2023 00:00 AM

Node

A Kubernetes cluster's worker computer can be either a physical machine or a virtual machine. The nodes are responsible for operating and managing the pods. To retrieve information about the nodes, you can use the command:

kubectl get no

Namespace

Using namespaces, it is possible to partition the cluster resources into virtual clusters. This approach provides a designated range of names and facilitates the sharing of a single physical cluster among multiple teams or projects, while ensuring the isolation of their respective resources:

kubectl get ns

Deployment

Simplifies the management and control of application lifecycles within a cluster. This streamlines the deployment and updating of applications, minimizing both downtime and the need for manual intervention.

kubectl get deploy

Pod

A Pod, is the fundamental and smallest unit. It represents either a single running process or a group of interconnected processes on a node. Pods are the units that Kubernetes schedules and manages. To retrieve information about Pods, you can use the command:

kubectl get po

Service

A service, is an abstraction that defines a logical group of pods and governs how to access them. It provides a dependable network endpoint (IP address) and load balancing for the pods it represents. To obtain information about services, you can use the command::

kubectl get svc

Ingress

Is an API object that serves as a gateway for external traffic to enter the cluster. It acts as an intermediary between the outside world and the services operating within the cluster. To retrieve information about Ingress objects, you can use the command:

kubectl get ing

ReplicaSet

in Kubernetes are essential objects that ensure a specific number of pod replicas remain operational at all times. They are responsible for the scaling and management of pod quantities for a given application. To retrieve information about ReplicaSet, you can use the following command:

kubectl get rs

Persistent Volumes (PVs)

Are storage resources that offer long-lasting and self-contained storage for applications. They facilitate data persistence and can be provisioned dynamically or allocated statically within the cluster. To retrieve information about Persistent Volumes, you can use the command: :

kubectl get pv

Persistent Volume Claims (PVCs)

Are requests made by applications to obtain storage resources. PVCs serve as a convenient abstraction layer that allows applications to request and access persistent storage without directly interacting with specific Persistent Volumes (PVs). :

kubectl get pvc

Service Account

Service Accounts are utilized to grant identity and access control to pods within the cluster. They offer a way to authenticate and authorize the pods, enabling them to interact with other resources securely. To obtain information about Service Accounts, you can use the command:

kubectl get sa

Storage Classes

Are employed to dynamically allocate various types of storage volumes based on pre-defined configurations. They provide a flexible way to define the characteristics and properties of storage that can be dynamically provisioned for applications within the cluster. To obtain information about Storage Classe, you can use the command:

kubectl get sc

Here’s the current list of shortened resource types:

  • po :Pods
  • rs : ReplicaSets
  • deploy :Deployments
  • svc :Services
  • ns :Namespaces
  • netpol :Network policies
  • pv :Persistent Volumes
  • pvc :PersistentVolumeClaims
  • in :Service Accounts

Besoin d'experts en Kubernetes?
Contactez-nous