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