From 1f3d8c8e2dadea254046bc7db29c4608d2561643 Mon Sep 17 00:00:00 2001 From: iProbe Date: Wed, 6 Mar 2024 15:58:15 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20CloudNative/Kubernetes/Bas?= =?UTF-8?q?e/=E5=88=9B=E5=BB=BAconfigmap=E6=A0=BC=E5=BC=8F=E5=BC=82?= =?UTF-8?q?=E5=B8=B8=E9=97=AE=E9=A2=98.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CloudNative/Kubernetes/Base/创建configmap格式异常问题.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 CloudNative/Kubernetes/Base/创建configmap格式异常问题.md diff --git a/CloudNative/Kubernetes/Base/创建configmap格式异常问题.md b/CloudNative/Kubernetes/Base/创建configmap格式异常问题.md new file mode 100644 index 0000000..22584ec --- /dev/null +++ b/CloudNative/Kubernetes/Base/创建configmap格式异常问题.md @@ -0,0 +1,7 @@ +可能是由于配置文件(如nginx.conf)文件自身存在制表符TAB或者尾随空格,Kubernetes ConfigMap在load过程中发现文件中包含tab缩进,直接转化为\n\t。 +```shell +# 使用以下方法删除尾随空格 +sed -i -E 's/[[:space:]]+$//g' file.txt +# 使用空格替换制表符 +sed -i 's/\t/ /g' file.txt +``` \ No newline at end of file