Overview
With the upgrade to version 1.2.0, ZCP now supports Kubernetes 1.13.
One of the major changes in Kubernetes 1.13 is the use of ContainerD instead of Docker. For more details, refer to this link.
In the ZCP CI/CD pipeline, the Docker build previously used the Docker Daemon of the Host Worker node. However, from ZCP 1.2.0 onwards, the Host Worker node no longer has a Docker Daemon. Therefore, the pipeline must be modified to use a Dind image that includes the Docker daemon for the Docker build.
Pipeline Modifications
podTemplate(label:label, serviceAccount: "zcp-system-sa-${ZCP_USERID}", containers: [ containerTemplate(name: 'maven', image: 'maven:3.5.2-jdk-8-alpine', ttyEnabled: true, command: 'cat'), // Use dind as the Docker build image // containerTemplate(name: 'docker', image: 'docker', ttyEnabled: true, command: 'cat'), containerTemplate(name: 'docker', image: 'docker:17-dind', ttyEnabled: true, command: 'dockerd-entrypoint.sh', privileged: true), // Update kubectl to version 1.13.6 // containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl', ttyEnabled: true, command: 'cat') containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl:v1.13.6', ttyEnabled: true, command: 'cat') ], volumes: [ // Remove Docker daemon mount // hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock'), persistentVolumeClaim(mountPath: '/root/.m2', claimName: 'zcp-jenkins-mvn-repo') ]) {
Lines 6-7: Modify to use the dind Docker image.
- Changed the base Docker image to 17-dind.
- Updated the command to
dockerd-entrypoint.sh
to start the Docker daemon when the pod runs. - Added the
privileged: true
option to enable Docker daemon execution.
Lines 9-10: Modify to use kubectl image version v1.13.6.
- Updated the k8s-kubectl image version to v1.13.6.
For clusters that cannot access Docker Hub, push the required image to the Harbor Registry provided by ZCP.
Line 14: Remove volume mount for the Host Worker node’s Docker daemon.
Online consultation
Contact us