Extensions Configuration
Extend Artifactory Helm deployments with plugins: logger sidecars, user plugins, JMX metrics, and custom integrations.
Extensions (also called plugins) are software components that add custom functionality to Artifactory. The following sections cover extensions available for JFrog Artifactory using Helm charts.
Use Logger Sidecars
Logger sidecars let you tail specific Artifactory logs (see values.yaml for available log containers).
To get a list of containers in the pod, run:
kubectl get pods -n <NAMESPACE> <POD_NAME> -o jsonpath='{.spec.containers[*].name}' | tr ' ' '\n'To view specific logs, run:
kubectl logs -n <NAMESPACE> <POD_NAME> -c <LOG_CONTAINER_NAME>Add User Plugins
User plugins extend Artifactory's behavior with custom logic.
You can download user plugins from https://github.com/jfrog/artifactory-user-plugins/.
After downloading the plugin, follow these steps to add it.
-
Create Kubernetes secrets from the plugin files using the following command.
# Secret with single user plugin kubectl create secret generic archive-old-artifacts --from-file=archiveOldArtifacts.groovy --namespace=artifactory # Secret with single user plugin with configuration file kubectl create secret generic webhook --from-file=webhook.groovy --from-file=webhook.config.json.sample --namespace=artifactory -
Create a
plugin-values.yamlfile with the plugin secret names:Artifactory Chart
artifactory: ## List of secrets for Artifactory user plugins. ## One secret per plugin's files. userPluginSecrets: - archive-old-artifacts - webhook - cleanup copyOnEveryStartup: - source: /artifactory_bootstrap/plugins/* target: etc/artifactory/plugins/artifactory.copyOnEveryStartup is used to copy and overwrite the files from /artifactory_bootstrap/plugins to /opt/jfrog/artifactory/var/etc/artifactory/plugins every time the pod is restarted.
Note
copyOnEveryStartupcommand is used to copy and overwrite the files from/artifactory_bootstrap/pluginsto/opt/jfrog/artifactory/var/etc/artifactory/pluginsevery time the pod is restarted.
Artifactory HA Chart
artifactory:
## List of secrets for Artifactory user plugins.
## One secret per plugin's files.
userPluginSecrets:
- archive-old-artifacts
- webhook
- cleanup
primary:
preStartCommand: "mkdir -p {{ .Values.artifactory.persistence.mountPath }}/etc/artifactory/plugins/ && cp -Lrf /artifactory_bootstrap/plugins/* {{ .Values.artifactory.persistence.mountPath }}/etc/artifactory/plugins/"artifactory.primary.preStartCommand is used to copy and overwrite the files from /artifactory_bootstrap/plugins to /opt/jfrog/artifactory/var/etc/artifactory/plugins every time the pod is restarted.Note
Every time the pod is restarted,
artifactory.primary.preStartCommandis used to copy and overwrite the files from/artifactory_bootstrap/pluginsto/opt/jfrog/artifactory/var/etc/artifactory/plugins.
-
Pass
plugin-values.yamlto the Helm install command:Artifactory
helm upgrade --install artifactory jfrog/artifactory --namespace artifactory -f plugin-values.yamlArtifactory HA
helm upgrade --install artifactory-ha jfrog/artifactory-ha --namespace artifactory-ha -f plugin-values.yaml
View examples of user plugin setup for the artifactory chart and artifactory-ha chart.
If the dependent chart generates secret names dynamically via template functions, a static name will not work.
The Helm chart supports evaluating strings as templates via the tpl function. Pass it by adding the following to your chart's values.yaml.
artifactory: # Name of the artifactory dependency
artifactory:
userPluginSecrets:
- '{{ template "my-chart.fullname" . }}'Updated 24 days ago
