متقدم
البحث فيالملخصات
طريقة البحث
  • الكلمات تجد عناوين الدروس والنص والكود. صفِّ حسب النوع (أدلة، دورات، برامج، كتب) أو ابقَ في هذا الكتاب.
  • book:rhcsa و ch:8 يضيّقان البحث؛ ‎#code يجد الكلمة داخل أوامر الدروس فقط.
  • "كلمتان" تجد العبارة بالضبط.
  • الكلمات العادية تجد الأسماء والنصوص والأمثلة.
  • ↑ ↓ للتنقل · Enter للفتح · Esc للإغلاق · / للبحث
جرّب:

الدورة 5الاسم في الدورة: Certified Kubernetes Administrator (CKA) Prep Course

Certified Kubernetes Administrator (CKA) Prep Course

Course 5 of 13 in the Alta3 Academy library. Alta3 Academy self-paced course.

ملاحظة

My result — Lessons read: all 111/111; Course progress: 100%.

  • 29 الدروس
  • 8 الأوامر
  • 2 المعامل

هذا الجزء لم يُترجم بعد. أنت ترى النص الإنجليزي.

$ مستخدم عادي# بصلاحية root (أو مع sudo)

5.1

What the course covers

The parts of a Kubernetes cluster and the job of each part.

  • How to install a cluster with kubeadm.
  • How to back up etcd, upgrade a cluster, and fix a broken node.
  • How to run Pods, ReplicaSets, Deployments, and StatefulSets.
  • How to limit CPU and memory, and how to give users access.
  • How to store data that must outlive a Pod.
  • How to connect apps with Services, Ingress, and CoreDNS.
  • How to extend Kubernetes with CRDs, Helm, and Kustomize.

5.2

Welcome to Alta3 Research Labs!

This is a self-paced lab. You work in a browser and a Linux shell.

  • The lab machines are bchd (beachhead), controller, node-1, and node-2.
  • Helper commands such as setup <lab> prepare each lab for you.

5.3

Required Tools

Vim is a modal editor. Start in command mode, press i to type, and use Esc then :wq to save and quit.

  • tmux splits one terminal into panes. You can watch a command in one pane and edit files in another.
  • Both tools speed up your work at the terminal.

5.4

Becoming a Certified Kubernetes Administrator

The exam is task based. You work on a real cluster.

  • The objectives and their weights: cluster architecture 25%, workloads 15%, services and networking 20%, storage 10%, troubleshooting 30%.
  • You may open kubernetes.io during the exam. Practice finding pages fast.
  • A good method: search the docs, copy an example, then change it to fit the task. Stop looking when the task is solved.

5.5

Introduction to Cluster Architecture

A cluster has a control plane and worker nodes.

  • The control plane stores cluster state and decides where Pods run. Worker nodes run the Pods.
  • One Pod holds one or more containers and shares one network space.

5.6

Cluster Building with Kubeadm

Check the machine first: 2 GB RAM, 2 CPUs, swap off, a unique hostname, and the needed ports open.

  • Load the bridge module and turn on net.ipv4.ip_forward=1 so Pod traffic can pass.
  • kubeadm init builds the control plane. Then install a CNI plugin; this course uses Calico.
  • kubeadm token create --print-join-command prints the line that a new worker node needs.

5.7

Cluster Administration

Save etcd with etcdctl snapshot save. Restore with etcdctl snapshot restore.

  • Upgrade with kubeadm upgrade plan, then kubeadm upgrade apply, then update kubelet and kubectl.
  • A node that shows NotReady often has a stopped kubelet. Start it and watch the node turn Ready.
  • Read events and logs before you change anything.

5.8

Part 2: Cluster Setup

Press "Rebuild Environment" before this lab. If you skip it, the later labs break.

  • Ansible builds the whole cluster from code: network, certificates, components, and services.
  • The result is one controller and two worker nodes, ready for the next labs.

5.9

Containers

An image holds the app and all it needs. A container is a running copy of an image.

  • Build an image from a Dockerfile with docker build -t name:tag ..
  • Layers are cached, so a small change does not rebuild everything.

الأوامر في هذا الدرس

5.10

Pod Basics

YAML uses indentation. A manifest has metadata (name, labels) and spec (what to run).

  • A Pod manifest lists containers, images, ports, and volumes.
  • A Namespace splits one cluster into groups such as dev, test, and prod.
  • API versions change. Old versions are removed, so check the apiVersion of every manifest.

الأوامر في هذا الدرس

5.11

Kubectl

kubectl get lists objects. Add -o wide or -o yaml to see more.

  • Sort output with --sort-by=.metadata.name or by a value such as a metric.
  • kubectl top shows live CPU and memory. It needs the Metrics Server.

الأوامر في هذا الدرس

5.12

Resource Management

requests is what a container needs. limits is the most it may use.

  • QoS classes: BestEffort (no requests or limits), Burstable (some), Guaranteed (requests equal limits).
  • A ResourceQuota caps total use inside one namespace.
  • A LimitRange sets default and maximum values for each container in a namespace.

5.13

User Administration

A context is a cluster plus a namespace plus a user. Switch with kubectl config use-context.

  • RBAC has four objects: Role, ClusterRole, RoleBinding, and ClusterRoleBinding.
  • RBAC only adds rights. There are no deny rules.
  • Give a user a certificate and key. Approve the request with kubectl certificate approve.

الأوامر في هذا الدرس

5.14

Advanced Pod Design

A liveness probe restarts a sick container. A readiness probe controls when traffic arrives. A startup probe waits for a slow boot.

  • ConfigMaps hold normal settings. Secrets hold private data such as passwords and tokens.
  • Init containers finish before the app containers start. Sidecar containers run beside the app.
  • Taints push Pods away from a node. Tolerations let a Pod stay. Node affinity picks nodes by label. A PriorityClass decides which Pod schedules first.

