Cluster Management
Display endpoint information about the master and services in the cluster kubectl cluster-info
Display the Kubernetes version running on the client and server kubectl version
Get the configuration of the cluster kubectl config view
List the API resources that are available kubectl api-resources
Daemonsets Shortcode = ds
List everything kubectl get all --all-namespaces
List one or more daemonsets kubectl get daemonset
Edit and update the definition of one or more daemonset kubectl edit daemonset
Delete a daemonset kubectl delete daemonset
Create a new daemonset kubectl create daemonset
Manage the rollout of a daemonset kubectl rollout daemonset
Display the detailed state of daemonsets within a namespace kubectl describe ds -n Deployments Shortcode = deploy
List one or more deployments kubectl get deploymen
Display the detailed state of one or more deployments kubectl describe deployment
Edit and update the definition of one or more deployment on the server kubectl create deployment
Delete deployments kubectl delete deployment Events Shortcode = ev
List recent events for all resources in the system kubectl get event
List Warnings only kubectl get events --field-selector type=Warning
List events but exclude Pod events kubectl get events --field-selector involvedObject.kind!=Pod
Pull events for a single node with a specific name kubectl get events --field-selector involvedObject.kind=Node, involvedObject.name=
Filter out normal events from a list of events kubectl get events --field-selector type!=Normal
Logs
Print the logs for a pod kubectl logs
Print the logs for the last hour for a pod kubectl logs --since=1h Get the most recent 20 lines of logs ubectl logs --tail=20
Get logs from a service and optionally select which container kubectl logs -f [-c <$container>]
Print the logs for a pod and follow new logs kubectl logs -f
Print the logs for a container in a pod kubectl logs -c
View the logs for a previously failed pod kubectl logs --previous
Get logs for all pods named with pod_prefix kubetail
Include the most recent 5 minutes of logs kubetail -s 5m
Display Resource usage (CPU/Memory/Storage) for pods. kubectl top pod
Add or update the annotations of a pod. kubectl annotate pod
Add or update the label of a pod. kubectl label pods new-label=
Get pods and show labels. kubectl get pods --show-labels
Listen on a port on the local machine and forward to a port on a specified pod kubectl port-forward :
List the different types of controllers in Kubernetes.
node controller
replication controller
service account and token controller
endpoints controller
namespace controller
list different types of services in kubernetes
cluster ip
node port
load balancer
external name
master node
worker node
kube proxy
kube-scheduler
controller manger
etcd
ingress
cloud control manager
node controller
route controller
volume controller
service controller
resource monitoring tools
grafana
kibana
CAadvisor
prometheus
solarwinds
elastic search
sysding
replication set
replication controller
daemonsets
namespaces
1.default
2.kube-system
3.kube-public
configmaps and secret
objects used by k8
pods
controllers and replication set
cron jobs
daemonsets
distinctive identities
statefl sets
deployments
kubectl commands
kubectl annotate
kubectl config
kubectl autoscale
kubectl config current-context
kubectl apply
kubectl config set
kubectl cluster-info
kubectl attach
what you will do to upgrade a kubernetes clusters
2 types of pods
single container pods
multi container pods
labels
objectives of the replication controller
control and administer pod life cycle
persistent volume
sematext docker agent
network policy
k8 services on nodes
worker nodes
kubelet
kube-proxy
kube-apiserver
kube-scheduler
kube-controller-manger
PDB pod distruption budget
advantages of k8
container orchstration
automated load balancing
auto scaling
rolling updates and rollbacks
service discovery and load balancing
storage orchestration
self-healing
secrets and config managmetn
multi cloud and hybrid cloud support
RBAC
pods and multi container support
monitoring and logging
horizontal pod autoscaler
use of init containers
Kubernetes supports a number of services, include the following: 1) Cluster IP, 2) Node Port, 3) Load Balancer, & 4) External Name Creation.
How does Kubernetes handle node failures and resiliency?
Node Health Monitoring
Pod Restart Policies
Replication and Desired State
Pod Disruption Budgets
Node Pools and Multi-Cloud Deployments
Describe a few important Kubectl commands.
The following are important Kubectl commands:
kubectl api-resources
kubectl autoscale
kubectl annotate
kubectl cluster-info
kubectl attach
kubectl apply
kubectl update
kubectl edit
kubectl config set
kubectl config
kubectl config current-context.
High-Level Monolithic Architecture:
Presentation layer:
Application layer:
Data-tier:
Docker consists of three Main Components:
Docker Daemon
Docker Client
Docker Registry.
1920257
Scaling Stateful Workloads
What is the secure way to manage sensitive information?
Use a Secrets Manager
Environment Variables
Encrypted Storage
Access Control:
What are the different ways to create infrastructure as code?
Terraform
AWS CloudFormation
Azure Resource Manager (ARM) Templates:
Google Cloud Deployment Manager:
Ansible
What are the benefits of Infrastructure as Code (IaC)?
Consistency
Version Control:
Automation
Scalability
Collaboration
What are the differences between load balancers, and why do we need them
Application Load Balancer (ALB):
Network Load Balancer (NLB):
Classic Load Balancer (CLB)
Docker
Bridge Networking:
Host Networking:
What are readiness and liveness probes
What other deployment strategies do you know?
Canary Deployment
Rolling Deployment
A/B Testing:
Feature Toggles
What are the networking setup rules you follow?
Networking Setup Rules
Security Groups:
Network Segmentation
Firewall Rules
VPN and Tunneling
Network Monitoring
What are your daily responsibilities as a DevOps engineer?
Daily Responsibilities
Monitoring
Automation
Troubleshooting
Collaboration
Continuous Improvement:
Which DevOps tools are you proficient with?
DevOps Tools Proficiency
Infrastructure as Code: Terraform, CloudFormation, Ansible, Puppet.
● Containerization: Docker, Kubernetes.
● CI/CD: Jenkins, GitLab CI/CD, AWS CodePipeline.
● Monitoring and Logging: Prometheus, Grafana, ELK Stack.
● Configuration Management: Ansible, Puppet, Chef.
● Version Control: Git
rolling updates, readiness
probes, and traffic routing
Scenario: Blue-Green Deployment with Rollback Option
Scenario: Custom Metrics for Autoscaling
Scenario: Multi-Cluster Kubernetes Management
. Install KubeFed
Federated Resources
Scenario: Handling Node Failures
Pod Eviction
Node Controller
Node Termination Grace Period:
Pod Disruption Budgets PDB
Scenario: Handling Kubernetes Version Upgrades
Back Up Cluster Data: Use tools like etcd-backup or Velero to back up your etcd database
and resources:
Drain Nodes
Upgrade Control Plane:
Upgrade Worker Nodes:
Monitor Cluster Health
Scenario: Logging and Monitoring in Kubernete
Prometheus + Grafana
Scenario: Network Policies for Pod Security
Scenario: Resource Quotas in Multi-Tenant Clusters
Enforce Quotas for Pods and PVCs
ResourceQuota
apiVersion: v1
Scenario: Handling Cluster Autoscaling
Cluster Autoscaler
Autoscaler Configuration
Scenario: Securing Sensitive Data with Kubernetes Secrets
Encrypt Secrets at Rest
Scenario: Pod Priority and Preemption
Assign Priority to Pods
Scenario: Kubernetes Multi-Tenancy with Namespaces
Create Tenant-Specific Namespaces:
Create RBAC for Namespaces
Use NetworkPolicies for Isolation
Scenario: Implementing Service Mesh for Microservices
Enable Automatic Sidecar Injection
Configure Traffic Routing:
Visualize Traffic with Kiali
Scenario: Kubernetes Pod Security Policies (PSP
Pod Security Policies (PSP)
Enable Pod Security Policies:
Scenario: Managing Multiple Environments in Kubernetes
How do you manage multiple environments (e.g., dev, staging, prod) in a single
Kubernetes cluster?
Scenario: Immutable Container Images in Kubernetes
Use Read-Only Root Filesystem
Use Image SHA Digest for Deployments:
Prevent Privileged Escalation
Scenario: Pod Eviction Policies in Overcommitted Clusters
Pod Priority and Preemption
Assign Priority Classes:
Assign Critical Workloads to High Priority
Preempt Low-Priority Pods
Scenario: Kubernetes Cluster Expansion with Helm
Install Helm Chart
Modify Values for Scaling
Upgrade Helm Release
Scenario: Helm Hooks for Pre/Post-Deployment Actions
Trigger the Hook:
Scenario: Implementing Multi-Tenancy with RBAC and PSP
Namespaces, RBAC, and Pod Security Policies
Namespace Isolation
RBAC for Access Control: Use RoleBindings
Pod Security Policies: Use Pod Security Policies (PSP)
Scenario: Scaling Stateful Workload
StatefulSets
Scaling a StatefulSet
Scenario: Canary Deployment with Istio and Kubernetes
Use Istio VirtualServices
Define Two Service Versions
Create an Istio VirtualService:
Gradually Shift Traffic
Scenario: Persistent Volumes in a Multi-Zone Kubernetes Cluster
StorageClasses with zone-aware scheduling
Create a StorageClass with Zone-Awareness
Define a PersistentVolumeClaim:
nsure Pods and PVCs Are Scheduled in the Same Zone
. Scenario: Kubernetes Backup and Disaster Recovery
Scenario: Enforcing Resource Limits on Pods
Use resource requests and limits
Scenario: Horizontal Pod Autoscaling with Custom Metrics
Expose Custom Metrics
Install Custom Metrics Adapter
Configure HPA with Custom Metrics
Scenario: Monitoring and Alerting for Kubernetes Workloads
Use Prometheus and Grafana
Scenario: RBAC for Fine-Grained Access Control
Create Roles and RoleBindings
Scenario: Kubernetes Multi-Cluster Management with KubeFed
Deploy Federated Resources: Use FederatedDeployments
Scenario: Canary Release with Helm and Kubernetes
Create Helm Chart for Application
Scenario: Handling Node Failures in a Multi-Zone Kubernetes Cluster
Check Node Health
Ensure Persistent Storage with Zone-Aware Scheduling
Scenario: Immutable Infrastructure with Kubernetes
Use Immutable Container Images
Prevent Configuration Changes: Use ConfigMaps and Secrets
Read-Only File Systems:
. Scenario: Deploying Stateful Applications in Kubernetes
Scenario: Kubernetes RBAC for Fine-Grained Access Control
Scenario: Multi-Cluster Kubernetes Management with Rancher
Install Rancher
Add Clusters to Rancher
RBAC Across Clusters
. Scenario: Deploying Multi-Tier Applications in Kubernetes
Namespaces
NetworkPolicies
Deploy Frontend, Backend, and Database
Scenario: Kubernetes Ingress for Multi-Domain Applications
Use Ingress
Create Ingress Rules
Use a TLS Certificate
Automatic Certificate Management
Scenario: Kubernetes Pod Priority and Preemption
Use Pod Priority and Preemption
Define Priority Classes
Assign Priority to Pods
Preempt Low-Priority Pods
Scenario: Debugging and Troubleshooting Pods
Check Pod Logs
Describe the Pod
Execute a Shell in the Pod
Check Resource Limits
Investigate Readiness and Liveness Probes
. Scenario: Kubernetes Cluster Autoscaler
Cluster Autoscaler
Install Cluster Autoscaler
Configure Autoscaler
Ensure Pod Scheduling
Scenario: Managing Application Configuration Across Environments
ConfigMaps and Secrets
Create Environment-Specific ConfigMaps
Scenario: High Availability for Kubernetes Control Plane
Deploy Multiple API Servers
Use a Load Balancer
Deploy an HA etcd Cluster:
Ensure Redundancy for Controller Manager and Scheduler:
Scenario: CI/CD Pipeline for Kubernetes Using GitLab
Set Up Deployment Webhooks:
Scenario: Immutable Infrastructure in Kubernetes
Use Immutable Container Images:
Read-Only File Systems
Externalize Configuration:
Use Declarative Infrastructure:
Helm, Kustomize, or Terraform
Scenario: Logging and Monitoring in Kubernetes
Use the EFK (Elasticsearch, Fluentd, Kibana)
Deploy Fluentd for Log Aggregation
Use Kibana for Log Analysis:
Monitoring with Prometheus
Visualize Metrics with Grafana
Scenario: Kubernetes Cluster Autoscaler for Cloud Providers
Cluster Autoscaler t
Install Cluster Autoscaler
Configure Autoscaler
Ensure Resource Requests for Pods
Scenario: Kubernetes Multi-Cluster Deployment Using KubeFed
KubeFed
Install KubeFed
Join Clusters
Deploy Federated Resources
No comments:
Post a Comment