<p>I have a Java application which uses JAAS authentication and hence it needs a below system property.</p>

<blockquote>
  <p>-Djava.security.auth.login.config=/jaas/conf/client_jaas.conf</p>
</blockquote>

<p>We set this system property in our startup script thru JAVA_OPTS.</p>

<blockquote>
  <p>JAVA_OPTS="${JAVA_OPTS}
  -Djava.security.auth.login.config=/jaas/conf/client_jaas.conf"</p>
</blockquote>

<p>I am trying to move this app to Kubernetes and setting as below.</p>

<pre><code>"containers": [
          {
            "env": [
              {
                "name": "JAVA_OPTS",
                "value": "-Djava.security.auth.login.config=/jaas/conf/client_jaas.conf"
              },
</code></pre>

<p>But, I am getting the below error in my application logs.</p>

<pre><code>Caused by: java.lang.IllegalArgumentException: Could not find a 'appClient' entry in the JAAS configuration. System property 'java.security.auth.login.config' is not set
</code></pre>

<p>Is there any other way to set this?</p>

<p>Thanks</p>

<p>I don't know if this is a related problem to the following: JAVA_OPTS is not an out-of-the-box environment variable, but a convention. If you take a look at <a href="https://github.com/xetys/jhipsterSampleApplication/blob/master/src/main/docker/Dockerfile" rel="nofollow noreferrer">this example Dockerfile</a> </p>

<pre><code>FROM openjdk:8-jre-alpine

ENV SPRING_OUTPUT_ANSI_ENABLED=ALWAYS \
    JHIPSTER_SLEEP=0 \
    JAVA_OPTS=""

# add directly the war
ADD *.war /app.war

EXPOSE 8081
CMD echo "The application will start in ${JHIPSTER_SLEEP}s..." &amp;&amp; \
    sleep ${JHIPSTER_SLEEP} &amp;&amp; \
    java ${JAVA_OPTS} -Djava.security.egd=file:/dev/./urandom -jar /app.war
</code></pre>

<p>you see that the JAVA_OPTS is first defined as a variable and later been used for the java command itself. With this configuration, you are then able to pass custom java options using ENV vars.</p>

<p>So I assume you did everything correctly in kubernetes, but the underlying docker image does not handle it properly</p>
