Add Extensions

JFrog Installation & Setup Documentation

Content Type
Installation & Setup
ft:sourceType
Paligo

Extensions (also known as plugins) are software components that extend and integrate with your system. Most cluster administrators will use a hosted or distribution instance of Kubernetes. In this section we have included some of the extensions you can use with Artifactory using Helm Charts.

Use Logger Sidecars

Logger sidecars enable you to tail various logs from Artifactory (see the available values in the values.yamlfile).

To get a list of containers in the pod do the following.

kubectl get pods -n <NAMESPACE> <POD_NAME> -o jsonpath='{.spec.containers[*].name}' | tr ' ' '\n'

To view specific logs, use the following.

kubectl logs -n <NAMESPACE> <POD_NAME> -c <LOG_CONTAINER_NAME>
Add User Plugins

User plugins enable you to extend Artifactory's behavior, for example, creating a Kubernetes secret.

You can download user plugins from https://github.com/jfrog/artifactory-user-plugins/.

Complete the following steps after you download the plugin to add a user plugin.

  1. Create a secret with Artifactory User Plugins 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 
  2. Create a plugin-values.yaml file that contains the plugin secret names and

    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

    copyOnEveryStartup command 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.

    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

    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.

  3. You can now pass theplugins.yaml file you created to the Helm install command to deploy Artifactory with user plugins as follows.

    Artifactory

    helm upgrade --install artifactory jfrog/artifactory --namespace artifactory -f plugin-values.yaml

    Artifactory HA

    helm upgrade --install artifactory-ha jfrog/artifactory-ha --namespace artifactory-ha -f plugin-values.yaml

You can view examples of downloading and adding user plugins for the artifactory chart and artifactory-ha chart.

Alternatively, you may be in a situation in which you would like to create a secret in a Helm chart that depends on this chart. In this scenario, the name of the secret is likely generated dynamically via template functions, so passing a statically named secret is not possible.

In this case, Helm chart supports evaluating strings as templates via the tpl function--simply pass the raw string containing the templating language used to name your secret as a value instead by adding the following to your chart's values.yaml file.

artifactory: # Name of the artifactory dependency
  artifactory:
    userPluginSecrets:
      - '{{ template "my-chart.fullname" . }}'