Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 | `/` |
Comment on lines +188 to +191

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I obtained the default values from the repository-listener repository.

| `engine.replicaCount` | Number of replicas | `1` |
| `engine.image.repository` | Image repository | from dependency |
| `engine.image.tag` | Image tag | from dependency |
Expand Down
54 changes: 54 additions & 0 deletions docs/configuration/caching.md
Original file line number Diff line number Diff line change
@@ -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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check/validate the rationale for setting up an external NFS server instead of using the built-in one.


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: <NFS_SERVER_IP> # 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: <NFS_SERVER_IP>
Path: /var/nfs/data/
ReadOnly: false
```
18 changes: 9 additions & 9 deletions docs/configuration/integrations/bitbucket-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down