Kubernetes Core Concepts Guide 🚀
ETCD 📚
ETCDCTL Command Interaction
ETCDCTL can interact with the ETCD Server using two API versions: Version 2 and Version 3. By default, it is set to use Version 2. Each version has different sets of commands.ETCDCTL Version 2 Commands:
- etcdctl backup
- etcdctl cluster-health
- etcdctl mk
- etcdctl mkdir
- etcdctl set
ETCDCTL Version 3 Commands:
- etcdctl snapshot save
- etcdctl endpoint health
- etcdctl get
- etcdctl put
Replication Controller (RC) 💾
Replica Set 📊
Deployments.yml 📄
Imperative CLI Commands 🛠️
Create an NGINX Pod
Generate POD Manifest YAML file (-o yaml). Don’t create it (—dry-run)
Create a Deployment
Generate Deployment YAML file (-o yaml). Don’t create it (—dry-run)
Generate Deployment YAML file (-o yaml). Don’t create it (—dry-run) and save it to a file
--replicas option to create a deployment with 4 replicas:
Services 🛠️
Service Types
Cluster IP
Load Balancer
Namespaces 🏷️
Create a Namespace
A namespace is a logical grouping of resources.Connecting to Servers in Different Nodes & Namespaces
To connect to the same namespace, we can use a service name of that resource to connect (e.g.,mysql.connect("db-service")).
Pod Definition File
A pod definition file that will auto-create a pod in a specific namespace defined in the YAML label section (e.g.,namespace: dev).
Switch to Another Namespace Permanently (from Default)
Resource Quota for Namespace
Limit the usage of resources in a specific namespace.Imperative Commands for Services 🛠️
Create a Service Named redis-service of Type ClusterIP to Expose Pod redis on Port 6379
app=redis. You cannot pass in selectors as an option. Generate the file and modify the selectors before creating the service.)
Create a Service Named nginx of Type NodePort to Expose Pod nginx’s Port 80 on Port 30080 on the Nodes
kubectl expose command. If you need to specify a node port, generate a definition file using the same command and manually input the node port before creating the service.