How to deploy 3 replicas of an image in 3 different nodes residing in 3 different JVMs?

Asking for help? Comment out what you need so we can get more information to help you!
Our setup is like this, we have 3 different JVMs, where each JVM will have a single node and a single pod associated with it(3 replicas in 3 individual nodes and JVM).

So now we are using 3 replicas is single node and single JVM with LoadBalancer service like this,

apiVersion: apps/v1
kind: Deployment
metadata:
name: greeting
spec:
replicas: 3
selector:
matchLabels:
app: greeting
template:
metadata:
labels:
app: greeting
spec:
containers:
- name: greeting
image: XXXXXX
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: “http”


apiVersion: v1
kind: Service
metadata:
name: greeting
spec:
selector:
app: greeting
ports:

  • name: http
    protocol: TCP
    port: 9080
    targetPort: 8080
    nodePort: 30889
    type: LoadBalancer

Now we want to deploy 3 replicas in 3 different nodes residing in 3 different JVMs. Can someone help me in achieving the same with LoadBalancer service for above?

Cluster information:

Kubernetes version:
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS:
CNI and version:
CRI and version:

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.