Skip to content

Volume Support for Knative services

By default Serving supports the mounting the volume types: emptyDir, secret, configMap and projected. PersistentVolumes are supported but require a feature flag 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:

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
Back to top

We use analytics and cookies to understand site traffic. Information about your use of our site is shared with Google for that purpose. Learn more.

× OK