Community Tutorials Kubernetes كيفية تثبيت k3s — Kubernetes خفيف الوزن
كيفية تثبيت k3s — Kubernetes خفيف الوزن
KUBERNETES

كيفية تثبيت k3s — Kubernetes خفيف الوزن

SKYLINE Knowledge Base
Photo by Growtika on Unsplash

دليل عملي خطوة بخطوة لـ كيفية تثبيت k3s — Kubernetes خفيف الوزن. أوامر مختبرة في الإنتاج، متطلبات مسبقة، تحقق نهائي وروابط لمواضيع ذات صلة.

k3s هو توزيعة Kubernetes معتمدة من CNCF تستهلك 60 MB، تعمل على Raspberry Pi، وهي الخيار عندما تحتاج Kubernetes بدون عبء التشغيل.

المتطلبات المسبقة

  • مضيف Linux (Ubuntu 22.04 / Debian 12 / Rocky 9).
  • 1 vCPU، 1 GiB ذاكرة لكل عقدة.

الخطوة 1: تثبيت عقدة التحكم

curl -sfL https://get.k3s.io | sh -
sudo k3s kubectl get nodes
sudo k3s kubectl get pods -A

الخطوة 2: استخدام kubeconfig كمستخدم عادي

mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config
chmod 600 ~/.kube/config

kubectl get nodes

الخطوة 3: إضافة عقد عاملة

على عقدة التحكم:

sudo cat /var/lib/rancher/k3s/server/node-token

على كل عامل:

curl -sfL https://get.k3s.io | K3S_URL=https://control-plane.example.sa:6443 \
                              K3S_TOKEN=<token> sh -

الخطوة 4: ما يثبته k3s افتراضيًا

  • coredns
  • local-path-provisioner
  • metrics-server
  • traefik (ingress)
  • svclb-traefik (LoadBalancer)

الخطوة 5: اختبار حمولة عمل

kubectl create deployment hello --image=nginxdemos/hello:latest
kubectl expose deployment hello --port=80 --type=NodePort
kubectl get svc hello
curl http://control-plane.example.sa:31234/

الخطوة 6: التحديث/الإزالة

curl -sfL https://get.k3s.io | sh -
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.30.2+k3s1 sh -

/usr/local/bin/k3s-uninstall.sh
/usr/local/bin/k3s-agent-uninstall.sh

التحقق

kubectl get nodes -o wide
kubectl get pods -A
sudo systemctl status k3s --no-pager

الخاتمة

k3s = Kubernetes حقيقي عبر curl واحد.

الخطوات التالية

SKYLINE Engineering

@skyline

The engineering team at SKYLINE Industrial Solutions. We publish field-tested guides drawn from real KSA and GCC deployments.

See author profile
SKYLINE engineering services

Need this implemented for you?

Reading is free — building it right takes a team. SKYLINE engineers ship Kubernetes for Aramco vendors, banks, hospitals and government agencies across Saudi Arabia. Talk to us before you start.

Aramco Approved Contractor ISO 9001 · ISO 27001 SAMA CSF aligned NCA ECC ready 247+ KSA clients

Comments

0 total · 0 threads
Be the first to leave a comment.