CKA Study Flashcards
(109 cards)
Command: Apply configuration changes to a resource
kubectl apply -f FILENAME
Command: Access a web server via a NodePort
curl http://<Node>:<NodePort>
ie: http://198.168.1.2:30008</NodePort></Node>
Command: Create a resource
kubectl create -f FILENAME
Command: Creating a file from a Deployment
kubectl create deployment –image=nginx nginx –dry-run=client -o yaml > nginx-deployment.yaml
Command: Edit and update the definition of a resource
kubectl edit (-f FILENAME | TYPE NAME)
Command: Get documentation for a resource type
kubectl explain RESOURCE-TYPE
Command: Replace a resource
kubectl replace –force -f FILENAME
Command: Update the size of the specified replication controller
kubectl scale -f FILENAME
Command: Change the ETCD API version for commands
If you get the message, “No help topic for …”
export ETCDCTL_API=3 (default is 2)
Command: Execute a command against an resource
kubectl exec etcd-master -n kube-system etcdctl get / –prefix - keys-only
Command: List Pods
kubectl get pods
Command: Display the detailed state of a Pod
kubectl describe pod <Pod> -n=NAMESPACE</Pod>
Command: View a running resource and its effective options
ps -aux | grep <Process-Name></Process-Name>
If a specific Controller doesn’t seem to work or exist
Look at the Kube-Controller-Manager options
Kubeadm: /etc/kubernetes/manifests/kube-controller-manager.yaml
Non-Kubeadm: /etc/systemd/system/kube-controller-manager.service
Location: Where is the Pod Definition file located
Kubeadm: /etc/kubernetes/manifests/kube-apiserver.yaml
Non-Kubeadm: /etc/systemd/system/kube-apiserver.service
Object: ETCD-Master
Key/Value data store
Runs on Port 2379
Can be accessed via a browser at https://<IP>:2379</IP>
Set Value: ./etcdctl set key1 value1
Get Value: ./etcdctl set key1
Object: Kube-APIServer
Authenticate User
Validate Request
Retrieve Data
Update ETCD
Used by Kube-Scheduler-Master and Kubelet
Object: Kube-Proxy
Runs on each Node in the Cluster
Look for new Services
Creates an new Rule on each Node to forward traffic to those Services
Object: Kube-Scheduler
Decides which Pod goes on which Node
Kubeadm: /etc/kubernetes/manifests/kube-scheduler.yaml
Non-Kubeadm: /etc/systemd/system/kube-scheduler.service
Object: Kubelet
Registers Node on the K8S cluster
Creates Pods
Monitors Nodes and Pods
Configuration located at /var/lib/kubelet/config.yaml
Object: Master Node
ETCD: Information on the cluster
Kube-Scheduler: Schedule applications or containers
Kube-Controller-Manager: Takes care of all controllers
Kube-APIServer: Orchestrating operations on the cluster
Object: Kube-Controller-Manager
Monitors services and brings them to the desired state
Object: Node-Controller
Monitor Nodes and keeps Pods running
Object: Namespace Kube-System
Namespace for system resources