【问题标题】:Kubernetes Error: unknown flag: --export errorKubernetes 错误:未知标志:--export 错误
【发布时间】:2021-09-21 16:47:22
【问题描述】:

unknown flag: --export while copying secret from one namespace to another kubectl

我用上述解决方案解决了我的问题,但我不知道为什么会出现这个错误。

上面的答案说 kubernetes 1.14 导出选项已弃用,在 1.18 上它已被删除,但我使用 1.16。

其次,在 GCP 上,我的集群同时开始发出警告。

为什么我不应该得到这个错误?我看错方向了吗?

【问题讨论】:

标签: kubernetes google-cloud-platform


【解决方案1】:

从 Kubernetes 1.14 开始,--export 已被弃用,该功能在 1.18 中被移除。您可以在不使用 --export 的情况下使用 get -o yaml。例如下面的命令 export secrets config:

kubectl get secret <your secrets> --namespace <your namespace> -o yaml > output.yaml

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-21
    • 1970-01-01
    • 1970-01-01
    • 2022-12-10
    • 1970-01-01
    • 2019-09-01
    相关资源
    最近更新 更多