issue in deploying docker image on kubernetes through jenkins

7/9/2019

I am trying to deploy a docker image through Jenkins.

kubectl --namespace=dev apply -f k8s/dev/

I receive this error message.

dev apply -f k8s/services/ error: unable to recognize "k8s/services/config-server.yaml": no matches for kind "Service" in version "v1"
-- krupa alaiya
docker
jenkins
kubernetes

1 Answer

7/9/2019

In your yaml file look like there is an issue in service version.

check for the service compatibility with your kubernetes version.also try applying the command the kubectl apply -f <filename> -n <namespacename>

you can also try : kubectl apply -f <filename> -n <namespacename> --validate=false

-- Harsh Manvar
Source: StackOverflow