From 092538c8664092072cb8031ca49141c1c3f44379 Mon Sep 17 00:00:00 2001 From: Shwetambara Nazare Date: Mon, 29 Apr 2024 12:49:30 +0200 Subject: [PATCH 1/3] Changes for readiness and liveness probe --- k8s/base/deployment.yaml | 3 +++ k8s/base/kustomization.yaml | 8 +++++++- k8s/overlays/cloud/deployment_patch.yaml.template | 1 + .../{log4j2.xml.template => log4j2-spring.xml.template} | 0 4 files changed, 11 insertions(+), 1 deletion(-) rename set-web/src/main/resources/{log4j2.xml.template => log4j2-spring.xml.template} (100%) diff --git a/k8s/base/deployment.yaml b/k8s/base/deployment.yaml index 9d9b20cd..5aafe4db 100644 --- a/k8s/base/deployment.yaml +++ b/k8s/base/deployment.yaml @@ -46,3 +46,6 @@ spec: - name: app-properties secret: secretName: set-api-properties + - name: log4j-config + configMap: + name: log4j2-properties diff --git a/k8s/base/kustomization.yaml b/k8s/base/kustomization.yaml index 27a3601d..be0fa202 100644 --- a/k8s/base/kustomization.yaml +++ b/k8s/base/kustomization.yaml @@ -10,4 +10,10 @@ labels: secretGenerator: - name: set-api-properties files: - - set.user.properties \ No newline at end of file + - set.user.properties + +#generate config mapping for log4j2.xml file +configMapGenerator: + - name: log4j2-properties + files: + - log4j2-spring.xml \ No newline at end of file diff --git a/k8s/overlays/cloud/deployment_patch.yaml.template b/k8s/overlays/cloud/deployment_patch.yaml.template index 1e59364c..1d4d9c82 100644 --- a/k8s/overlays/cloud/deployment_patch.yaml.template +++ b/k8s/overlays/cloud/deployment_patch.yaml.template @@ -21,6 +21,7 @@ spec: -Delastic.apm.server_urls=${ELASTIC_APM_SERVERS} -Delastic.apm.service_name=${APP_NAME} -Delastic.apm.environment=${K8S_NAMESPACE}" + -Dlogging.config=/opt/app/config/log4j2-spring.xml" resources: requests: memory: "${MEMORY_REQUEST}M" diff --git a/set-web/src/main/resources/log4j2.xml.template b/set-web/src/main/resources/log4j2-spring.xml.template similarity index 100% rename from set-web/src/main/resources/log4j2.xml.template rename to set-web/src/main/resources/log4j2-spring.xml.template From 95b9abdc39124029294633cab3aa96fcd9d624b6 Mon Sep 17 00:00:00 2001 From: Shwetambara Nazare Date: Mon, 29 Apr 2024 13:15:03 +0200 Subject: [PATCH 2/3] Changes for readiness and liveness probe --- k8s/base/deployment.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/k8s/base/deployment.yaml b/k8s/base/deployment.yaml index 5aafe4db..7fdad840 100644 --- a/k8s/base/deployment.yaml +++ b/k8s/base/deployment.yaml @@ -42,6 +42,10 @@ spec: mountPath: "/opt/app/config/set.user.properties" readOnly: true subPath: set.user.properties + - name: log4j-config + mountPath: "/opt/app/config/log4j2-spring.xml" + readOnly: true + subPath: log4j2-spring.xml volumes: - name: app-properties secret: From 16f05db817ef515f56f8500b95ce55ffc7595f3b Mon Sep 17 00:00:00 2001 From: Shwetambara Nazare Date: Mon, 29 Apr 2024 13:29:01 +0200 Subject: [PATCH 3/3] Changes for readiness and liveness probe --- k8s/overlays/cloud/deployment_patch.yaml.template | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/k8s/overlays/cloud/deployment_patch.yaml.template b/k8s/overlays/cloud/deployment_patch.yaml.template index 1d4d9c82..1f84ad1f 100644 --- a/k8s/overlays/cloud/deployment_patch.yaml.template +++ b/k8s/overlays/cloud/deployment_patch.yaml.template @@ -20,7 +20,7 @@ spec: -Delastic.apm.application_packages=${ELASTIC_APP_PACKAGES} -Delastic.apm.server_urls=${ELASTIC_APM_SERVERS} -Delastic.apm.service_name=${APP_NAME} - -Delastic.apm.environment=${K8S_NAMESPACE}" + -Delastic.apm.environment=${K8S_NAMESPACE} -Dlogging.config=/opt/app/config/log4j2-spring.xml" resources: requests: