On a single node deployment the build needs to be tagged, with the local docker registry prefix. This so the pod deployment can download the image from the local cache.
Model m = readMavenPom file: 'pom.xml'
def groupId = m.groupId.split( '\\.' )
def user = groupId[groupId.size()-1].trim()
def artifactId = m.artifactId
kubernetes.image().withName("${user}/${artifactId}:${config.version}").tag().inRepository("${env.FABRIC8_DOCKER_REGISTRY_SERVICE_HOST}:${env.FABRIC8_DOCKER_REGISTRY_SERVICE_PORT}/${user}/${artifactId}").withTag("${config.version}")
Note that the pipeline now assumed fmp-3, so your project needs to be converted to use this version of the plugin. Upgrade to the latest fmp-2 plugin and run
mvn install fabric8:migrate
For the tag in step 1 to work it is assumed the image name of the form group/artifact:version. So upgrade your pom so the image name is defined as
...
<images>
<image>
<name>%g/%a:%v</name>
<build>
...
remove any image name definition in the src/main/fabric8/deployment.yml
remote a docker.image property if you have one defined in your pom properties.
Try deploying your project to f8 using
mvn fabric8:run
I had to remove the labels mention in my src/main/fabric8/deployment.yml as they did not line up. Which prevented pod to be spun up.
Warning DeploymentCreationFailed Couldn't deploy version 1: ReplicationController "hellokurt-1" is invalid: spec.template.metadata.labels: Invalid value: {"container":"test","deployment":"hellokurt-1","deploymentconfig":"hellokurt","group":"io.kurt","project":"hellokurt","provider":"fabric8","version":"0.0.1-SNAPSHOT"}: selector does not match template labels
The fmp build step should probably have thrown a validation error if labels don't match up and not finish successfully.
Finally my fabric8 console had the production namespace defined as 'default-prod' while my job got deployed to default-production. I had to fix the reference in the 'Environments' tab in the fabric8-console. Then prod deployment were displayed in dashboard.
https://github.com/rawlingsj/jenkins-pipeline-library/blob/master/vars/mavenCanaryRelease.groovy#L24
mvn install fabric8:migrate
...
Try deploying your project to f8 using
mvn fabric8:run
The fmp build step should probably have thrown a validation error if labels don't match up and not finish successfully.