Air-Gapped Installation of Apache Spark on Kubernetes
नीचे स्थापित करने के लिए चरण-दर-चरण मार्गदर्शिका दी गई है इलम एक ऑफ़लाइन (एयर-गैप्ड) वातावरण में। यह मार्गदर्शिका आपके कुबेरनेट्स वितरण के लिए अज्ञेयवादी होने के लिए लिखी गई है और कंटेनर छवियों के प्रबंधन के लिए दोनों दृष्टिकोणों को शामिल करती है— कंटेनर्ड (के साथ सीटीआर tool) या बंदरगाह-मज़दूर. निर्देश मानते हैं कि आपके पास:
- आवश्यक हेल्म चार्ट और कंटेनर छवियों को डाउनलोड करने के लिए एक इंटरनेट से जुड़ा वर्कस्टेशन।
- ऑनलाइन वर्कस्टेशन से आपके ऑफ़लाइन वातावरण में फ़ाइलों को स्थानांतरित करने के लिए एक विधि (जैसे USB ड्राइव या आंतरिक फ़ाइल सर्वर)।
- आपके ऑफ़लाइन वातावरण में एक कार्यशील कुबेरनेट्स क्लस्टर (कोई भी वितरण)।
- हेल्म स्थापित और आपके ऑफ़लाइन क्लस्टर से कनेक्ट करने के लिए कॉन्फ़िगर किया गया है।
- 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.
एक 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 बाकी एपीआई नहीं तो Spark Submit once the cluster is operational.
1. Preparation and Downloads
प्रक्रिया को इन चरणों में विभाजित किया गया है:
1.1. Download Ilum Helm Chart for Offline Use
इलम चार्ट एक सार्वजनिक हेल्म रिपॉजिटरी के माध्यम से प्रदान किया जाता है, चलाएं:
helm repo आगे कहना ilum https://charts.ilum.cloud
हेल्म रेपो अपडेट
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अपाचे/सुपरसेट:डॉकरीज़bitnamilegacy/postgresql:16bitnami/git:latestकर्लइमेज/कर्ल: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.1इलम / हाइव: 3.1.3इलम/क्यूबी:1.10.0-स्पार्कilum/mageai:0.9.76इलम/मोंगोडीबी:6.0.5ilum/spark:3.5.8-deltaइलम / स्पार्क-लॉन्चर: स्पार्क-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"
"अपाचे/सुपरसेट: डॉकराइज"
"bitnamilegacy/postgresql:16"
"bitnami/git:latest"
"कर्लइमेज/कर्ल: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"
"इलम/हाइव:3.1.3"
"इलम/क्यूबी: 1.10.0-स्पार्क"
"ilum/mageai:0.9.76"
"इलम/मोंगोडबी: 6.0.5"
"ilum/spark:3.5.8-delta"
"इलम/स्पार्क-लॉन्चर: स्पार्क-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. कलाकृतियों को ऑफ़लाइन वातावरण में स्थानांतरित करें
अपनी ऑनलाइन मशीन से ऑफ़लाइन वातावरण में निम्नलिखित की प्रतिलिपि बनाने के लिए अपनी पसंदीदा विधि (यूएसबी ड्राइव, आंतरिक फ़ाइल सर्वर, एससीपी आदि) का उपयोग करें:
- हेल्म चार्ट पैकेज (उदा।
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 आयात करें (एक मशीन पर)
एक मशीन पर जो आपकी स्थानीय रजिस्ट्री तक पहुंच सकती है, टारबॉल आयात करें:
sudo सीटीआर -n k8s.io images आयात /path/to/<image_tarball>।तारकोल
उदाहरण के लिए:
sudo सीटीआर -n k8s.io images आयात /opt/offline-images/ilum_hive_3.1.3.tar
3A.2. छवि को स्थानीय रजिस्ट्री के लिए टैग करें
छवि को अपनी स्थानीय रजिस्ट्री के समापन बिंदु के साथ टैग करें (उदाहरण के लिए, यदि आपकी रजिस्ट्री पर पहुँच योग्य है लोकलहोस्ट: 5000):
sudo सीटीआर -n k8s.io images tag ilum/hive:3.1.3 localhost:5000/ilum/hive:3.1.3
3A.3. छवि को स्थानीय रजिस्ट्री में पुश करें
टैग की गई छवि को पुश करें:
sudo सीटीआर -n k8s.io images push --plain-http localhost:5000/ilum/hive:3.1.3
(उपयोग --सादा-http यदि आपकी रजिस्ट्री TLS के बिना कॉन्फ़िगर की गई है.)
3B.1. छवि टारबॉल लोड करें (यदि आवश्यक हो)
यदि आप धक्का देने से पहले स्थानीय रूप से सत्यापित करना चाहते हैं (वैकल्पिक), तो आप अपने व्यवस्थापक मशीन पर एक छवि लोड कर सकते हैं:
docker load -i /path/to/<image_tarball>।तारकोल
उदाहरण के लिए:
docker load -i /opt/offline-images/ilum_hive_3.1.3.tar
3B.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, मजबूत विकल्पों पर विचार करें जैसे बंदरगाह, नेक्सस रिपोजिटरी प्रबंधक, या क्वे। उदाहरण के लिए बंदरगाह भूमिका-आधारित अभिगम नियंत्रण, भेद्यता स्कैनिंग, छवि प्रतिकृति और उपयोगकर्ता के अनुकूल वेब UI प्रदान करता है।
महत्वपूर्ण: सुनिश्चित करें कि आप जो भी रजिस्ट्री चुनते हैं वह एक अनुलग्न, निर्बाध वॉल्यूम (या लगातार भंडारण) के साथ कॉन्फ़िगर किया गया है। यह गारंटी देता है कि रजिस्ट्री कंटेनर को पुनरारंभ या अपडेट किए जाने पर भी आपकी छवियां उपलब्ध रहती हैं।
उदाहरण: स्थायी संग्रहण (डॉकर) के साथ एक मूल रजिस्ट्री स्थापित करना
-
रजिस्ट्री डेटा के लिए एक निर्देशिका बनाएँ:
Create Directorymkdir -p /opt/registry-data -
रजिस्ट्री कंटेनर को वॉल्यूम के साथ चलाएँ:
Start Registrydocker चलाना -d \
-p 5000:5000 \
--नाम registry \
-v /opt/registry-data:/var/lib/registry \
रजिस्ट्री: 2
उदाहरण: हार्बर का उपयोग करना
अधिक मजबूत समाधान के लिए, हार्बर के ऑफ़लाइन इंस्टॉलर को डाउनलोड करें हार्बर गिटहब रिलीज़ पेज और दिए गए दस्तावेज का पालन करें। हार्बर के लिए आपको इसकी स्थापना के हिस्से के रूप में लगातार भंडारण (वॉल्यूम का उपयोग करके) को कॉन्फ़िगर करने की आवश्यकता है।
5. Configure Helm for Local Registry
यह सुनिश्चित करने के लिए कि इलम सार्वजनिक रिपॉजिटरी के बजाय आपकी स्थानीय रजिस्ट्री से छवियों को खींचता है, हेल्म चार्ट में छवि भंडार संदर्भों को अपडेट करता है। उदाहरण के लिए, यदि डिफ़ॉल्ट मानों में है:
इलम कोर:
प्रतिबिंब: "ilum/core:6.6.1"
इसे इसमें बदलें:
इलम कोर:
प्रतिबिंब: "localhost:5000/ilum/core:6.6.1"
आप चार्ट के डिफ़ॉल्ट को संपादित कर सकते हैं मान.yaml या एक ओवरराइड फ़ाइल प्रदान करें। उदाहरण के लिए, बनाएं local-registry-values.yaml:
इलम कोर:
प्रतिबिंब: "localhost:5000/ilum/core:6.6.1"
इलम यूआई:
प्रतिबिंब: "localhost:5000/ilum/ui:6.6.1"
# अन्य घटकों के लिए समान ओवरराइड जोड़ें (जैसे, इलम / एयरफ्लो, इलम / हाइव, आदि)
फिर का उपयोग करके स्थापित (या अपग्रेड):
helm install ilum /path/to/ilum-<विवरण>.tgz --namespace ilum --create-namespace -स्त्री-विषयक local-registry-values.yaml
6. हेल्म का उपयोग करके इलम स्थापित करें
सुनिश्चित करें कि आपका कुबेकॉन्फिग आपके ऑफ़लाइन क्लस्टर के लिए कॉन्फ़िगर किया गया है, फिर हेल्म चार्ट स्थापित करें:
helm install ilum /path/to/ilum-<विवरण>.tgz --namespace ilum --create-namespace
(यदि आप एक का उपयोग कर रहे हैं तो ओवरराइड फ़ाइल शामिल करें।
7. सत्यापित करें और समस्या निवारण करें
7.1. परिनियोजन सत्यापित करें
-
हेल्म रिलीज स्थिति की जाँच करें:
Helm Statushelm status ilum --namespace इलम -
सूची फली:
Get PodsKubectl फली प्राप्त करें -n इलम -
पॉड छवि संदर्भों का निरीक्षण करें:
उदाहरण के लिए:
Describe Podkubectl describe pod <pod_name> -n इलम | grep Image:पुष्टि करें कि छवि पथ आपकी स्थानीय रजिस्ट्री का संदर्भ देते हैं (उदा।
लोकलहोस्ट:5000/इलम/हाइव: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.