Oteemo / charts

Helm chart repository
https://oteemo.github.io/charts
MIT License
181 stars 232 forks source link

How correct add JAVA_TOOL_OPTIONS for container nexus? #312

Closed patsevanton closed 3 years ago

patsevanton commented 3 years ago

Hello! I try to add JAVA_TOOL_OPTIONS for container nexus. Add repo

helm repo add oteemocharts https://oteemo.github.io/charts

File my-values.yaml:

nexus:
  env:
    JAVA_TOOL_OPTIONS: "-agentpath:/data/agent/libdrill_agent.so=drillInstallationDir=/data/agent,adminAddress=drill-admin:8090,agentId=nexus,buildVersion=3.33.0,logLevel=DEBUG"

nexusProxy:
  env:
    nexusHttpHost: nexus.10-66-218-67.sslip.io

ingress:
  enabled: true

deployment:
  initContainers:
   - name: javaagent
     image: antonpatsev/javaagent:8104-39
     imagePullPolicy: IfNotPresent
     env:
       - name: AGENT_VERSION
         value: "0.8.0-19"
       - name: AUTOTEST_AGENT_VERSION
         value: "latest"
     volumeMounts:
       - name: "agent-files"
         mountPath: /data
  additionalVolumes:
    - name: "agent-files"
      emptyDir: {}    
  additionalVolumeMounts:
    - name: "agent-files"
      mountPath: /data

Install

helm install --atomic -f my-values.yaml sonatype-nexus oteemocharts/sonatype-nexus --version 5.3.2

Get error

coalesce.go:203: warning: destination for env is a table. Ignoring non-table value [map[name:INSTALL4J_ADD_VM_PARAMS value:-Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:ActiveProcessorCount=4] map[name:NEXUS_SECURITY_RANDOMPASSWORD value:false]]
Error: YAML parse error on sonatype-nexus/templates/deployment-statefulset.yaml: error converting YAML to JSON: yaml: line 42: did not find expected key

I think JAVA_TOOL_OPTIONS for container nexus override variable INSTALL4J_ADD_VM_PARAMS and NEXUS_SECURITY_RANDOMPASSWORD.

How correct add JAVA_TOOL_OPTIONS for container nexus?

patsevanton commented 3 years ago

Can i relocate value of variable INSTALL4J_ADD_VM_PARAMS and NEXUS_SECURITY_RANDOMPASSWORD to value.yaml? Sorry. Variable INSTALL4J_ADD_VM_PARAMS and NEXUS_SECURITY_RANDOMPASSWORD in value.yaml now.

patsevanton commented 3 years ago

Work my-value.yaml

nexus:
  env:
    - name: JAVA_TOOL_OPTIONS
      value: "-agentpath:/data/agent/libdrill_agent.so=drillInstallationDir=/data/agent,adminAddress=drill-admin:8090,agentId=nexus,buildVersion=3.33.0,logLevel=DEBUG"
    - name: INSTALL4J_ADD_VM_PARAMS
      value: "-Xms1200M -Xmx1200M -XX:MaxDirectMemorySize=2G -XX:ActiveProcessorCount=4"
    - name: NEXUS_SECURITY_RANDOMPASSWORD
      value: "false"

nexusProxy:
  env:
    nexusHttpHost: nexus.10-66-218-67.sslip.io

ingress:
  enabled: true

deployment:
  initContainers:
   - name: javaagent
     image: antonpatsev/javaagent:8104-39
     imagePullPolicy: IfNotPresent
     env:
       - name: AGENT_VERSION
         value: "0.8.0-19"
       - name: AUTOTEST_AGENT_VERSION
         value: "latest"
     volumeMounts:
       - name: "agent-files"
         mountPath: /data
  additionalVolumes:
    - name: "agent-files"
      emptyDir: {}    
  additionalVolumeMounts:
    - name: "agent-files"
      mountPath: /data