error: failed to create secret the server could not find the requested resource (post secrets)

Viewed 16

While creating a secret:

kubectl -n customspace create secret tls localhost.customspace.svc.customspace-tls-pair --cert=certs/webhook.crt --key=certs/webhook.key

I get the error:

error: failed to create secret the server could not find the requested resource (post secrets)

I have checked https://kubernetes.io/releases/version-skew-policy/ but still am getting this error.

$ kubectl version -o=yaml                                                                                                                   
clientVersion:
  buildDate: "2022-09-14T19:49:27Z"
  compiler: gc
  gitCommit: e4d4e1ab7cf1bf15273ef97303551b279f0920a9
  gitTreeState: clean
  gitVersion: v1.25.1
  goVersion: go1.19.1
  major: "1"
  minor: "25"
  platform: linux/amd64
kustomizeVersion: v4.5.7
serverVersion:
  buildDate: "2022-07-13T14:23:26Z"
  compiler: gc
  gitCommit: aef86a93758dc3cb2c658dd9657ab4ad4afc21cb
  gitTreeState: clean
  gitVersion: v1.24.3
  goVersion: go1.18.3
  major: "1"
  minor: "24"
  platform: linux/amd64
$ echo $KUBECONFIG
/home/vyom/.kube/config

Any help will be really appreciated, looked at a lot of similar questions, no luck.

0 Answers
Related