Payara Micro Kubernetes Deployment Error

Dockerfile

FROM payara/micro:5.2022.5
COPY clustertest-0.0.2.war $DEPLOY_DIR

Running locally in Docker

docker run -d \
-it \
--name clustertest \
--mount type=bind,source=/home/ubuntu/repos/prod-data,target=/mnt/apps-data-dir \
-p 8080:8080 \
-e 'JVM_ARGS=-DAPPS_DATA_DIR=/mnt/apps-data-dir -Xms256m -Xmx256m -XX:MaxDirectMemorySize=256m' \
harbor.k8s.integrisit.dev/library/cluster-test:v0.0.2 --autobindhttp --clustermode kubernetes:cluster-test,cluster-test

This works as expected

$ docker logs a52c | grep -e 'kubernetes'
    hazelcast-runtime-configuration.discovery-mode=kubernetes
    hazelcast-runtime-configuration.kubernetes-namespace=cluster-test
    hazelcast-runtime-configuration.kubernetes-service-name=cluster-test
    ...

Kubernetes deployment

    spec:
      containers:
        - name: cluster-test
          image: harbor.k8s.integrisit.dev/library/cluster-test:v0.0.2
          args:
            - --autobindhttp
            - --clustermode kubernetes:cluster-test,cluster-test
            ...

Using the same parameters in k8s has a different result

SEVERE: --clustermode kubernetes:cluster-test,cluster-test is not a valid command line switch for Payara Micro try --help for valid command options

Does anyone have an example of a k8s deployment with --clustermode kubernetes configured for a specific namespace and service like in the Payara Micro docs?

I got it working from this example.

Payara-Examples/deployment.yaml at master · payara/Payara-Examples · GitHub

    spec:
      containers:
        - name: cluster-test
          image: harbor.k8s.integrisit.dev/library/cluster-test:v0.0.2
          args:
            - --autobindhttp
            - --clustermode
            - kubernetes:cluster-test,cluster-test