diff --git a/config/nav.yml b/config/nav.yml index aa52e2c9ac..e13a7c2f4b 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -131,6 +131,7 @@ nav: # TODO: Add security section to docs? - Configure resource requests and limits: serving/services/configure-requests-limits-services.md - HTTPS redirection: serving/services/http-protocol.md + - Volume Support: serving/services/storage.md - Traffic management: serving/traffic-management.md - Configuring gradual rollout of traffic to Revisions: serving/rolling-out-latest-revision.md - Tag resolution: serving/tag-resolution.md diff --git a/docs/serving/services/storage.md b/docs/serving/services/storage.md new file mode 100644 index 0000000000..e7546e3ec0 --- /dev/null +++ b/docs/serving/services/storage.md @@ -0,0 +1,40 @@ +# Volume Support for Knative services + +By default Serving supports the mounting the [volume types](https://kubernetes.io/docs/concepts/storage/volumes): `emptyDir`, `secret`, `configMap` and `projected`. [PersistentVolumes](https://kubernetes.io/docs/concepts/storage/persistent-volumes/) are supported but require a [feature flag](../configuration/feature-flags.md) to be enabled. + +!!! warning + Mounting large volumes may add considerable overhead to the application's start up time. + + +Here is an example of using a persistent volume claim with a Knative Service: + +```yaml +apiVersion: serving.knative.dev/v1 +kind: Service +... +spec: + template: + spec: + containers: + ... + volumeMounts: + - mountPath: /data + name: mydata + readOnly: false + volumes: + - name: mydata + persistentVolumeClaim: + claimName: knative-pv-claim + readOnly: false +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: knative-pv-claim +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 1Gi +```