Skip to content

Commit 18bb32d

Browse files
committed
Add documentation for storage and persistence for Kubernetes
1 parent f3bd07b commit 18bb32d

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

src/content/docs/aws/enterprise/kubernetes/concepts.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ In a Kubernetes deployment:
9191

9292
This enables applications running in Kubernetes to interact with LocalStack using standard AWS SDK endpoint resolution without additional configuration.
9393

94+
## Storage
95+
96+
LocalStack can store data that persists across sessions, such as data that can be used for [local persistence](https://docs.localstack.cloud/aws/capabilities/state-management/persistence/) or caching downloaded resources between sessions. See the [LocalStack volume](/aws/capabilities/config/filesystem/#localstack-volume) page for more information.
97+
98+
This volume directory can be created in Kubernetes using a [Persistent Volume](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) and associated [Persistent Volume Claim](https://kubernetes.io/docs/concepts/storage/persistent-volumes/#persistentvolumeclaims). This volume should be mounted into the pod at `/var/lib/localstack` to persist LocalStack state. See the [Operator](/aws/enterprise/kubernetes/kubernetes-operator/) and [Helm Chart](/aws/enterprise/kubernetes/deploy-helm-chart) documentation for specific details.
9499

95100
## Choose execution mode
96101

src/content/docs/aws/enterprise/kubernetes/deploy-helm-chart.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,10 @@ persistence:
157157
This is especially useful for workflows where you seed resources or rely on state across restarts.
158158
:::
159159

160+
This performs these two changes:
161+
* sets `PERSISTENCE=1`, and
162+
* creates a psrsistent volume claim for the (customizable) storage class.
163+
160164

161165
### Set Pod resource requests and limits
162166

src/content/docs/aws/enterprise/kubernetes/kubernetes-operator.md

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,35 @@ curl http://1d4b6907.execute-api.localstack-localstack.my-namespace:4566/json
223223

224224
This works without additional DNS configuration in client applications.
225225

226+
## Storage
227+
228+
:::note
229+
Requires Operator version 0.4.0 or later.
230+
:::
231+
232+
To persist the [LocalStack volume](/aws/capabilities/config/filesystem/#localstack-volume), use the `spec.pvcName` to specify the PVC you want to mount. This automatically mounts the PVC at `/var/lib/localstack`.
233+
234+
For example:
235+
236+
```yaml
237+
# pvc definition
238+
apiVersion: v1
239+
kind: PersistentVolumeClaim
240+
metadata:
241+
name: myPvc
242+
spec:
243+
# ...
244+
245+
# LocalStack instance definition
246+
apiVersion: api.localstack.cloud/v1alpha1
247+
kind: LocalStack
248+
metadata:
249+
name: localstack
250+
namespace: my-namespace
251+
spec:
252+
# ...
253+
pvcName: myPvc
254+
```
226255

227256
## Update
228257

@@ -261,4 +290,4 @@ Ensure that:
261290
* Each LocalStack instance requires its **own auth token**
262291
* The Operator supports **LocalStack Pro images only**
263292
* DNS integration and Cloud Pod automation are Operator-exclusive features
264-
:::
293+
:::

0 commit comments

Comments
 (0)