How to mount external windows file share inside pod hosted on AWS EKS? How to mount external windows file share inside pod hosted on AWS EKS? kubernetes kubernetes

How to mount external windows file share inside pod hosted on AWS EKS?


You could modify the cloudformation stack to install the drivers after startup, see https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/windows-public-preview/amazon-eks-cfn-quickstart-windows.yaml

It references https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/windows-public-preview/amazon-eks-windows-nodegroup.yaml which contains the following powershell startup lines

<powershell>[string]$EKSBinDir = "$env:ProgramFiles\Amazon\EKS"[string]$EKSBootstrapScriptName = 'Start-EKSBootstrap.ps1'[string]$EKSBootstrapScriptFile = "$EKSBinDir\$EKSBootstrapScriptName"[string]$cfn_signal = "$env:ProgramFiles\Amazon\cfn-bootstrap\cfn-signal.exe"& $EKSBootstrapScriptFile -EKSClusterName ${ClusterName} ${BootstrapArguments} 3>&1 4>&1 5>&1 6>&1$LastError = if ($?) { 0 } else { $Error[0].Exception.HResult }& $cfn_signal --exit-code=$LastError `  --stack="${AWS::StackName}" `  --resource="NodeGroup" `  --region=${AWS::Region}</powershell>

Add your custom installation requirements and use this new stack when launching your nodes


We ultimately end up using code approach using SharpCifs.Std for some of the reasons including:

  • Avoid any possible environment configuration issues with involvement of cluster admins esp installing Flexvolume based CIFS drivers across Kubernetes cluster.
  • Code native turned out to be much better control
  • available in with nuget package
  • compatible with .NET Standard 2.x which means .NET Core 2.x
  • File share operations aren't read/write intensive