Skip to main content
NetApp Knowledge Base

Trident - Kyverno Policy Blocking Trident PV Creation Due to Restricted StorageClass

Views:
41
Visibility:
Public
Votes:
0
Category:
trident-kubernetes
Specialty:
SNAPX
Last Updated:

Applies to

  • Trident
  • Kubernetes - k8s

Issue

Trident fails to create PersistentVolumes (PVs) in Kubernetes when a Kyverno policy restricts the allowed storageClass. This results in PersistentVolumeClaims (PVCs) remaining in a Pending state, even though the volume is successfully created in Azure NetApp Files (ANF).

Trident logs:

1 request.go:1212] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"admission webhook \"validate.kyverno.svc-fail\" denied the request: \n\nresource PersistentVolume//pvc-946f4b1c-fe5f-418f-b178-f066cf73b0b1 was blocked due to the following policies \n\nrestrict-allowed-storageclasses:\n  restrict-pv-storageclass: 'validation error: PVs must use storageClassName ''<sc name>''\n    or ''<sc name>''. rule restrict-pv-storageclass failed at path /spec/storageClassName/'\n","code":400}
1 volume_store.go:144] error saving volume pvc-946f4b1c-fe5f-418f-b178-f066cf73b0b1: admission webhook "validate.kyverno.svc-fail" denied the request:

 

 

Sign in to view the entire content of this KB article.

New to NetApp?

Learn more about our award-winning Support

NetApp provides no representations or warranties regarding the accuracy or reliability or serviceability of any information or recommendations provided in this publication or with respect to any results that may be obtained by the use of the information or observance of any recommendations provided herein. The information in this document is distributed AS IS and the use of this information or the implementation of any recommendations or techniques herein is a customer's responsibility and depends on the customer's ability to evaluate and integrate them into the customer's operational environment. This document and the information contained herein may be used solely in connection with the NetApp products discussed in this document.