Kubectl apply -f mongo-secret.yaml 没有在我的配置文件中创建秘密

Kubectl apply -f mongo-secret.yaml is not creating the secret inside my config file

当我运行下面的命令时,

Kubectl apply -f mongo-secret.yaml 

我抛出以下错误,

下面是我使用的Secret配置,

apiVersion: v1
kind: secret
metadata:
  name: mongodb-secret
type: opaque
data:
  mongo-root-username: dXNlcm5hbWU=
  mongo-root-password: cGFzc3dvcmQ=

kind 字段中使用 Secret 而不是 secret

apiVersion: v1
kind: Secret
metadata:
  name: mongodb-secret
type: opaque
data:
  mongo-root-username: dXNlcm5hbWU=
  mongo-root-password: cGFzc3dvcmQ=