I was following the Elasticsearch documentation (Deploy an Elasticsearch cluster | Elastic Cloud on Kubernetes [2.14] | Elastic)
I am getting the below error while deploying the elasticsearch cluster on kubernetes:
Defaulted container "elasticsearch" out of: elasticsearch, elastic-internal-init-filesystem (init), elastic-internal-suspend (init)
java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
at java.base/sun.nio.fs.UnixException.asIOException(UnixException.java:115)
at java.base/sun.nio.fs.UnixFileSystemProvider.newDirectoryStream(UnixFileSystemProvider.java:477)
at java.base/java.nio.file.Files.newDirectoryStream(Files.java:481)
at java.base/java.nio.file.Files.list(Files.java:3777)
at org.elasticsearch.xpack.security.cli.AutoConfigureNode.isDirEmpty(AutoConfigureNode.java:1151)
at org.elasticsearch.xpack.security.cli.AutoConfigureNode.execute(AutoConfigureNode.java:166)
at org.elasticsearch.server.cli.ServerCli.autoConfigureSecurity(ServerCli.java:174)
at org.elasticsearch.server.cli.ServerCli.execute(ServerCli.java:87)
at org.elasticsearch.common.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:54)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:94)
at org.elasticsearch.cli.Command.main(Command.java:51)
at org.elasticsearch.launcher.CliToolLauncher.main(CliToolLauncher.java:64)
Any suggestion would be appreciated.
I feel that the above documentation doe snot address these types of issues which are common.