ARTIFACTORY: Use custom JDK for Artifactory in Helm installation under Kubernetes cluster
In this article, we are covering a use case of using custom JDK for Artifactory which is running on a Kubernetes cluster using Helm installation.
By default, Artifactory comes with build JDK but however in a few organizations there will be constraints of using a certain version of JDK which is approved by the security team. So, in that case, this article will be helpful.
Artifactory 7.x supports JDK 11+, but from Artifactory version 7.46.x and above JDK 17+ is supported (Mandatory) and even the custom JDK should be JDK 17+ for Artifactory version 7.46.x and above.
Below are the steps to be followed to use custom JDK for Artifactory in Helm installation under Kubernetes cluster:
The below example steps were tested on Artifactory version 7.46.x with custom java (Open JDK 17.0.5).
artifactory: preStartCommand: "mkdir -p /opt/jfrog/artifactory/var/custom-java/; cd /opt/jfrog/artifactory/var/custom-java/ && curl https://download.oracle.com/java/17/archive/jdk-17.0.5_linux-x64_bin.tar.gz -O && tar -xvf jdk-17.0.5_linux-x64_bin.tar.gz && rm -f jdk-17.0.5_linux-x64_bin.tar.gz"
artifactory:
preStartCommand: "mkdir -p /opt/jfrog/artifactory/var/custom-java/; cd /opt/jfrog/artifactory/var/custom-java/ && curl https://download.oracle.com/java/17/archive/jdk-17.0.5_linux-x64_bin.tar.gz -O && tar -xvf jdk-17.0.5_linux-x64_bin.tar.gz && rm -f jdk-17.0.5_linux-x64_bin.tar.gz"
systemYaml: |
shared:
javaHome: "/opt/jfrog/artifactory/var/custom-java/jdk-17.0.5"
Once the custom java is configured and integrated with Artifactory, then we can check whether the custom java is being used by Artifactory process with ps -ef | grep -i Artifactory command