how to solve Kube exec format Error in litmus-chaos while using the python-sdk to customchaos experiments
AnnaMohan opened this issue · 14 comments
W0524 05:21:20.698096 1 client_config.go:552] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
2022/05/24 05:21:20
ChaosEngine Name : sample-exec-chaos-25ezhswb
2022/05/24 05:21:20 Created Resource Details:
{sample-exec-chaos-25ezhswb litmuschaos.io v1alpha1 ChaosEngine litmus }
W0524 05:21:20.752166 1 client_config.go:552] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
2022/05/24 05:21:20 Starting Chaos Checker in 1min
2022/05/24 05:22:20 Checking if Engine Completed or Stopped
2022/05/24 05:22:20 [*] ENGINE COMPLETED
W0524 05:21:21.878291 1 client_config.go:541] Neither --kubeconfig nor --master was specified. Using the inClusterConfig. This might not work.
time='2022-05-24T05:21:21Z' level=info msg='Experiments details are as follows' appNs=default appKind=deployment Service Account Name=litmus-admin Engine Namespace=litmus Experiments List='[sample-exec-chaos]' Engine Name=sample-exec-chaos-25ezhswb appLabels='app=nginx'
time='2022-05-24T05:21:22Z' level=info msg='Getting the ENV Variables'
time='2022-05-24T05:21:22Z' level=info msg='Preparing to run Chaos Experiment: sample-exec-chaos'
time='2022-05-24T05:21:22Z' level=info msg='Started Chaos Experiment Name: sample-exec-chaos, with Job Name: sample-exec-chaos-76wuma'
time='2022-05-24T05:21:42Z' level=info msg='Chaos Pod Completed, Experiment Name: sample-exec-chaos, with Job Name: sample-exec-chaos-76wuma'
time='2022-05-24T05:21:42Z' level=error msg='unable to Update ChaosEngine Status, error: unable to get ChaosResult name: sample-exec-chaos-25ezhswb-sample-exec-chaos in namespace: litmus, error: chaosresults.litmuschaos.io 'sample-exec-chaos-25ezhswb-sample-exec-chaos' not found'
time='2022-05-24T05:21:42Z' level=info msg='Chaos Engine has been updated with result, Experiment Name: sample-exec-chaos'
time='2022-05-24T05:21:42Z' level=info msg='[skip]: skipping the job deletion as jobCleanUpPolicy is set to {retain}'
time=2022-05-24 05:21:27,356 level=INFO msg=Experiment Name: chaos
time=2022-05-24 05:21:27,357 level=INFO msg=[PreReq]: Initialise Chaos Variables for the sample-exec-chaos experiment
time=2022-05-24 05:21:27,357 level=INFO msg=[PreReq]: Updating the chaos result of sample-exec-chaos experiment (SOT)
time=2022-05-24 05:21:27,504 level=ERROR msg=Unable to Create the Chaos Result, err: [Errno 8] Exec format error: 'kubectl'
Failing to run the workflow because of this kube exec format error i have provided the logs above for the same
Hi @AnnaMohan, Send me environment details, where you are testing
i'm trying it on localhost
Please install kubectl locally and make sure kubectl binary is correctly placed:
curl -L https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl -o /usr/local/bin/kubectl && \ chmod +x /usr/local/bin/kubectl
cc: @AnnaMohan
Hi, @oumkale i checked twice, it is placed correctly, even i'm facing the issue, can we connect once
Please run given command, It will help you!
i ran the given command again, even the issue persisits, can we connect once to discuss this
Ok, schedule a call on saturday morning, add a invite to imkaleoum@gmail.com
i sent an gmeet invite, just let me know if you haven't get the invite from annamohan3@gmail.com
Joined!
Internet issue I guess, disconnected. I'm Joining again, take me in man!
Btw root cause was solved from litmus-python side @AnnaMohan.
Issues:
- Not providing TARGETARCH in Dockerfile, kubectl was failing since TARGETARCH passed empty in curl command.
- Example:
TARGETARCH="amd64"
orTARGETARCH="arm64"
based on required Architecture. - Few other issue were there, like docker daemon and cluster setup side.
cc: @ksatchit