如何把Kubernetes config view里的base64编码过后的secret信息还原

91 阅读1分钟

需求:

使用脚本将下图高亮的内容还原成base64编码之前的原始值
在这里插入图片描述
解决方案:

kubectl config view --minify --flatten -o json | jq “.clusters[0].cluster.“certificate-authority-data”” | sed -e “s/^”// g" -e “s/”$//g" | base64 -d
在这里插入图片描述