kubernetes: error: Unexpected args: [secret]

From the documents of secrets, they guide me to usekubectl create secret ... to create a secret. But after I executed, an error occurred as in the title.

Why this subcommand not work for my environment? my version:

kubectl version
Client Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"86327329213fed4af2661c5ae1e92f9956b24f55", GitTreeState:"clean"}
Server Version: version.Info{Major:"1", Minor:"2", GitVersion:"v1.2.0", GitCommit:"86327329213fed4af2661c5ae1e92f9956b24f55", GitTreeState:"clean"}

Do I need to manually open this sub command and where? I think the official docs tells too less about this.

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 15 (7 by maintainers)

Commits related to this issue

Most upvoted comments

I ran into this as well and think it’s an issue with the centOS version. Looks like it is based off an early 1.2 alpha commit (4c8e6f47ec23f390978e651232b375f5f9cde3c7): https://git.centos.org/blob/rpms!kubernetes/38ffc8b018faa981944ba2a20897f54512917e90/SPECS!kubernetes.spec#L35

For others, support levels and owners for various platforms are documented here: http://kubernetes.io/docs/getting-started-guides/

This sounds like a problem with the CentOS package, not with our release itself. That’s not 1.2.0. It’s an alpha release.

@coolsvap, any idea how we could get the CentOS package updated?

@bgrant0607 @janetkuo Could you please take a look at this, and reactivate if necessary.

@saad-ali Are you sure? could you please confirm if it is a bug … I have the same problem, it does not works with docker-registry

> kubectl create secret docker-registry gary --docker-username="gary" --docker-password="gary" --docker-email="gary@gary.com" --docker-server="registry.gary.local"
> Error: unknown flag: --docker-username
> .... help info

You need to specify subcommand generic or docker-registry. See http://kubernetes.io/docs/user-guide/kubectl/kubectl_create_secret/

For example: kubectl create secret generic my-secret --from-literal=key1=supersecret

In the future, please post support questions to stackoverflow.

We are trying to consolidate the channels to which questions for help/support are posted so that we can improve our efficiency in responding to your requests, and to make it easier for you to find answers to frequently asked questions and how to address common use cases.

We regularly see messages posted in multiple forums, with the full response thread only in one place or, worse, spread across multiple forums. Also, the large volume of support issues on github is making it difficult for us to use issues to identify real bugs.

The Kubernetes team scans stackoverflow on a regular basis, and will try to ensure your questions don’t go unanswered.

Before posting a new question, please search stackoverflow for answers to similar questions, and also familiarize yourself with:

Again, thanks for using Kubernetes.

The Kubernetes Team