From c15b498feee7f9b7eda1dcb4a848f33ec16e54c6 Mon Sep 17 00:00:00 2001 From: Karthik Basavaraj Date: Mon, 26 Apr 2021 22:52:36 -0400 Subject: [PATCH] Add x-AZ support --- Dockerfile | 2 +- pkg/driver/efs_watch_dog.go | 22 +++++++++++++++++++--- pkg/driver/efs_watch_dog_test.go | 18 +++++++++++++++++- 3 files changed, 37 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index f986958f0..3dcc84a93 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,7 +32,7 @@ ENV EFS_CLIENT_SOURCE=$client_source RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} make aws-efs-csi-driver FROM amazonlinux:2.0.20210219.0 -RUN yum install amazon-efs-utils-1.28.2-1.amzn2.noarch -y +RUN yum install amazon-efs-utils-1.30.1-1.amzn2.noarch -y # At image build time, static files installed by efs-utils in the config directory, i.e. CAs file, need # to be saved in another place so that the other stateful files created at runtime, i.e. private key for diff --git a/pkg/driver/efs_watch_dog.go b/pkg/driver/efs_watch_dog.go index d4f42900c..94dd082d5 100644 --- a/pkg/driver/efs_watch_dog.go +++ b/pkg/driver/efs_watch_dog.go @@ -26,9 +26,17 @@ import ( "k8s.io/klog" ) -// https://github.com/aws/efs-utils/blob/v1.28.2/dist/efs-utils.conf +// https://github.com/aws/efs-utils/blob/v1.30.2/dist/efs-utils.conf const ( efsUtilsConfigTemplate = ` +# +# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. +# +# Licensed under the MIT License. See the LICENSE accompanying this file +# for the specific language governing permissions and limitations under +# the License. +# + [DEFAULT] logging_level = INFO logging_max_bytes = 1048576 @@ -37,7 +45,7 @@ logging_file_count = 10 state_file_dir_mode = 750 [mount] -dns_name_format = {fs_id}.efs.{region}.{dns_name_suffix} +dns_name_format = {az}.{fs_id}.efs.{region}.{dns_name_suffix} dns_name_suffix = amazonaws.com #The region of the file system when mounting from on-premises or cross region. {{if .Region -}} @@ -60,17 +68,25 @@ stunnel_check_cert_validity = false port_range_lower_bound = 20049 port_range_upper_bound = 20449 +# Optimize read_ahead_kb for Linux 5.4+ +optimize_readahead = true + + [mount.cn-north-1] dns_name_suffix = amazonaws.com.cn + [mount.cn-northwest-1] dns_name_suffix = amazonaws.com.cn + [mount.us-iso-east-1] dns_name_suffix = c2s.ic.gov +stunnel_cafile = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem [mount.us-isob-east-1] dns_name_suffix = sc2s.sgov.gov +stunnel_cafile = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem [mount-watchdog] enabled = true @@ -248,7 +264,7 @@ func (w *execWatchdog) runLoop(stopCh <-chan struct{}) { for { select { case <-stopCh: - klog.Info("stopping...") + //klog.Info("stopping...") break default: err := w.exec() diff --git a/pkg/driver/efs_watch_dog_test.go b/pkg/driver/efs_watch_dog_test.go index 0f0c60620..49b523ba2 100644 --- a/pkg/driver/efs_watch_dog_test.go +++ b/pkg/driver/efs_watch_dog_test.go @@ -23,6 +23,14 @@ import ( const ( expectedEfsUtilsConfig = ` +# +# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved. +# +# Licensed under the MIT License. See the LICENSE accompanying this file +# for the specific language governing permissions and limitations under +# the License. +# + [DEFAULT] logging_level = INFO logging_max_bytes = 1048576 @@ -31,7 +39,7 @@ logging_file_count = 10 state_file_dir_mode = 750 [mount] -dns_name_format = {fs_id}.efs.{region}.{dns_name_suffix} +dns_name_format = {az}.{fs_id}.efs.{region}.{dns_name_suffix} dns_name_suffix = amazonaws.com #The region of the file system when mounting from on-premises or cross region. #region = us-east-1 @@ -50,17 +58,25 @@ stunnel_check_cert_validity = false port_range_lower_bound = 20049 port_range_upper_bound = 20449 +# Optimize read_ahead_kb for Linux 5.4+ +optimize_readahead = true + + [mount.cn-north-1] dns_name_suffix = amazonaws.com.cn + [mount.cn-northwest-1] dns_name_suffix = amazonaws.com.cn + [mount.us-iso-east-1] dns_name_suffix = c2s.ic.gov +stunnel_cafile = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem [mount.us-isob-east-1] dns_name_suffix = sc2s.sgov.gov +stunnel_cafile = /etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem [mount-watchdog] enabled = true