Now we have a ready K8S cluster, we will start to develop, build and deploy some applications. We will create a namespace named “jenkins” with a small PVC for master: Next, we will create a master deployment
For our pipelines, we will use a declarative Jenkins pipeline file, we start by Build stage: checkout source and build artifact (Java by Maven and JS by Node)
Next stage, Prepare Docker workspace to build images: first copy target directory content to Docker workspace (we have defined a node credentials “SSHMaster” in Jenkins master), and we create and copy 2 Docker files, first with OpenJDK for backend java module and second with a simple Nginx for front Web module.
Next we try to deploy backend first and if we have problem with, we stop deployment process.