无法提取托管在AKS上的弹性搜索集群传输层的证书



我有一个在Azure AKS上运行的弹性搜索集群。我想连接到在单独的AKS上运行的另一个es集群,为此我需要从一个集群导出证书并将其添加到另一个集群。我在这里遵循官方文件。然而,我无法导出证书,并在执行以下命令时出错:

kubectl获取机密europecluster es传输证书public-ogo template="{{index.data"ca.crt"}}">

我得到的错误是:

error: error parsing template {{index .data ca.crt}}, template: output:1: function "ca" not defined

我是弹性和kubernetes空间的新手,无法在互联网上找到解决方案。

如果您可以手动提取ca.crt值并对其进行解码,那么您可以尝试以下操作:

  1. 提取不带引号的ca.crt值[复制到剪贴板]

kubectl get secret europecluster-es-transport-certs-public | grep ca.crt

  1. 执行base64解码并将其重定向到文件

echo -n <paste clipboard content> | base64 -d -w 0 > remote.ca.crt

上述过程执行的操作和go模板在命令中执行的操作相同。

示例:

kubectl get secret default-token-h8w57 -o json | grep -i ca.crt
"ca.crt": "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUM1ekNDQWMrZ0F3SUJBZ0lCQURBTkJna3Foa2lHOXcwQkFRc0ZBREFWTVJNd0VRWURWUVFERXdwcmRXSmwKY201bGRHVnpNQjRYRFRJd01UQXlPVEV4TkRVeU9Gb1hEVE13TVRBeU56RXhORFV5T0Zvd0ZURVRNQkVHQTFVRQpBeE1LYTNWaVpYSnVaWFJsY3pDQ0FTSXdEUVlKS29aSWh2Y05BUUVCQlFBRGdnRVBBRENDQVFvQ2dnRUJBTEl4CmpjMCttcGVXWm5TL3NnenloZ1Ftd1ZaN3A1b2hoUktqY0gvNkVIbDBRbzljOTkyZVBTcmEzNEU0cHpmZXRBUE8Kdm1Ia0Q2Z0dCb1FyVUI3NHFMOFZpaUs4c0hZQXcyWElxMERTZHhHb3VqcUVabUM4SnpSK3gxVE1CaUZ2YUR4dQpaZVpTT3JTc1R2dGN6TjNnMG5XK0xPY1Q2UCtGQlRLbzh1RXBjbXY5cll1ZytOR25xZ0l3L0VNRXlQenM4RGk1CkhzYV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