Kubernetes kubectl command List
Kubernetes is an open-source container orchestration platform used for
automating deployment, scaling, and management of containerized Pod Management
applications.
Commands Example Commands Example
It simplifies the process of deploying and managing applications in a
dynamic and scalable environment. kubectl create pod kubectl create -f kubectl delete pod kubectl delete pod
pod.yaml my-pod
Kubernetes Architecture kubectl get pods kubectl get pods kubectl logs kubectl logs my-
pod
kubectl describe pod kubectl describe
Kubernetes Cluster pod my-pod
Cloud Kubernetes Master
Deployment Management
kube-Scheduler
etcd
Commands Example Commands Example
kube-Controller
Manager kube-API Server
kubectl rollout kubectl rollout kubectl scale kubectl scale
history history deployment deployment nginx -
deployment/nginx -replicas=3
Worker Node 1 Worker Node 2 kubectl rollout status kubectl rollout kubectl create kubectl create
status deployment deployment nginx -
deployment/nginx -image=nginx
Kubelet Kube-proxy Kubelet Kube-proxy
kubectl get kubectl get
deployments
Docker Flannel Prom cAdvisor Falco Ceph Docker Flannel Prom cAdvisor Falco Ceph
CRI Pod Node Resource Security Storage CRI Pod Node Resource Security Storage
deployments
Potential Components Potential Components
Kubernetes Workers
Service Management
Deployment Process Key Components Commands Example Commands Example
Pods: Containers grouped kubectl delete kubectl delete kubectl describe kubectl describe
Start
together for deployment. service service my-service service service my-service
Services: Abstraction to access
kubectl get services kubectl get
Creating Deployment
Pod functionality.
Containerization yes yes Scheduling Pods
Configurations
yes
Deployments: Manages lifecycle services
kubectl expose kubectl expose
no
of replicated Pods.
no Error no
deployment my- kubectl create kubectl create
Control Plane: Oversees cluster
CI/CD
Monitoring and
Updating Resources deployment -- service service nodeport
management operations.
Scaling Management
port=80 --target- my-service --
End
port=8080 tcp=80:8080
Error Handling
Like Comment Repost https://academy.blackperldfir.com
Namespace Management Kubernetes Logging - Security Logging Analysis
Commands Example Pod Security Events: Log events related to pod security violations, such as
Commands Example
unauthorized access attempts or privilege escalation.
kubectl apply -f kubectl apply -f kubectl create kubectl create
pod.yaml -- namespace namespace my- Network Policy Violations: Capture events related to network policy
namespace=my- namespace violations, such as unauthorized network access between pods.
namespace
Cluster Authentication Failures: Log authentication failures within the
kubectl delete kubectl delete
kubectl describe kubectl describe Kubernetes cluster, indicating potential unauthorized access attempts.
namespace namespace my-
namespace namespace my-
namespace
namespace Container Runtime Anomalies: Monitor container runtime activities for
anomalies, such as suspicious process execution or file system
kubectl get kubectl get
modifications.
namespaces namespaces
API Server Authorization Events: Log events related to API server
authorization, such as denied requests or policy enforcement.
Node Management
Kubernetes Logging - Identity Logging Analysis
Commands Example Commands Example
User Activity Logs: Track user activity within the Kubernetes cluster,
kubectl get nodes kubectl get nodes kubectl describe kubectl describe including authentication events and resource access.
node node my-node
kubectl cordon kubectl cordon my- Service Account Activity: Monitor service account usage and activity within
node the cluster, including creation, deletion, and resource access.
kubectl drain kubectl drain my-
kubectl uncordon kubectl uncordon node Role-Based Access Control (RBAC) Changes: Log changes to role-based
my-node access control (RBAC) configurations, including role assignments and policy
updates.
Audit Trail of Kubernetes API Calls: Maintain an audit trail of Kubernetes API
Kubernetes Logging calls made by users and service accounts, including requests and
responses.
Service Identity Management: Manage and log service identities used by
Kubernetes Cluster applications and services within the Kubernetes environment.
Logging Agent Log Processor
Pods Pods Pods Pods
Kubernetes Logging Analysis process
Storage/ Main Process Flow
Analysis
Kubelet
Tools
Security Logging Analysis Identity Logging Analysis
Like Comment Repost https://academy.blackperldfir.com
Kubernetes security controls to the MITRE ATT&CK framework
Credential Privilege Defense Lateral
Initial Access Discovery Persistence Execution Impact
Access Escalation Evasion Movement
Role-Based Kubernetes Pod Security Container Disaster
Kubernetes Role-Based Pod Security Network
Access Audit Logs Policies (PSP) Runtime Recovery
Secrets Access Context Segmentation
Control (RBAC) Security Planning
Management Control (RBAC)
Kubernetes Network
Image Service Mesh
Kubernetes API Server Secure Policies Kubernetes Pod Security
Service Signing and
API Server Configuration Kubernetes Kubernetes Resource Policies (PSP)
Account Verification
Configuration Kubernetes Audit Logs Quotas
API Access Usage
Network Secrets Testing and
Kubernetes
Secure Policies Pod Security Management Kubernetes Kubernetes Validating
Pod Security Audit Logs
Kubernetes Context Security Best Audit Logs Disaster
Kubernetes Policies (PSP)
API Access Continuous Automated Practices Recovery
RBAC Rotation and Backup and Secure
Least Monitoring for Documentation Procedures
Secure Misconfigurat Lifecycle Restore for Configuration
Privilege Anomalies in Regularly
Kubernetes ions Management Kubernetes Secure of Container
Principle for Pod Behavior
Dashboard for Kubernetes Secrets Communication Runtimes Automated
Pod Security Role Bindings
Configuration Secrets Automated between Failover and
Context Role-Based Implementing
Regular Review Image Scanning Microservices in Redundancy for
Multi-Factor Misuse Encryption at Access Control Resource
and Audit of and Verification Service Mesh Critical Cluster
Authentication Rest for for etcd Data Quotas for
Service Account in CI/CD Components
(MFA) for Container Kubernetes Implementing Namespace
Permissions Pipelines
Kubernetes API Image Secrets Kubernetes Network Policies Isolation
High Availability
Access Vulnerability Automated Security Best for Inter-Pod
Automated Cluster
Scanning Secure Practices Real-time
Remediation for Threat Traffic Configuration
Restrictive Configuration Documentation Alerting and
PSP Violations Detection
Network Access Centralized for Service Secure Monitoring for
Mechanisms Minimizing
Policies Kubernetes Account Immutable Unauthorized
Role-Based Configuration of downtime risks.
Cluster Tokens Early detection Infrastructure Pod Creation
Access Control Service Mesh
Limiting Logging of suspicious Deployment
Auditing
ingress/egress Secure Strategy Ensuring Container
activities.
traffic flow. Unified logs Storage encrypted and Image Signing
Monitoring RBAC
for better Encryption Ensuring Enforcement
policy changes. authenticated
visibility. Mechanisms consistent and
communication.
reliable Verifying
Protecting environments. container image
data at rest. authenticity.
Like Comment Repost https://academy.blackperldfir.com