I have a spring boot application with the below docker file.
FROM docker.com/base/jdk1.8:latest
MAINTAINER Application Engineering [ https://docker.com/ ]
RUN mkdir -p /opt/docker/svc
COPY application/weather-service.war /opt/docker/svc/
CMD java -jar /opt/docker/svc/weather-service.war --spring.config.location=file:/conf/application.properties -Dlogging.config=/conf/logback.xml
I can use kubernetes configMap or secrets for application.properties and use the volume mount option as below.
"spec": {
"volumes": [
{
"name": "svc-prop",
"configMap": {
"name": "svc-app-config",
"items": [
{
"key": "application.properties",
"path": "application.properties"
}
]
}
}
],
"containers": [
"volumeMounts": [
{
"name": "svc-prop",
"mountPath": "/conf"
}
]
How can i achieve the samething for logback.xml. Do i need to use secrets as a file in this case?
I dont want to bundle logback.xml file with the image as we might be changing the log level at runtime.
Is there any other better approach for keeping logback.xml for spring boot app in Kubernetes?