Issue while running logstash container using kubernetes

Cluster information:

Kubernetes version:
Client Version: version.Info{Major:“1”, Minor:“17”, GitVersion:“v1.17.2”, GitCommit:“59603c6e503c87169aea6106f57b9f242f64df89”, GitTreeState:“clean”, BuildDate:“2020-01-18T23:30:10Z”, GoVersion:“go1.13.5”, Compiler:“gc”, Platform:“linux/amd64”}
Installation method: ```
snap install microk8s --classic

Host OS: Ubuntu 16.04
CNI and version:
CRI and version: 


While using the docker run command everything running fine. Same i am trying to do with kubernetes. The following commands i have used to enter logstash container

    microk8s.kubectl create deployment logstash --image logstash:6.8.6

For entering the interactive mode i have used

    microk8s.kubectl exec -it logstash-6b48b99476-ljszm -- bash



Till here everything worked fine after i'm running a basic input output command for logstash

    bin/logstash -e 'input { stdin { } } output { stdout {} }'



Then i'm getting the following error.



OpenJDK 64-Bit Server VM warning: If the number of processors is expected to increase from one, then you should configure the number of parallel GC threads appropriately using -XX:ParallelGCThreads=N

Sending Logstash logs to /usr/share/logstash/logs which is now configured via log4j2.properties

[2020-02-06T12:03:25,360][WARN ][logstash.config.source.multilocal] Ignoring the 'pipelines.yml' file because modules or command line options are specified

[2020-02-06T12:03:25,377][FATAL][logstash.runner          ] Logstash could not be started because there is already another instance using the configured data directory.  If you wish to run multiple instances, you must change the "path.data" setting.

[2020-02-06T12:03:25,386][ERROR][org.logstash.Logstash    ] java.lang.IllegalStateException: Logstash stopped processing because of an error: (SystemExit) exit



I can solve this by mentioning --path.data /tmp/ at the end of the logstash command but my question is why is it different. Did i done something wrong or the kubernetes is doing something under the hood.