<p>I am trying to deploy service on <code>eks</code> with <code>knative</code> installed on eks, here eks configured with <code>fargate-profile</code>.
I want to mount <code>efs</code> to my service for that i have created <code>StorageClass</code>,<code>PersistentVolume</code> and <code>PersistentVolumeClaim</code> below are the respective yml</p>
<p><strong>storageclass.yml</strong></p>
<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: my-sc
provisioner: efs.csi.aws.com
parameters:
  provisioningMode: efs-ap
  fileSystemId: fs-1234
  directoryPerms: &quot;775&quot;
reclaimPolicy: Retain
</code></pre>
<p><strong>efs-pv.yml</strong></p>
<pre><code>kind: PersistentVolume
metadata:
  name: my-pv
spec:
  capacity:
    storage: 100Gi
  volumeMode: Filesystem
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  storageClassName: my-sc
  csi:
    driver: efs.csi.aws.com
    volumeHandle: fs-1234
</code></pre>
<p><strong>efs-pvc.yml</strong></p>
<pre><code>kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteMany
  storageClassName: my-sc
  resources:
    requests:
      storage: 100Gi
</code></pre>
<p>all the sc, pv and pvc get created successfully</p>
<p>Now I am trying to use <code>my-pvc</code> in my Service <strong>my-service.yml</strong> like below</p>
<pre><code>apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: myservice
  annotations:
    serving.knative.dev/efs-storage-class: my-sc
spec:
  template:
    spec:
      containers:
        - env:
            - name: key
              value: val
          image: image:latest
          ports:
            - containerPort: 8080
          volumeMounts:
            - mountPath: /app/data
              name: data
              readOnly: true # warning were given for not setting readOnly=true
      volumes:
        - name: data
          persistentVolumeClaim:
            claimName: my-pvc
            readOnly: true
    metadata:
      annotations:
        autoscaling.knative.dev/metric: concurrency
        autoscaling.knative.dev/target: '1'
        autoscaling.knative.dev/minScale: '1'
        autoscaling.knative.dev/maxScale: '5'
        autoscaling.knative.dev/scaleDownDelay: 60s
        autoscaling.knative.dev/window: 600s
</code></pre>
<p>when I try to run following command <code>kubectl apply -f my-service.yml</code> it gives validation error, here the complete error</p>
<p>Error from server (BadRequest): error when creating &quot;my-service.yml&quot;: admission webhook &quot;<strong>validation.webhook.serving.knative.dev</strong>&quot; denied the request: validation failed: <strong>Persistent volume claim support is disabled</strong>, but found persistent volume claim my-pvc:
must not set the field(s): spec.template.spec.volumes[0].persistentVolumeClaim</p>
<p>Error simply means PVC is disabled, in order to use PVC I need to enable PVC.</p>
<p><strong>But How and where(in configMap?)?</strong></p>
<p>in In <a href="https://github.com/knative/serving/releases/download/v0.27.0/serving-core.yaml" rel="nofollow noreferrer">serving-core.yml</a> i found <code>kubernetes.podspec-persistent-volume-claim: &quot;Disabled&quot;</code>
which is example.</p>
<p>So I have tried to add configMap (Just guess) with <code>kubernetes.podspec-persistent-volume-claim</code> like below:</p>
<pre><code>apiVersion: v1
kind: ConfigMap
metadata:
  namespace: knative-serving
  name: kubernetes.podspec-persistent-volume-claim
data:
  kubernetes.podspec-persistent-volume-claim: enabled

</code></pre>
<p>But nothing changed only configmap got created, Any help will be appreciated</p>

Hitesh Ghuge
<p>You need to <a href="https://knative.dev/docs/serving/configuration/feature-flags/#configuring-flags" rel="nofollow noreferrer">set the flag in the <code>config-features</code> ConfigMap</a>.  That ConfigMap should already have one key, named <code>_example</code>.  You'll need to add your key above or below the example.  The <code>_example</code> key is ignored by Knative, but provides a place for documentation for system administrators.</p>
