Plano de estudo: CKA
Pesquisando como me preparar para certificação encontrei esse repositório no github, esse post vai ser apenas para trazer por aqui e servir como guia para as próximas semanas:
https://github.com/leandrocostam/kubernetes-certified-administrator-prep-guide
Nesse repositorio é onde que fica a informação mais atual sobre qual versão do kubernetes a prova será aplicada prova, então bora me preparar para a versão 1.19 do Kubernetes!
https://github.com/cncf/curriculum/
Cluster Architecture, Installation & Configuration (25%)
-
Manage role based access control (RBAC).
-
Use Kubeadm to install a basic cluster.
-
Manage a highly-available Kubernetes cluster.
-
Provision underlying infrastructure to deploy a Kubernetes cluster.
-
Perform a version upgrade on a Kubernetes cluster using Kubeadm.
-
Implement etcd backup and restore.
Helpful commands:
# Display addresses of the master and services
kubectl cluster-info
# Dump current cluster state to stdout
kubectl cluster-info dump
# Check health of cluster components
kubectl get componentstatuses
# List the nodes
kubectl get nodes
# Show metrics for a given node
kubectl top node my-node
# List all pods in all namespaces, with more details
kubectl get pods -o wide --all-namespaces
# List all services in all namespaces, with more details
kubectl get svc -o wide --all-namespaces
Workloads & Scheduling (15%)
-
Understand deployments and how to perform rolling update and rollbacks.
-
Kubernetes Documentation > Concepts > Workloads > Controllers > Deployments
-
Example Deployment File (dep-nginx.yaml) using NGINX
apiVersion: apps/v1 kind: Deployment metadata: name: nginx-deployment labels: app: nginx spec: replicas: 3 selector: matchLabels: app: nginx template: metadata: labels: app: nginx spec: containers: - name: nginx image: nginx:1.15.4 ports: - containerPort: 80
# Create Deployment kubectl create -f dep-nginx.yaml # Get Deployments kubectl get deployments # Update Deployment kubectl edit deployment.v1.apps/nginx-deployment # See rollout status kubectl rollout status deployment.v1.apps/nginx-deployment # Describe Deployment kubectl describe deployment # Rolling back to a previous revision kubectl rollout undo deployment.v1.apps/nginx-deployment
-
-
Use ConfigMaps and Secrets to configure applications.
-
Know how to scale applications.
-
# Increase replicas number for nginx-deployment kubectl scale deployment/nginx-deployment --replicas=5 # Using autoscaling kubectl autoscale deployment/nginx-deployment --min=2 --max=5
-
-
Understand the primitives used to create robust, self-healing, application deployments.
-
Understand how resource limits can affect Pod scheduling.
-
Awareness of manifest management and common templating tools.
Services & Networking (20%)
-
Understand host networking configuration on the cluster nodes.
-
Understand connectivity between Pods.
-
Understand ClusterIP, NodePort, LoadBalancer service types and endpoints.
-
Know how to use Ingress controllers and Ingress resources.
-
Know how to configure and use CoreDNS.
-
Choose an appropriate container network interface plugin.
Storage (10%)
-
Understand storage classes, persistent volumes.
-
Understand volume mode, access modes and reclaim policies for volumes.
-
Understand persistent volume claims primitive.
-
Know how to configure applications with persistent storage.
Troubleshooting (30%)
-
Evaluate cluster and node logging.
-
Understand how to monitor applications.
-
Manage container stdout & stderr logs.
-
Troubleshoot application failure.
-
Troubleshoot cluster component failure.
-
Troubleshoot networking.
CKA Preparation Courses
kubectl Ninja
Tip: Use kubectl Cheatsheet during the exam. You don’t need to decorate everything.
Useful commands or parameters during the exam:
# Use "kubectl describe" for related events and troubleshooting
kubectl describe pods <podid>
# Use "kubectl explain" to check the structure of a resource object.
kubectl explain deployment --recursive
## Add "-o wide" in order to use wide output, which gives you more details.
kubectl get pods -o wide
## Check always all namespaces by including "--all-namespaces"
kubectl get pods --all-namespaces
Generate a manifest template from imperative spec using the output option “-o yaml” and the parameter “–dry-run”:
# create a service
kubectl create service clusterip my-service --tcp=8080 --dry-run -o yaml
# create a deployment
kubectl create deployment nginx --image=nginx --dry-run -o yaml
# create a pod
kubectl run nginx --image=nginx --restart=Never --dry-run -o yaml
Create resources using kubectl + stdin instead of creating them from manifest files. It helps a lot and saves time. You can use the output of the command above and modify as required:
cat <<EOF | kubectl create -f -
...
EOF
It saves lots of time, believe me.
Kubectl Autocomplete
source <(kubectl completion bash)
Practice
Practice a lot with Kubernetes:
- Kubernetes the Hard Way by Kelsey Hightower
- Katacoda: Learn Kubernetes using Interactive Browser-Based Scenarios
CKA Tips
Some links that contain tips that might help you from different perspectives of the CKA exam.