Skip to content

Commit 0510d27

Browse files
author
Paulo Ribeiro
authored
Merge pull request #745 from codacy/doc/configure-external-nfs-DOCS-393
doc: Add external NFS setup instructions DOCS-393
2 parents 8e1eaf2 + 7d52741 commit 0510d27

4 files changed

Lines changed: 68 additions & 9 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,10 @@ The following parameters are specific to each Codacy component.
185185
| `listener.nfsserverprovisioner.persistence.enabled` | Creates an NFS provisioner | `true` |
186186
| `listener.nfsserverprovisioner.persistence.size` | Size of the NFS server disk | `120Gi` |
187187
| `listener.cacheCleanup.olderThanDays` | Data retention policy in days | `30` |
188+
| `listener.cache.name` | External NFS volume name | `listener-cache` |
189+
| `listener.cache.path` | External NFS volume mount path | `/data` |
190+
| `listener.cache.nfs.server` | IP address of external NFS server | `0.0.0.0` |
191+
| `listener.cache.nfs.path` | External NFS server directory or file system to be mounted | `/` |
188192
| `engine.replicaCount` | Number of replicas | `1` |
189193
| `engine.image.repository` | Image repository | from dependency |
190194
| `engine.image.tag` | Image tag | from dependency |

docs/configuration/caching.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
description: Configure Codacy Self-hosted to use an external NFS server to improve the performance of the cloned repository cache.
3+
---
4+
5+
# Caching
6+
7+
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.
8+
9+
To use your own external NFS server:
10+
11+
1. Edit the file `values-production.yaml` that you [used to install Codacy](../index.md#helm-upgrade).
12+
13+
1. Set `listener.nfsserverprovisioner.enabled: "false"` and define the remaining `listener.cache.*` values as described below:
14+
15+
```yaml
16+
listener:
17+
nfsserverprovisioner:
18+
enabled: false
19+
cache:
20+
name: listener-cache
21+
path: /data
22+
nfs:
23+
server: <NFS_SERVER_IP> # IP address of the external NFS server
24+
path: /var/nfs/data/ # External NFS server directory or file system to be mounted
25+
```
26+
27+
1. Apply the new configuration by performing a Helm upgrade. To do so execute the command [used to install Codacy](../index.md#helm-upgrade):
28+
29+
!!! important
30+
**If you're using MicroK8s** you must use the file `values-microk8s.yaml` together with the file `values-production.yaml`.
31+
32+
To do this, uncomment the last line before running the `helm upgrade` command below.
33+
34+
```bash
35+
helm upgrade (...options used to install Codacy...) \
36+
--version {{ version }} \
37+
--values values-production.yaml \
38+
# --values values-microk8s.yaml
39+
```
40+
41+
1. Validate that the `repository-listener` pod is now using the external NFS server:
42+
43+
```bash
44+
$ kubectl describe pod -n codacy codacy-listener-<...>
45+
46+
[...]
47+
48+
Volumes:
49+
listener-cache:
50+
Type: NFS (an NFS mount that lasts the lifetime of a pod)
51+
Server: <NFS_SERVER_IP>
52+
Path: /var/nfs/data/
53+
ReadOnly: false
54+
```

docs/configuration/integrations/bitbucket-server.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ After creating the Bitbucket Server application link, you must configure it on C
6666
6767
```yaml
6868
bitbucketEnterprise:
69-
enabled: "true"
70-
login: "true" # Show login button for Bitbucket Server
71-
hostname: "bitbucket.example.com" # Hostname of your Bitbucket Server instance
72-
protocol: "https" # Protocol of your Bitbucket Server instance
73-
port: 7990 # Port of your Bitbucket Server instance
74-
consumerKey: "" # Generated when creating the Bitbucket Server application link
75-
consumerPublicKey: "" # Generated when creating the Bitbucket Server application link
76-
consumerPrivateKey: "" # Generated when creating the Bitbucket Server application link
77-
contextPath: "" # Context path of your Bitbucket Server, if configured
69+
enabled: "true"
70+
login: "true" # Show login button for Bitbucket Server
71+
hostname: "bitbucket.example.com" # Hostname of your Bitbucket Server instance
72+
protocol: "https" # Protocol of your Bitbucket Server instance
73+
port: 7990 # Port of your Bitbucket Server instance
74+
consumerKey: "" # Generated when creating the Bitbucket Server application link
75+
consumerPublicKey: "" # Generated when creating the Bitbucket Server application link
76+
consumerPrivateKey: "" # Generated when creating the Bitbucket Server application link
77+
contextPath: "" # Context path of your Bitbucket Server, if configured
7878
```
7979
8080
3. Apply the new configuration by performing a Helm upgrade. To do so execute the command [used to install Codacy](../../index.md#helm-upgrade):

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ nav:
6262
- configuration/integrations/bitbucket-cloud.md
6363
- configuration/integrations/bitbucket-server.md
6464
- configuration/integrations/email.md
65+
- configuration/caching.md
6566
- configuration/monitoring.md
6667
- configuration/logging.md
6768
- "Maintenance and operations":

0 commit comments

Comments
 (0)