-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathREADME.md.gotmpl
87 lines (59 loc) · 3.68 KB
/
README.md.gotmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{{ template "rstudio.header" . }}
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}{{ template "chart.appVersionBadge" . }}
{{ template "rstudio.description" . }}
{{ template "rstudio.best-practices" . }}
{{ template "rstudio.install" . }}
## Required configuration
To function, this chart requires the following:
* A license file. See the [Licensing](#licensing) section below for more details.
* A Kubernetes [PersistentVolume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) that contains the data directory for Connect.
* If `sharedStorage.create` is set, it creates a Persistent Volume Claim (PVC) that relies on the default storage class to generate the
PersistentVolume.
Most Kubernetes environments do not have a default storage class that you can use with `ReadWriteMany` access mode out-of-the-box.
In this case, we recommend you disable `sharedStorage.create` and create your own `PersistentVolume` and `PersistentVolumeClaim`, then
mount them into the container by specifying the `pod.volumes` and `pod.volumeMounts` parameters, or by specifying your `PersistentVolumeClaim` using `sharedStorage.name` and `sharedStorage.mount`.
* If you cannot use a `PersistentVolume` to properly mount your data directory, mount your data in the container
by using a regular [Kubernetes Volume](https://kubernetes.io/docs/concepts/storage/volumes), specified in `pod.volumes` and `pod.volumeMounts`.
{{ template "rstudio.licensing" . }}
## Database
Connect requires a PostgreSQL database when running in Kubernetes. You must configure a [valid connection URI and a password](https://docs.posit.co/connect/admin/database/postgres/) for the product to function correctly. Both the connection URI and password may be specified in the `config` section of `values.yaml`. However, we recommend only adding the connection URI and putting the database password in a Kubernetes `Secret`, which can be [automatically set as an environment variable](#database-password).
### Database configuration
Add the following to your `values.yaml`, replacing the `URL` with your database details.
```yaml
config:
Database:
Provider: "Postgres"
Postgres:
URL: "postgres://<USERNAME>@<HOST>:<PORT>/<DATABASE>"
```
### Database password
First, create a `Secret` declaratively with YAML or imperatively using the following command (replacing with your actual password):
```bash
kubectl create secret generic {{ .Name }}-database --from-literal=password=YOURPASSWORDHERE
```
Second, specify the following in your `values.yaml`:
```yaml
pod:
env:
- name: CONNECT_POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: {{ .Name }}-database
key: password
```
Alternatively, database passwords may be set during `helm install` with the following argument:
`--set config.Postgres.Password="<YOUR_PASSWORD_HERE>"`
## General principles
- In most places, we opt to pass Helm values over configmaps. We translate these into the valid `.gcfg` file format
required by {{ template "chart.name" . }}.
- {{ template "chart.name" . }} does not export many prometheus metrics on its own. Instead, we run a sidecar graphite exporter
[as described here](https://support.rstudio.com/hc/en-us/articles/360044800273-Monitoring-RStudio-Team-Using-Prometheus-and-Graphite)
## Configuration file
The configuration values all take the form of usual Helm values
so you can set the database password with something like:
```{.bash}
... --set config.Postgres.Password=mypassword ...
```
The Helm `config` values are converted into the `rstudio-connect.gcfg` service configuration file via go-templating.
{{ template "chart.valuesSection" . }}
{{ template "helm-docs.versionFooter" . }}