Deploy Service

The code:

public class Main {

    public static void main(String[] args) {
       /*
        * You will notice parameters in the following
        * are replaced
        *
        */
       System.out.println("User %USER% and Password %PASSWORD%");
    }

}

./mvnw compile

Packaging the Service

You can package the next bash script:

#!/bin/sh
echo "Hello World"

Deploy the Service

And then you can deploy the service and execute commands inside:

Check that the pod is up and running:

kubectl get pods
NAME                        READY   STATUS    RESTARTS   AGE
apps   1/1     Running   0          5s

Then let’s go into the running pod to execute some commands:

kubectl exec -ti apps /bin/bash
Change the pod name with your pod name.