forked from PrefectHQ/prefect-helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md.gotmpl
117 lines (86 loc) · 3.95 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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{{ template "chart.header" . }}
{{ template "chart.description" . }}
{{ template "chart.homepageLine" . }}
## Installing the Chart
To install the chart with the release name `prefect-server`:
```console
helm repo add prefect https://prefecthq.github.io/prefect-helm
helm install prefect-server prefect/prefect-server
```
## Prefect Configuration
### Container Port // Port Forwarding
Without making any modifications to the `values.yaml` file, you can access the Prefect UI by port forwarding either the Server `pod` or `service` with the following command and visiting [http:localhost:4200](http:localhost:4200):
```console
kubectl port-forward svc/prefect-server 4200:4200
```
Note: If you choose to make modifications to either the `server.prefectApiUrl` or `service.port`, make sure to update the other value with the updated port!
## PostgreSQL Configuration
### Handling Connection Secrets
#### Using the bundled PostgreSQL chart
By default, Bitnami's PostgreSQL Helm Chart will be deployed. This is **not intended for production use**, and is only
included to provide a functional proof of concept installation.
In this scenario, you'll need to provide _either one_ of the following fields:
1. `postgresql.auth.password`: a password you want to set for the prefect user (default: `prefect-rocks`)
2. `postgresql.auth.existingSecret`: name of an existing secret in your cluster with the following field:
- `connection-string`: fully-quallified connection string in the format of `postgresql+asyncpg://{username}:{password}@{hostname}/{database}`
- username = `postgresql.auth.username`
- hostname = `<release-name>-postgresql.<release-namespace>:<postgresql.containerPorts.postgresql>`
- database = `postgresql.auth.database`
Two secrets are created when not providing an existing secret name:
1. `prefect-server-postgresql-connection`: used by the prefect-server deployment to connect to the postgresql database.
2. `<release-name>-postgresql-0`: defines the `postgresql.auth.username`'s password on the postgresql server to allow successful authentication from the prefect server.
#### Using an external instance of PostgreSQL
If you want to disable the bundled PostgreSQL chart and use an external instance, provide the following configuration:
```yaml
prefect-server:
postgresql:
enabled: false
secret:
# Option 1: provide the name of an existing secret following the instructions above.
create: false
name: <existing secret name>
# Option 2: provide the connection string details directly
create: true
username: myuser
password: mypass
host: myhost.com
port: 1234
database: mydb
```
### Connecting with SSL configured
1. Mount the relevant certificate to `/home/prefect/.postgresql` so that it can be found by `asyncpg`. This is the default location postgresql expects per their [documentation](https://www.postgresql.org/docs/current/libpq-ssl.html).
```yaml
prefect-server:
server:
extraVolumes:
- name: db-ssl-secret
secret:
secretName: db-ssl-secret
defaultMode: 384
extraVolumeMounts:
- name: db-ssl-secret
mountPath: "/home/prefect/.postgresql"
readOnly: true
postgresql:
enabled: false
auth:
existingSecret: external-db-connection-string
```
2. Create a secret to hold the ca certificate for the database with the key `root.crt`
```yaml
apiVersion: v1
kind: Secret
metadata:
name: db-ssl-secret
data:
root.crt: BASE64ENCODECERTIFICATE=
type: Opaque
```
3. Set the connection string in the existing secret following this format - `?ssl=verify-ca` is cruicial:
```
postgresql+asyncpg://{username}:{password}@{hostname}/{database}?ssl=verify-ca
```
{{ template "chart.maintainersSection" . }}
{{ template "chart.requirementsSection" . }}
{{ template "chart.valuesSection" . }}
{{ template "helm-docs.versionFooter" . }}