diff --git a/README.md b/README.md index 05075f67..3b8a2524 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,10 @@ The following parameters are specific to each Codacy component. | `listener.nfsserverprovisioner.persistence.enabled` | Creates an NFS provisioner | `true` | | `listener.nfsserverprovisioner.persistence.size` | Size of the NFS server disk | `120Gi` | | `listener.cacheCleanup.olderThanDays` | Data retention policy in days | `30` | +| `listener.cache.name` | External NFS volume name | `listener-cache` | +| `listener.cache.path` | External NFS volume mount path | `/data` | +| `listener.cache.nfs.server` | IP address of external NFS server | `0.0.0.0` | +| `listener.cache.nfs.path` | External NFS server directory or file system to be mounted | `/` | | `engine.replicaCount` | Number of replicas | `1` | | `engine.image.repository` | Image repository | from dependency | | `engine.image.tag` | Image tag | from dependency | diff --git a/docs/configuration/caching.md b/docs/configuration/caching.md new file mode 100644 index 00000000..6ae5257a --- /dev/null +++ b/docs/configuration/caching.md @@ -0,0 +1,54 @@ +--- +description: Configure Codacy Self-hosted to use an external NFS server to improve the performance of the cloned repository cache. +--- + +# Caching + +Codacy Self-hosted includes a built-in NFS server provisioner that deploys a shared volume to cache the cloned repository files while they're being analyzed by each tool. However, if you're dealing with big repositories or a high volume of analysis, using an NFS server external to the cluster will improve the performance of the cache. + +To use your own external NFS server: + +1. Edit the file `values-production.yaml` that you [used to install Codacy](../index.md#helm-upgrade). + +1. Set `listener.nfsserverprovisioner.enabled: "false"` and define the remaining `listener.cache.*` values as described below: + + ```yaml + listener: + nfsserverprovisioner: + enabled: false + cache: + name: listener-cache + path: /data + nfs: + server: # IP address of the external NFS server + path: /var/nfs/data/ # External NFS server directory or file system to be mounted + ``` + +1. Apply the new configuration by performing a Helm upgrade. To do so execute the command [used to install Codacy](../index.md#helm-upgrade): + + !!! important + **If you're using MicroK8s** you must use the file `values-microk8s.yaml` together with the file `values-production.yaml`. + + To do this, uncomment the last line before running the `helm upgrade` command below. + + ```bash + helm upgrade (...options used to install Codacy...) \ + --version {{ version }} \ + --values values-production.yaml \ + # --values values-microk8s.yaml + ``` + +1. Validate that the `repository-listener` pod is now using the external NFS server: + + ```bash + $ kubectl describe pod -n codacy codacy-listener-<...> + + [...] + + Volumes: + listener-cache: + Type: NFS (an NFS mount that lasts the lifetime of a pod) + Server: + Path: /var/nfs/data/ + ReadOnly: false + ``` diff --git a/docs/configuration/integrations/bitbucket-server.md b/docs/configuration/integrations/bitbucket-server.md index 1be28748..12101227 100644 --- a/docs/configuration/integrations/bitbucket-server.md +++ b/docs/configuration/integrations/bitbucket-server.md @@ -66,15 +66,15 @@ After creating the Bitbucket Server application link, you must configure it on C ```yaml bitbucketEnterprise: - enabled: "true" - login: "true" # Show login button for Bitbucket Server - hostname: "bitbucket.example.com" # Hostname of your Bitbucket Server instance - protocol: "https" # Protocol of your Bitbucket Server instance - port: 7990 # Port of your Bitbucket Server instance - consumerKey: "" # Generated when creating the Bitbucket Server application link - consumerPublicKey: "" # Generated when creating the Bitbucket Server application link - consumerPrivateKey: "" # Generated when creating the Bitbucket Server application link - contextPath: "" # Context path of your Bitbucket Server, if configured + enabled: "true" + login: "true" # Show login button for Bitbucket Server + hostname: "bitbucket.example.com" # Hostname of your Bitbucket Server instance + protocol: "https" # Protocol of your Bitbucket Server instance + port: 7990 # Port of your Bitbucket Server instance + consumerKey: "" # Generated when creating the Bitbucket Server application link + consumerPublicKey: "" # Generated when creating the Bitbucket Server application link + consumerPrivateKey: "" # Generated when creating the Bitbucket Server application link + contextPath: "" # Context path of your Bitbucket Server, if configured ``` 3. Apply the new configuration by performing a Helm upgrade. To do so execute the command [used to install Codacy](../../index.md#helm-upgrade): diff --git a/mkdocs.yml b/mkdocs.yml index b4e17b49..24786f2a 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -62,6 +62,7 @@ nav: - configuration/integrations/bitbucket-cloud.md - configuration/integrations/bitbucket-server.md - configuration/integrations/email.md + - configuration/caching.md - configuration/monitoring.md - configuration/logging.md - "Maintenance and operations":