如何在Kubernetes集群中使用Helm安装的Artifactory上更新证书到Java Keystore

Vignesh Surendrababu
2023-01-22十一10

相关版本此信息属于Artifactory版本6和7

为了将证书更新到Artifactory上的Java Keystore,您需要执行以下步骤

人工版本6:

步骤1:使用需要导入到Java Keystore中的证书文件创建configmap

Kubectl创建configmap all-ca——from-file=ca.crt
步骤2:在值中使用下面的configmap配置。yaml文件used for installing and upgrading Artifactory using helm
例子:artifactory:
customVolumeMounts: |
—name: all-ca
mountPath:“/ usr /地方/共享/ ca证书/ ca.crt”
子路径:ca.crt
customVolumes: |
—name: all-ca
configMap:
名称:所有ca
preStartCommand: "/java/jdk-11.0.7+10/bin/keytool -importcert -keystore /java/jdk-11.0.7+10/lib/security/cacerts -storepass changeit -file /usr/local/share/ca-certificates/ca. exe "crt -alias YourAlias -noprompt"

请注意:您可能必须使用上面提到的preStartCommand中的keytool位置和cacerts文件位置的确切路径

步骤3:使用更新后的值执行Helm升级。yaml文件

Artifactory版本7:

步骤1:为Artifactory版本6创建一个类似于上面提到的示例的configmapKubectl创建configmap trusted-cert——from-file=ca.crt

步骤2:从7。xversion, the custom certificates that need to be imported to Java Keystore can be placed in the trusted directory available under the "JFROG_HOME美元/ artifactory / etc /安全/键/信任

步骤3:使用下面提到的configmap配置并执行Hem升级
例子:

artifactory:
customVolumes: |
—name: trusted-certs
configMap:
名称:trusted-certs
customVolumeMounts: |
—name: trusted-certs
mountPath: /var/opt/jfrog/artifactory / etc /安全/键/信任