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

5/18/2019

We are looking for viable option to map external windows file share inside kubernetes+AWS-EKS hosted docker containers and few of the options. Windows file share being in same VPN is accessible with IP address

In absence of anything natively supported by kubernetes esp on EKS, we are trying Flexvolumes along with persistant volume. But that would need installation of cifs drivers on nodes which as I understand EKS does't provide being manages nodes.

Any option which doesn't require node level installation of custom drives including cifs etc?

-- AnilR
amazon-web-services
docker-volume
eks
kubernetes

2 Answers

5/19/2019

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
-- AnilR
Source: StackOverflow

5/18/2019

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

-- jontro
Source: StackOverflow