Hello, everyone! I’m not good at kubernetes and I’m trying to figure out how to work with this. Currently I am working with java application and I’m going to deploy it witin container.
I have prepared Docker file with
ENTRYPOINT ["java", "-jar", "java_j.jar"]
in my java application.
I have prepared some helm charts too. And the main my question is:
Is it possible to use only one variable to specify all java options ineterested by me in it to use it within container.args (Deployment.yaml)?
{root}/values.yaml:
TEST_JAVA_OPTS = "-XX:+UseSerialGC"
TEST_JAVA_MEMORY_OPTS = "-Xmx256m -XX:MetaspaceSize=64m"
{root}/templates/Deployment.yaml
...
spec:
containers:
- name: test-java-service
command:
- java
- '{{ .Values.TEST_JAVA_MEMORY_OPTS }}'
- '{{ .Values.TEST_JAVA_OPTS }}'
- -jar
- java_j.jar
...
For now it doesn’t work to me because each my application startup failes with Improperly specified VM option
. I guess it tryies to give java entire string as one java option. That is wrong of course.
My purpose is to avoid a lot of variables for each java option and to let change it in Deployment directly (I know that there is a possibility to set enviroment variables in Dockerfile at ENTRYPOINT part but let assume this option is disabled for us)
Thank you!
Kubernetes version: 1.28.12