How to deploy spring boot application to kubernetes without docker using Jenkins?

2/25/2022

In our project we are using old and depraceted docker plugin:

    <plugin>
        <groupId>com.spotify</groupId>
        <artifactId>docker-maven-plugin</artifactId>
        <version>1.2.0</version>
        <configuration>
            <imageName>${docker.image.name}</imageName>
            <imageTags>
                <imageTag>${project.version}</imageTag>
                <imageTag>latest</imageTag>
            </imageTags>
            <dockerDirectory>${basedir}/target/dockerfile</dockerDirectory>
            <resources>
                <resource>
                    <targetPath>/</targetPath>
                    <directory>${project.build.directory}</directory>
                    <include>${project.build.finalName}.jar</include>
                </resource>
            </resources>
        </configuration>
    </plugin>

and Jenkins deploy application using technology docker in docker to kubernetes.

Problem is that new version of kubernetes contains just containerd without docker. I am not sure where are the boundary and what is still part of containerd and what not (for example dockerfile) . Is there already concept how to deploy application to kubernetes without docker ?

UPDATE

I am sure that same job will not work because in Jenkins container we are mounting docker sock:

  containers:
    - name: all
      image: ...
      command:
        - cat
      tty: true
      volumeMounts:
        - name: m2
          mountPath: /root/.m2
        - name: dockersock
          mountPath: /var/run/docker.sock
  volumes:
    - name: dockersock
      hostPath:
        path: /var/run/docker.sock
    - name: m2
      hostPath:
        path: /jenkins 
-- hudi
docker
jenkins
kubernetes
spring-boot

1 Answer

2/25/2022

No need to worry: You don't need to care what container runtime is running inside your cluster, as long as it can operate on OCI or docker images. Consider the actual container runtime an implementation detail.

This is a separate topic from building the image. Even there are alternatives like Jib or Kaniko to using the docker daemon and a Dockerfile.

If you are building your images with jenkins and docker-as-a-container (docker-in-docker beeing just one option) you should be able to even keep that as it is.

-- Thomas
Source: StackOverflow