如何从备份文件还原kubernetes configmap

时间:2019-08-01 22:19:28

标签: kubernetes kubectl

我正在处理一些用于修改configmap的脚本,但是在进行这些工作时,我需要一种从备份还原configmap的方法。在我的脚本中,我首先将configmap写到一个文件中,以防修改无法正常工作,目前是这种情况。

我基本上只是在这样做:

cat /tmp/tmpfile | kubectl replace <configmapname> -f -".

但是,此操作失败并显示:

Error from server (Conflict): error when replacing "STDIN": Operation cannot be fulfilled on configmaps "<configmapname>": the object has been modified; please apply your changes to the latest version and try again"

我不明白我在这里需要做什么。

0 个答案:

没有答案