Air-Gapped Installation of Apache Spark on Kubernetes
يوجد أدناه دليل خطوة بخطوة للتثبيت إيلوم في بيئة غير متصلة بالإنترنت (بفجوات هوائية). تمت كتابة هذا الدليل ليكون محايدا لتوزيع Kubernetes الخاص بك ويغطي كلا النهجين لإدارة صور الحاوية - باستخدام حاويات (مع السمة الخطر أدا) أو عامل الإرساء. تفترض التعليمات أن لديك:
- محطة عمل متصلة بالإنترنت لتنزيل مخطط Helm المطلوب وصور الحاوية.
- طريقة (مثل محرك أقراص USB أو خادم ملفات داخلي) لنقل الملفات من محطة العمل عبر الإنترنت إلى بيئتك غير المتصلة بالإنترنت.
- مجموعة Kubernetes عاملة (أي توزيع) في بيئتك غير المتصلة.
- تم تثبيت Helm وتكوينه للاتصال بنظام المجموعة غير المتصل.
- Sufficient Disk Space: At least 60GB free on both the download and offline machines (for handling large image tarballs).
- Recommended Resources: 12 CPU and 18GB RAM (or more depending on workload).
Architecture Overview: Spark on Kubernetes in Air-Gapped Environments
When deploying Apache Spark on Kubernetes in an air-gapped environment, the driver and executor processes run as containerized processes 100% managed within infrastructure devoid of public connectivity. All container images and dependencies, along with configuration files, are hosted internally and do not need external network access.
In this environment, we deploy Spark components as containerized applications on Kubernetes. Spark driver and executors operate as pods. Scheduling, resource allocation, and scaling are handled by Kubernetes. The setup uses native Kubernetes features like resource limits, Horizontal Pod Autoscaling, and node selectors for smooth and reliable functioning. For general details on how Ilum manages these resources, see the Architecture Overview.
A local image registry is a key part of this architecture. Instead of manually loading images on every node, you push them into a registry within your infrastructure. Whether using a basic deployment with السجل:2 or a robust solution like Harbor, the registry must be backed by persistent storage to retain images after restarts. Once images are in the registry, individual nodes can pull them on demand.
Networking and security are critical. Air-gapped environments use network policies to control pod communication. These policies limit interactions to necessary components using Kubernetes' security controls (RBAC, service accounts), ensuring compliance with strict no-ingress rules.
This structure supports complex jobs including Spark Core, Spark SQL, Spark Streaming, and MLlib applications. Integrated with tools like كوبيكتل, Helm, Prometheus, and Grafana, this setup makes deployment, monitoring, and debugging efficient even without internet access. You can run jobs via واجهة برمجة تطبيقات REST أو Spark Submit once the cluster is operational.
1. Preparation and Downloads
يتم تقسيم العملية إلى الخطوات التالية:
1.1. Download Ilum Helm Chart for Offline Use
يتم توفير مخطط Ilum عبر مستودع Helm عام ، قم بتشغيله:
helm repo جمع ilum https://charts.ilum.cloud
تحديث Helm Repo
helm pull ilum/ilum #(you can add --version to specify a ilum version)
سيؤدي هذا إلى إنشاء ملف ilum-.
بقشيش: يمكنك استخراج وتعديل الرسم البياني
القيم.yamlلاحقا إذا كنت تريد تغيير مراجع مستودع الصور.
1.2. Identify and Download Required Docker Images
Below is the list of images(version 6.6.1 of ilum):
Click to view required images list
alpine/kubectl:1.34.1apache/airflow:3.0.2apache/nifi:2.5.0أباتشي / مجموعة فائقة: dockerizebitnamilegacy/postgresql:16bitnami/git:latestcurlimages / حليقة: 8.5.0docker.io/bitnamilegacy/minio:2025.3.12-debian-12-r0docker.io/bitnamilegacy/os-shell:11-debian-11-r72docker.io/bitnamilegacy/postgresql:16.1.0-debian-11-r25docker.io/bitnamilegacy/redis:7.0.10-debian-11-r4docker.io/ilum/mongodb:6.0.5ghcr.io/projectnessie/nessie:0.105.1جيتيا / جيتا: 1.22.3ilum/airflow:3.1.1ilum/core:6.6.1ilum / خلية النحل: 3.1.3ILUM / كيوبي: 1.10.0-شرارةilum/mageai:0.9.76ILUM / Mongodb: 6.0.5ilum/spark:3.5.8-deltaILUM / شرارة قاذفة: سبارك -3.5.3ilum/sparkmagic:0.23.3ilum/streamlit-example:1.0.0ilum/superset:4.1.0.1ilum/ui:6.6.1jpgouin/openldap:2.6.9-fixminio/mc:RELEASE.2025-04-16T18-13-26Zregistry.k8s.io/git-sync/git-sync:v4.3.0trinodb/trino:477
1.3 احفظ كل صورة ككرة تاربول
يمكنك كتابة هذه العملية. على سبيل المثال، قم بإنشاء ملف باسم pull_and_save.sh:
#!/بن / باش
IMAGES=(
"alpine/kubectl:1.34.1"
"apache/airflow:3.0.2"
"apache/nifi:2.5.0"
"أباتشي / مجموعة فائقة: dockerize"
"bitnamilegacy/postgresql:16"
"bitnami/git:latest"
"curlimages / curl: 8.5.0"
"docker.io/bitnamilegacy/minio:2025.3.12-debian-12-r0"
"docker.io/bitnamilegacy/os-shell:11-debian-11-r72"
"docker.io/bitnamilegacy/postgresql:16.1.0-debian-11-r25"
"docker.io/bitnamilegacy/redis:7.0.10-debian-11-r4"
"docker.io/ilum/mongodb:6.0.5"
"ghcr.io/projectnessie/nessie:0.105.1"
"جيتيا / جيتا: 1.22.3"
"ilum/airflow:3.1.1"
"ilum/core:6.6.1"
"ilum / خلية: 3.1.3"
"ILUM / Kyuubi: 1.10.0-spark"
"ilum/mageai:0.9.76"
"ILUM / Mongodb: 6.0.5"
"ilum/spark:3.5.8-delta"
"ILUM / Spark-Launcher: Spark-3.5.3"
"ilum/sparkmagic:0.23.3"
"ilum/streamlit-example:1.0.0"
"ilum/superset:4.1.0.1"
"ilum/ui:6.6.1"
"jpgouin/openldap:2.6.9-fix"
"minio/mc:RELEASE.2025-04-16T18-13-26Z"
"registry.k8s.io/git-sync/git-sync:v4.3.0"
"trinodb/trino:477"
)
من أجل صورة في "${IMAGES[@]}"; فعل
echo "Pulling $image..."
docker pull "$image"
filename=$(echo "$image" | tr '/:' '__')
echo "Saving $image ل ${filename}.tar..."
docker save "$image" -س "${filename}.tar"
منجز
قم بتشغيل البرنامج النصي:
chmod +x pull_and_save.sh
./pull_and_save.sh
ينتج عن هذا مجموعة من .قطران الملفات التي تحتوي على صورك.
2. نقل البيانات الاصطناعية إلى البيئة غير المتصلة بالإنترنت
استخدم طريقتك المفضلة (محرك أقراص USB وخادم ملفات داخلي و scp وما إلى ذلك) لنسخ ما يلي من جهازك عبر الإنترنت إلى البيئة غير المتصلة بالإنترنت:
- حزمة مخطط Helm (على سبيل المثال ،
ilum-).tgz - جميع كرات القطران للصور (على سبيل المثال ،
apache_superset_dockerize.tar,ilum_hive_3.1.3.tar، إلخ.)
3. Import Container Images (Docker & Containerd)
عند استخدام سجل محلي، يمكنك لا تحتاج لتحميل الصور يدويا على كل عقدة. بدلا من ذلك ، يمكنك دفعها إلى السجل المحلي الخاص بك ، وبعد ذلك ستقوم جميع العقد بسحب الصور من السجل حسب الحاجة. فيما يلي إرشادات لإعداد الصور قبل دفعها إلى السجل الخاص بك.
Managing Disk Space: If you are short on disk space, consider processing images sequentially (load one, push it, then delete the tarball) instead of copying all tarballs at once.
- Option A: containerd (ctr)
- Option B: Docker
3A.1. استيراد صورة Tarballs (على جهاز واحد)
على جهاز يمكنه الوصول إلى السجل المحلي الخاص بك ، قم باستيراد tarball (s):
sudo الخطر -ن k8s.io images استورد /path/to/<image_tarball>.قطران
على سبيل المثال:
sudo الخطر -ن k8s.io images استورد /opt/offline-images/ilum_hive_3.1.3.tar
3أ.2. وضع علامة على الصورة في السجل المحلي
ضع علامة على الصورة باستخدام نقطة نهاية السجل المحلي (على سبيل المثال، إذا كان من الممكن الوصول إلى السجل الخاص بك على المضيف المحلي:5000):
sudo الخطر -ن k8s.io images tag ilum/hive:3.1.3 localhost:5000/ilum/hive:3.1.3
3أ.3. دفع الصورة إلى السجل المحلي
ادفع الصورة التي تم وضع علامة عليها:
sudo الخطر -ن k8s.io images push --plain-http localhost:5000/ilum/hive:3.1.3
(استخدم --عادي-http إذا تم تكوين السجل الخاص بك بدون TLS.)
3B.1. قم بتحميل الصورة Tarball (إذا لزم الأمر)
إذا كنت ترغب في إثبات الملكية محليا قبل الضغط (اختياري)، يمكنك تحميل صورة على جهاز المسؤول:
docker load -i /path/to/<image_tarball>.قطران
على سبيل المثال:
docker load -i /opt/offline-images/ilum_hive_3.1.3.tar
3ب.2. ضع علامة على الصورة لسجلك المحلي
docker tag ilum/hive:3.1.3 localhost:5000/ilum/hive:3.1.3
3B.3. دفع الصورة إلى السجل المحلي
docker push localhost:5000/ilum/hive:3.1.3
ملاحظه: بمجرد أن تصبح الصور في السجل المحلي الخاص بك، يمكن لكل عقدة في نظام المجموعة الخاص بك سحبها تلقائيا عند الحاجة. لا يوجد شرط لتحميل الصور مسبقا على كل عقدة.
4. Setup Local Image Registry (Preferred)
يوصى بشدة باستخدام سجل محلي لأنه يبسط إدارة الصور ويتوسع بشكل جيد للمجموعات الأكبر أو الديناميكية. على الرغم من أنه يمكنك تشغيل سجل أساسي باستخدام السجل:2، فكر في بدائل قوية مثل ميناءأو Nexus Repository Manager أو Quay. على سبيل المثال ميناء يوفر التحكم في الوصول المستند إلى الأدوار وفحص الثغرات الأمنية والنسخ المتماثل للصور وواجهة مستخدم ويب سهلة الاستخدام.
مهم: تأكد من تكوين أي سجل تختاره باستخدام وحدة تخزين ثابتة مرفقة (أو تخزين مستمر). يضمن ذلك بقاء صورك متاحة حتى إذا تمت إعادة تشغيل حاوية التسجيل أو تحديثها.
مثال: إعداد سجل أساسي باستخدام التخزين المستمر (Docker)
-
إنشاء دليل لبيانات التسجيل:
Create Directorymkdir -p /opt/registry-data -
قم بتشغيل حاوية التسجيل باستخدام وحدة تخزين:
Start Registrydocker ركض -d \
-p 5000:5000 \
--اسم registry \
-v /opt/registry-data:/var/lib/registry \
السجل:2
مثال: استخدام الميناء
للحصول على حل أكثر قوة ، قم بتنزيل برنامج التثبيت دون اتصال بالإنترنت من Harbour من صفحة إصدارات Harbor GitHub واتبع الوثائق المقدمة. يتطلب منك Harbor تكوين التخزين المستمر (باستخدام وحدات التخزين) كجزء من تثبيته.
5. Configure Helm for Local Registry
لضمان ذلك إيلوم يسحب الصور من السجل المحلي بدلا من المستودعات العامة ، وقم بتحديث مراجع مستودع الصور في مخطط Helm. على سبيل المثال، إذا كانت القيم الافتراضية تحتوي على:
إيلوم كور:
صورة: "ilum/core:6.6.1"
قم بتغييره إلى:
إيلوم كور:
صورة: "localhost:5000/ilum/core:6.6.1"
يمكنك إما تعديل الرسم البياني الافتراضي القيم.yaml أو قم بتوفير ملف تجاوز. على سبيل المثال، إنشاء local-registry-values.yaml:
إيلوم كور:
صورة: "localhost:5000/ilum/core:6.6.1"
ILUM-UI:
صورة: "localhost:5000/ilum/ui:6.6.1"
# إضافة تجاوزات مماثلة للمكونات الأخرى (على سبيل المثال ، ilum / air flow ، ilum / hive ، إلخ.)
ثم قم بتثبيت (أو ترقيتها) باستخدام:
helm install ilum /path/to/ilum-<الإصدار>.tgz --namespace ilum --create-namespace -و local-registry-values.yaml
6. تثبيت ilum باستخدام Helm
تأكد من أن kubeconfig لنظام المجموعة غير المتصل، ثم قم بتثبيت مخطط Helm:
helm install ilum /path/to/ilum-<الإصدار>.tgz --namespace ilum --create-namespace
(قم بتضمين ملف التجاوز إذا كنت تستخدم واحدا.)
7. التحقق واستكشاف الأخطاء وإصلاحها
7.1. التحقق من النشر
-
تحقق من حالة تحرير Helm:
Helm Statushelm status ilum --namespace إيلوم -
قائمة الكبسولات:
Get Podskubectl الحصول على القرون -ن إيلوم -
فحص مراجع صور الجراب:
على سبيل المثال:
Describe Podkubectl describe pod <pod_name> -ن إيلوم | grep Image:تأكد من أن مسارات الصور تشير إلى السجل المحلي الخاص بك (على سبيل المثال،
المضيف المحلي: 5000 / ILUM / الخلية: 3.1.3).
7.2. استكشاف الأخطاء وإصلاحها
Click to view troubleshooting steps
- أخطاء ImagePullBackOff:
تحقق من توفر الصور في السجل المحلي ومن أن جميع العقد يمكنها الوصول إلى السجل. - الوصول إلى السجل:
تأكد من تكوين أي إعدادات تسجيل غير آمنة مطلوبة (في حالة استخدام HTTP) على العقد الخاصة بك. - التخزين المستمر:
تأكد من تحميل دليل بيانات السجل المحلي بشكل صحيح بحيث تستمر الصور عبر إعادة تشغيل الحاوية.
TLS interception with an internal CA
When an internal Certificate Authority signs outbound traffic, configure ilum-core.security.trustStore في single mode. In addition to populating the JVM truststore, the mode mounts the CA secret into the main إيلوم كور container and exports SSL_CERT_FILE, CURL_CA_BUNDLEو REQUESTS_CA_BUNDLE so that native TLS code paths trust the same CA as the JVM. Refer to the corporate MITM proxy walkthrough in CA Management for a step-by-step example.
DuckDB extensions in restricted environments
Ilum images ship with the httpfs, مثلجة, postgres_scannerو ducklake extensions pre-populated in DuckDB's local extension cache (~/.duckdb/extensions/), and with the hive_metastore و duck_lineage extensions staged under /duckdbExt. The DuckDB calls used internally never reach extensions.duckdb.org. To support additional extensions in restricted environments without rebuilding the image, mount them through ilum-core.sql.duckdb.extraExtensions. Refer to DuckDB Extension Management for details.
Frequently Asked Questions (FAQ)
Can I run Apache Spark on Kubernetes without internet access?
Yes. By using an air-gapped installation method, all necessary dependencies (Docker images, Helm charts) are downloaded on an online machine, transferred to the offline environment, and hosted in a local registry.
Do I need a local image registry for air-gapped installation?
While you can technically load images manually onto every node using docker load أو ctr image import, setting up a local registry (like Harbor or the basic Docker Registry) is strongly recommended. It simplifies scaling, image management, and ensures all nodes can pull images reliably.
How do I handle Spark dependencies in an offline cluster?
For Spark jobs that require external libraries (Maven/PyPI), you must pre-download these artifacts. You can either build custom Docker images containing these libraries or host a local Maven/PyPI mirror (e.g., using Sonatype Nexus or JFrog Artifactory) inside your air-gapped network.
What is the advantage of using Ilum in an air-gapped setup?
Ilum simplifies the management of Spark on Kubernetes by providing a unified control plane. In air-gapped environments, its ability to manage interactive sessions and jobs without reaching out to external cloud services makes it an ideal orchestrator for secure, on-prem data platforms.