From e10d281b4a13372aa70f95c3e1475e6808323457 Mon Sep 17 00:00:00 2001 From: Stavros Kontopoulos Date: Fri, 16 Jun 2023 14:34:01 +0300 Subject: [PATCH 1/3] add details for storage and knative services --- config/nav.yml | 1 + docs/serving/services/storage.md | 43 ++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 docs/serving/services/storage.md diff --git a/config/nav.yml b/config/nav.yml index aa52e2c9ac..02586afe49 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 + - Configuring storage: 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..79bba382c3 --- /dev/null +++ b/docs/serving/services/storage.md @@ -0,0 +1,43 @@ +# Configuring storage for Knative services + +Knative Serving integrates with K8s storage capabilities via supporting a subset of ephemeral storage volumes and via PersistentVolumeClaims(PVCs) volume types. +In detail Knative Serving supports emptyDir by default, secret, configmap, projection and PVCs volume types. +For more details on volume configuration check the related [feature flags](../configuration/feature-flags.md) when applicable. + +Here is an example of using PVCs: + +```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 +``` + +The example assumes that the user has enabled PVC support via the corresponding feature flag. + +!!! warning + Mounting large volumes may add considerable overhead to the application's start up time. From abfeed1875cca81e4d9a60a94a1d492afd5be9e9 Mon Sep 17 00:00:00 2001 From: Stavros Kontopoulos Date: Wed, 28 Jun 2023 13:00:02 +0300 Subject: [PATCH 2/3] fixes --- config/nav.yml | 2 +- docs/serving/services/storage.md | 17 +++++++---------- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/config/nav.yml b/config/nav.yml index 02586afe49..e13a7c2f4b 100644 --- a/config/nav.yml +++ b/config/nav.yml @@ -131,7 +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 - - Configuring storage: serving/services/storage.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 index 79bba382c3..14068548a3 100644 --- a/docs/serving/services/storage.md +++ b/docs/serving/services/storage.md @@ -1,10 +1,12 @@ -# Configuring storage for Knative services +# Volume Support for Knative services -Knative Serving integrates with K8s storage capabilities via supporting a subset of ephemeral storage volumes and via PersistentVolumeClaims(PVCs) volume types. -In detail Knative Serving supports emptyDir by default, secret, configmap, projection and PVCs volume types. -For more details on volume configuration check the related [feature flags](../configuration/feature-flags.md) when applicable. +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. -Here is an example of using PVCs: +!!! 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 @@ -36,8 +38,3 @@ spec: requests: storage: 1Gi ``` - -The example assumes that the user has enabled PVC support via the corresponding feature flag. - -!!! warning - Mounting large volumes may add considerable overhead to the application's start up time. From 2cc7748de5d7c50827caeb46d3bc4b88f896c834 Mon Sep 17 00:00:00 2001 From: Reto Lehmann Date: Thu, 13 Jul 2023 08:48:31 +0200 Subject: [PATCH 3/3] Update storage.md add missing whitespace --- docs/serving/services/storage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/serving/services/storage.md b/docs/serving/services/storage.md index 14068548a3..e7546e3ec0 100644 --- a/docs/serving/services/storage.md +++ b/docs/serving/services/storage.md @@ -1,6 +1,6 @@ # 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. +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.