Started building a EKS Cluster and finished Linux part of it. Now working on Windows worker nodes and having issues with using EBS volume. As per the k8’s documentation it supports only one Node which is in the same region as the EBS. For me the manifest worked once and later it’s giving me an error to provision the pods. I have tried hard coding the Volume ID of my EBS volume and I can only provision on pod on that and the remaining not able to mount on to that Volume As its already been used. There is a very little documentation for Windows. Any suggestion here please if possible. For more info see my deployment manifest. I have done a Dynamic PV provisioning using SC, PVC.
Error: Events:
Type Reason Age From Message
Normal Scheduled 80s default-scheduler Successfully assigned default/windows-server-iis-8f8ff79cd-8xjkt to ip-10-57-38-27.eu-west-1.compute.internal
Normal SuccessfulAttachVolume 76s attachdetach-controller AttachVolume.Attach succeeded for volume “pvc-b039c176-97f3-40dd-bb55-17aa0ab1aba4”
Warning FailedMount 18s (x7 over 68s) kubelet, ip-10-57-38-27.eu-west-1.compute.internal MountVolume.MountDevice failed for volume “pvc-b039c176-97f3-40dd-bb55-17aa0ab1aba4” : diskMount: format disk failed, error: exit status 1, output: “Format-Volume : Cannot validate argument on parameter ‘FileSystem’. The argument “ext4” does not belong to the set \r\n"FAT,FAT32,exFAT,NTFS,ReFS” specified by the ValidateSet attribute. Supply an argument that is in the set and then try \r\nthe command again.\r\nAt line:1 char:180\r\n+ … nDriveLetter -UseMaximumSize | Format-Volume -FileSystem ext4 -Confir …\r\n+ ~~~~\r\n + CategoryInfo : InvalidData: ( [Format-Volume], ParameterBindingValidationException\r\n + FullyQualifiedErrorId : ParameterArgumentValidationError,Format-Volume\r\n \r\n"
Manifests:
apiVersion: apps/v1
kind: Deployment
metadata:
name: windows-server-iis
spec:
selector:
matchLabels:
app: windows-server-iis
tier: backend
track: stable
replicas: 1
template:
metadata:
labels:
app: windows-server-iis
tier: backend
track: stable
spec:
containers:
- name: windows-test1
image: mcr.microsoft.com/windows/servercore:1809
ports:
- name: http
containerPort: 80
imagePullPolicy: IfNotPresent
command:
- powershell.exe
- -command
- "Add-WindowsFeature Web-Server; Invoke-WebRequest -UseBasicParsing -Uri ‘https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.6/ServiceMonitor.exe’ -OutFile ‘C:\ServiceMonitor.exe’; echo ‘
Hello EKS!!!
’ > C:\inetpub\wwwroot\default.html; C:\ServiceMonitor.exe ‘w3svc’; "
volumeMounts:
- name: persistent-storage
mountPath: /data
nodeSelector:
kubernetes.io/os: windows
volumes:
- name: persistent-storage
persistentVolumeClaim:
claimName: pvc-ebs-claim
If I hard code the Volume ID I can only deploy one pod only. then after this volume is not free to be used by the other pods or replicas of already running pod.
volumeMounts:
- name: persistent-storage
mountPath: /data
nodeSelector:
kubernetes.io/os: windows
volumes:
- name: persistent-storage
awsElasticBlockStore:
volumeID: vol-xxxxxxxxxxxxxxxxxxxx
fsType: ntfs