5.15

Logging

kubectl logs reads the logs of a container. Use -c for one container and -f to follow.

  • Flags such as --tail, --since, and --timestamps trim the output.
  • A sidecar can ship logs to one central place, away from the cluster.

5.16

Labels

A label is a key=value pair. It helps you find and group objects.

  • Select with -l app=webby. Show them with --show-labels.
  • Annotations store notes and tool data, but you cannot select objects by annotation.

5.17

Replica and Daemon Sets

A ReplicaSet keeps an exact number of Pods. It compares the desired count with the real count.

  • A DaemonSet runs one Pod on every node, or on the nodes that match a selector.
  • Use a Deployment instead of a bare ReplicaSet when you need updates and history.

5.18

Deployments

A Deployment wraps a ReplicaSet and keeps a revision history.

  • A rolling update replaces Pods a few at a time. kubectl rollout undo returns to an old revision, and kubectl rollout history lists them.
  • Other strategies are Recreate, Blue/Green, and Canary.
  • The HPA adds or removes replicas to meet a CPU or memory target. A StatefulSet gives each Pod a stable name and its own storage.

الأوامر في هذا الدرس

5.19

Persistent Storage

A PersistentVolume (PV) is real storage. A PersistentVolumeClaim (PVC) is a request for storage.

  • A StorageClass creates PVs on demand.
  • Local storage is simple, but it ties a Pod to one node.
  • The NFS CSI driver is a modern way to add storage. If a PVC names no class, Kubernetes uses the default StorageClass.

5.20

Extending Kubernetes

A CustomResourceDefinition (CRD) adds a new object type to the API.

  • After the CRD is in place, you can use kubectl get and kubectl apply on that type.
  • A CRD alone adds no logic. A controller does the real work.

الأوامر في هذا الدرس

5.21

Helm and Kustomize

Helm packs manifests into a chart. Templates and values.yaml fill in the settings.

5.22

Services & Networking

A NetworkPolicy is a firewall for Pods. It sets ingress and egress rules. Calico enforces it; Flannel alone does not.

  • Service types: ClusterIP (inside the cluster), NodePort (a port on every node), LoadBalancer (a cloud IP). An Ingress routes HTTP by host and path and needs a controller.
  • The Gateway API uses a Gateway and an HTTPRoute. It is now part of the CKA scope.
  • To debug, check the Service endpoints, the labels, the ports, and DNS.

5.23

DNS

A Pod can have a hostname and a full name (FQDN), such as busybox-1.alta3.default.svc.cluster.local. Pods can find each other by name, not only by IP.

  • CoreDNS runs as a Deployment and reads its settings from a Corefile.
  • You can add static entries to CoreDNS, for example a name that must always return one IP. Test with nslookup or dig from a test Pod.
  • You can go back to kube-dns by deleting CoreDNS and applying the old manifest.

5.24

Continuing Education

Next steps are CKS for security, CKAD for developers, and Rancher for cluster management.

  • The course ends with a curriculum map for container orchestration.

5.25

Key commands and tools

5.26

Key terms

The words of this course in one table. Learn them before the quiz or exam.

TermMeaning
ClusterOne control plane plus the worker nodes it manages.
ConfigMapAn object that holds normal settings for a Pod.
Control planeThe part that stores cluster state and decides where Pods run.
CRDCustomResourceDefinition. It adds a new object type to the Kubernetes API.
DaemonSetA controller that runs one Pod on every node, or on chosen nodes.
DeploymentA controller that manages ReplicaSets and keeps a revision history.
etcdThe key-value store that holds all cluster state.
HelmA tool that packs manifests into charts and installs them as releases.
IngressAn HTTP routing rule that sends traffic to Services. It needs a controller.
kubeadmThe tool that builds a cluster and upgrades it.
kubectlThe command line tool that talks to the API server.
kubeletThe agent on a node. It starts Pods and reports node health.
NamespaceA group inside a cluster that keeps objects apart.
NetworkPolicyRules that allow or block traffic to and from Pods.
NodeA machine in the cluster that runs Pods.
PersistentVolumeReal storage in the cluster, ready to be used.
PersistentVolumeClaimA Pod's request for storage.
PodThe smallest unit. One or more containers with one network space.
RBACRole Based Access Control. Roles and bindings that give rights.
SecretAn object that holds private data, such as a password.
ServiceA stable name and IP that points to a group of Pods.
StatefulSetA controller that gives each Pod a stable name and its own storage.
StorageClassA rule that creates storage on demand.
TaintA mark on a node that keeps most Pods away.
TolerationA Pod setting that lets the Pod go onto a tainted node.

5.27

Check yourself

Answer each question first, then open it to check the answer.

1Which command builds the control plane with kubeadm?

kubeadm init. Add --pod-network-cidr and, if needed, --kubernetes-version. Then install a CNI plugin.

2What does a readiness probe do, and how is it different from a liveness probe?

A readiness probe says when a container can take traffic. A liveness probe says if the container is still healthy; if it fails, kubelet restarts the container.

3What is the difference between a PersistentVolume and a PersistentVolumeClaim?

A PV is the real storage. A PVC is a request for storage that a Pod can mount. A StorageClass can create the PV for the PVC.

4Which CNI in this course can enforce NetworkPolicy?

Calico. It does Pod networking and enforces NetworkPolicy. Flannel alone does not enforce NetworkPolicy.

5How do you back up etcd, and why is it important?

Run etcdctl snapshot save with the etcd endpoints and the certificate files. The backup lets you restore cluster state after a bad change or a crash.

الأوامر في هذا الدرس

تدرّب

كل الأوامر في هذا الفصل