spark-operator icon indicating copy to clipboard operation
spark-operator copied to clipboard

driver initContainers Not effective ,How do you use it?

Open lizu18xz opened this issue 3 years ago • 7 comments

driver: cores: 1 coreLimit: "1200m" memory: "512m" labels: version: 3.1.1 serviceAccount: spark volumeMounts: - name: "test-volume" mountPath: "/tmp" initContainers: - name: init-myservice image: busybox:1.28 command: ['sh', '-c', "until nslookup myservice.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for myservice; sleep 2; done"]

kubectl describe -f spark-pi2.yaml Events: Type Reason Age From Message


Normal SparkApplicationAdded 75s spark-operator SparkApplication spark-pi was added, enqueuing it for submission Normal SparkApplicationSubmitted 72s spark-operator SparkApplication spark-pi was submitted successfully Normal SparkDriverRunning 69s spark-operator Driver spark-pi-driver is running Normal SparkExecutorPending 60s spark-operator Executor [spark-pi-c5f82c84f6015f45-exec-1] is pending Normal SparkExecutorRunning 59s spark-operator Executor [spark-pi-c5f82c84f6015f45-exec-1] is running Normal SparkDriverCompleted 54s (x2 over 54s) spark-operator Driver spark-pi-driver completed Normal SparkExecutorCompleted 54s spark-operator Executor [spark-pi-c5f82c84f6015f45-exec-1] completed Normal SparkApplicationCompleted 53s spark-operator SparkApplication spark-pi completed

lizu18xz avatar Dec 09 '22 08:12 lizu18xz

I recently tried a gitsync init container and it was not being recognized either.

Elsayed91 avatar Dec 25 '22 17:12 Elsayed91

We are also trying to use initContainer. But Looks like its not being recognized. webhook was enabled as mentioned in the docs. We are using the helm charts 1.1.26 releae.

rangnar14 avatar Feb 10 '23 08:02 rangnar14

I was seeing a similar issue with our sparkapplication where the initContainers were defined in the yaml file but was not getting created in the pod. For us, the root cause was the webhook not being enabled on that particular cluster.

You can check to see if the webhook is working by checking the log of spark-operator The spark-operator should frequently be logging webhook.go:247] Serving admission request

If you need to setup webhook, here's the instruction https://github.com/GoogleCloudPlatform/spark-on-k8s-operator/blob/master/docs/quick-start-guide.md#about-the-mutating-admission-webhook

sam-som avatar Mar 14 '23 08:03 sam-som

Same issue here

Using spark-operator chart 1.1.27

With webhook.enable=true set, the spark-operator pod gives only the following logs

0530 01:40:21.154915      10 webhook.go:219] Starting the Spark admission webhook server
I0530 01:40:21.158751      10 webhook.go:424] Creating a MutatingWebhookConfiguration for the Spark pod admission webhook

No sign of webhook.go:247] Serving admission request :(

And the pod created by SparkApplication shows no sign of initContainer

yougyoung94 avatar May 30 '23 01:05 yougyoung94

was anyone able to get this working?

rahulbhatia2702 avatar Jul 26 '23 20:07 rahulbhatia2702

@lizu18xz Hello, was the problem solved later

ChengJie1053 avatar Sep 05 '23 08:09 ChengJie1053

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

github-actions[bot] avatar Aug 14 '24 20:08 github-actions[bot]