I have created kubernetes cluster using minikube. I am able to build an docker image using jenkins x but how can I deploy that image on kubernets. I am trying to install than image using helm sh "helm install -n go-k8s ./go-k8s/helm-chart"
but it is showing error helm: not found
Please help me. Thanks
Asked
Active
Viewed 464 times
0

Sarika Jamdade
- 57
- 8
1 Answers
0
I'm guessing this is all done inside a Jenkinsfile
right? By default Jenkins X creates build pods which have tools like helm
, kubectl
or jx
inside - so you need to run those binary tools inside container('foo') {...
block which is what the default pipelines do.
How about you create a quickstart via jx
and then you'll get a working Jenkinsfile
that builds a docker image, releases a helm chart and then promotes it through your environments - and generates a Preview Environment on each Pull Request to verify changes before you merge.
You can then copy/paste the Jenkinsfile
and use it for you other project?

James Strachan
- 9,168
- 34
- 31
-
Yes, its all done using jenkinsfile but I am trying simple command `sh 'kubectl get pods --all-namespaces'` , it is showing error `kubectl not found`. As I am new to this can you please elaborate how to use `container('foo') {...` this approach ? ` Thanks – Sarika Jamdade Jan 23 '19 at 15:02
-
is your `sh` inside a `container(...)` block? BTW its good to use the quickstarts then you get a pipeline that just works OOTB - figuring these out by hand takes lots of time and its really undifferentiated heavy lifting – James Strachan Feb 20 '19 at 06:07