Forum Discussion
Error disk deploy pod on K8S Azure
Hello All,
I have a problem with deploy my application on Azure K8S.
I created a disk from my snapshot and new PVC:
apiVersion: v1
kind: PersistentVolume
metadata:
name: rabbitmq-disk2
spec:
capacity:
storage: 5Gi
storageClassName: default
azureDisk:
kind: Managed
diskName: rabbitmq-disk2
diskURI: /subscriptions/<subscription-azure>/MC_spaceballs-k8sgrp_spaceballs-k8s_southcentralus/providers/Microsoft.Compute/disks/rabbitmq-disk2
fsType: ext4
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
claimRef:
name: rabbitmq-pv-claim-rabbitmq-0
namespace: rabbitmq
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rabbitmq-pv-claim-rabbitmq-0
annotations:
volume.beta.kubernetes.io/storage-class: default
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 5Gi
storageClassName: default
and It seems to be ok:
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
rabbitmq-pv-claim-rabbitmq-0 Bound rabbitmq-disk2 5Gi RWO default 3m22s
my personal values.yaml:
persistence:
ExistingClaim: rabbitmq-pv-claim-rabbitmq-0
But my pod never coming up, I seen this error on event log:
$ kubectl get event
LAST SEEN TYPE REASON OBJECT MESSAGE
93s Normal Scheduled pod/rabbitmq-0 Successfully assigned rabbitmq/rabbitmq-0 to aks-agentpool2-13329960-vmss000002
94s Warning FailedMount pod/rabbitmq-0 MountVolume.SetUp failed for volume "tls-volume" : secret "rabbitmq-tls" not found
29s Warning FailedAttachVolume pod/rabbitmq-0 AttachVolume.Attach failed for volume "rabbitmq-disk2" : Retriable: false,RetryAfter: 0s, HTTPStatusCode: 400, RawError: Retriable: false, RetryAfter: 0s, HTTPStatusCode: 400, RawError: {
"error": {
"code": "BadRequest",
"message": "Disk /subscriptions/<subscription-azure>/resourceGroups/MC_spaceballs-k8sgrp_spaceballs-k8s_southcentralus/providers/Microsoft.Compute/disks/rabbitmq-disk2 cannot be attached to the VM because it is not in the same zone as the VM. VM zone: '3'. Disk zone: '1'."
}
}
94s Normal CertificateIssued certificaterequest/rabbitmq-1138353933 Certificate fetched from issuer successfully
94s Normal SuccessfulCreate statefulset/rabbitmq create Pod rabbitmq-0 in StatefulSet rabbitmq successful
94s Normal GeneratedKey certificate/rabbitmq Generated a new private key
94s Normal Requested certificate/rabbitmq Created new CertificateRequest resource "rabbitmq-1138353933"
94s Normal Issued certificate/rabbitmq Certificate issued successfully
$ kubectl get nodes -o custom-columns=NAME:'{.metadata.name}',REGION:'{.metadata.labels.topology\.kubernetes\.io/region}',ZONE:'{metadata.labels.topology\.kubernetes\.io/zone}'
NAME REGION ZONE
aks-agentpool2-13329960-vmss000000 southcentralus southcentralus-1
aks-agentpool2-13329960-vmss000001 southcentralus southcentralus-2
aks-agentpool2-13329960-vmss000002 southcentralus southcentralus-3
I don't understand ...why I cannot attach this PVC???
Thanks a lot
Cecilia