kubernetes: Unable to provide PVC under Azure self-hosted k8s v1.14.7 - InvalidApiVersionParameter - 2018-09-30
What happened:
Unable to provide PVC under Azure self-hosted k8s v1.14.7.
32m Warning ProvisioningFailed PersistentVolumeClaim Failed to provision volume with StorageClass "azure-storage-class": compute.DisksClient#CreateOrUpdate: Failure sending request: StatusCode=0 -- Original Error: Code="InvalidApiVersionParameter" Message="The api-version '2018-09-30' is invalid. The supported versions are '2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."
What you expected to happen:
PVC to be provisioned normally
How to reproduce it (as minimally and precisely as possible):
create the following Storage Class (as per the documentation):
kind: StorageClass apiVersion: storage.k8s.io/v1 metadata: name: slow provisioner: kubernetes.io/azure-disk parameters: skuName: Standard_LRS location: eastus storageAccount: “” resourceGroup: “” fsType: ext4
create the following PVC
apiVersion: v1 kind: PersistentVolumeClaim metadata: annotations: volume.beta.kubernetes.io/storage-provisioner: kubernetes.io/azure-disk finalizers:
- kubernetes.io/pvc-protection name: foo namespace: default spec: accessModes:
- ReadWriteOnce dataSource: null resources: requests: storage: 8Gi storageClassName: slow volumeMode: Filesystem
and then describe pvc foo
Anything else we need to know?:
Environment:
- Kubernetes version (use
kubectl version): 1.14.7 - Cloud provider or hardware configuration: Azure
- OS (e.g:
cat /etc/os-release): Centos 7 - Kernel (e.g.
uname -a): Linux master000000 5.2.4-1.el7.elrepo.x86_64 #1 SMP Sun Jul 28 08:10:57 EDT 2019 x86_64 x86_64 x86_64 GNU/Linux - Install tools: custom
- Network plugin and version (if this is a network-related bug): N/A
- Others: N/A
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 36 (16 by maintainers)
Now I’m pretty sure that the
The api-version '2018-09-30' is invalid.issue is related to missing resourceGroup in the URL. I think KCM is trying to call it as: https://management.azure.com/subscriptions/MY_SUBS_ID/resourceGroups/providers/Microsoft.Compute/disks/MY_DISK_NAME?api-version=2018-09-30so, there is no resource group name in the path after
https://management.azure.com/subscriptions/MY_SUBS_ID_IS_SPECIFIED_HERE/resourceGroups/If I do it manually with curl I got the same error:
{"error":{"code":"InvalidApiVersionParameter","message":"The api-version '2018-09-30' is invalid. The supported versions are '2019-10-01,2019-09-01,2019-08-01,2019-07-01,2019-06-01,2019-05-10,2019-05-01,2019-03-01,2018-11-01,2018-09-01,2018-08-01,2018-07-01,2018-06-01,2018-05-01,2018-02-01,2018-01-01,2017-12-01,2017-08-01,2017-06-01,2017-05-10,2017-05-01,2017-03-01,2016-09-01,2016-07-01,2016-06-01,2016-02-01,2015-11-01,2015-01-01,2014-04-01-preview,2014-04-01,2014-01-01,2013-03-01,2014-02-26,2014-04'."}