Skip to content

Commit 2f17d1a

Browse files
committed
upgrade chart to support multiple replicas
1 parent 291327a commit 2f17d1a

File tree

6 files changed

+37
-14
lines changed

6 files changed

+37
-14
lines changed

chart/Chart.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ apiVersion: v2
22
name: briefer
33
description: The helm chart for Briefer's open-source version.
44
type: application
5-
version: 0.1.3
6-
appVersion: '0.1.3'
5+
version: 0.1.4
6+
appVersion: '0.1.4'

chart/templates/ai-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ metadata:
88
app.kubernetes.io/name: briefer
99
app.kubernetes.io/component: ai
1010
spec:
11-
replicas: 1
11+
replicas: {{ .Values.ai.replicaCount | default 1 }}
1212
selector:
1313
matchLabels:
1414
app.kubernetes.io/name: briefer

chart/templates/api-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
app.kubernetes.io/name: briefer
88
app.kubernetes.io/component: api
99
spec:
10-
replicas: 1
10+
replicas: {{ .Values.api.replicaCount | default 1 }}
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: briefer

chart/templates/web-deployment.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
app.kubernetes.io/name: briefer
88
app.kubernetes.io/component: web
99
spec:
10-
replicas: 1
10+
replicas: {{ .Values.web.replicaCount | default 1 }}
1111
selector:
1212
matchLabels:
1313
app.kubernetes.io/name: briefer

chart/values.yaml

+8-4
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ enableLocalPostgres: true
33

44
ai:
55
enabled: true
6+
replicaCount: 1
67

78
image:
89
repository: docker.io
910
name: briefercloud/briefer-ai
10-
tag: v0.0.42
11+
tag: v0.0.65
1112
pullPolicy: Always
1213

1314
resources:
@@ -42,10 +43,11 @@ ai:
4243
# effect: 'NoSchedule'
4344

4445
web:
46+
replicaCount: 1
4547
image:
4648
repository: docker.io
4749
name: briefercloud/briefer-web
48-
tag: v0.0.42
50+
tag: v0.0.65
4951
pullPolicy: Always
5052

5153
# optional
@@ -74,10 +76,12 @@ web:
7476
# effect: 'NoSchedule'
7577

7678
api:
79+
replicaCount: 1
80+
7781
image:
7882
repository: docker.io
7983
name: briefercloud/briefer-api
80-
tag: v0.0.42
84+
tag: v0.0.65
8185
pullPolicy: Always
8286

8387
resources:
@@ -148,7 +152,7 @@ jupyter:
148152
image:
149153
repository: docker.io
150154
name: briefercloud/briefer-jupyter
151-
tag: v0.0.42
155+
tag: v0.0.65
152156
pullPolicy: Always
153157

154158
# tolerations:

docs/deployment/kubernetes.mdx

+24-5
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,11 @@ Using Briefer's Helm chart is the easiest way of setting up Briefer on your Kube
5252
Feel free to change the namespace if you want to. If you're using an existing namespace, please remove the `--create-namespace` flag.
5353
4. After installing Briefer's Helm chart, you can confirm that the manifests have been applied by listing all the pods in the chart's target namespace (usually `kubectl get pods -n briefer`).
5454
<Note>
55-
If you're running a Postgres instance within your cluster, it might be that
56-
the API will be ready before the Postgres instance is up. In that case,
57-
you'll see that the API pod will keep restarting for a few minutes. That's
58-
_normal_. It happens because the API needs to connect to the database to
59-
start, so it'll just keep trying to start until Postgres is ready.
55+
If you're running a Postgres instance within your cluster, it might be that
56+
the API will be ready before the Postgres instance is up. In that case,
57+
you'll see that the API pod will keep restarting for a few minutes. That's
58+
_normal_. It happens because the API needs to connect to the database to
59+
start, so it'll just keep trying to start until Postgres is ready.
6060
</Note>
6161
5. Create the necessary `Ingress` resources so that you can access Briefer's API and Web containers.
6262
Make sure to use the same URLs you've configured in step 2.
@@ -105,6 +105,25 @@ api:
105105
postgresPassword: password
106106
```
107107

108+
### Using more than one replica for Briefers' services
109+
110+
If you want to use more than one replica for Briefer's services, you must set the `replicas` for each service in your `values.yaml` file.
111+
112+
After doing that, make sure to enable sticky sessions in your `Ingress` resources. Without sticky sessions (also known as Session Affinity), Briefer will not work correctly when using multiple replicas.
113+
114+
If you're using NGINX as your Ingress controller, you can enable sticky sessions by adding the annotations below to your `Ingress` resources, for example.
115+
116+
```yaml
117+
nginx.ingress.kubernetes.io/affinity: 'cookie'
118+
nginx.ingress.kubernetes.io/session-cookie-name: 'http-cookie'
119+
nginx.ingress.kubernetes.io/session-cookie-expires: '172800'
120+
nginx.ingress.kubernetes.io/session-cookie-max-age: '172800'
121+
```
122+
123+
<Note>
124+
It's not necessary to use sticky sessions if you're using only one replica.
125+
</Note>
126+
108127
### Configuring pod sizes
109128

110129
We recommend that you explicitly configure the size of your `jupyter` pod so that it has enough memory and vCPUs to run your analyses.

0 commit comments

Comments
 (0)