Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): add cli flags to pass kubeconfig explicitly #10

Merged
merged 1 commit into from
Sep 14, 2020

Conversation

prateekpandey14
Copy link
Member

@prateekpandey14 prateekpandey14 commented Sep 10, 2020

Add kubeconfig and other kubectl cli specific flags in openebs cli commands.
With this changes user can use external kubeconfig via this flag and communicate with kube-apisever.

for example:

kubectl openebs --kubeconfig=/config/admin.kubeconfig cstor volume list

Avaialble flags are:

OpenEBSctl is a kubectl plugin to interact with OpenEBS container Attached Storage components.

Usage:
  kubectl-openebs [command]

Available Commands:
  cStor       Provides operations related to a cStor storage engine
  completion  Outputs shell completion code for the specified shell (bash or zsh)
  help        Help about any command

Flags:
      --as string                      Username to impersonate for the operation
      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --cache-dir string               Default HTTP cache directory (default "/home/prateek/.kube/http-cache")
      --certificate-authority string   Path to a cert file for the certificate authority
      --client-certificate string      Path to a client certificate file for TLS
      --client-key string              Path to a client key file for TLS
      --cluster string                 The name of the kubeconfig cluster to use
      --context string                 The name of the kubeconfig context to use
  -h, --help                           help for kubectl-openebs
      --insecure-skip-tls-verify       If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure
      --kubeconfig string              Path to the kubeconfig file to use for CLI requests.
  -n, --namespace string               If present, the namespace scope for this CLI request
      --request-timeout string         The length of time to wait before giving up on a single server request. Non-zero values should contain a corresponding time unit (e.g. 1s, 2m, 3h). A value of zero means don't timeout requests. (default "0")
  -s, --server string                  The address and port of the Kubernetes API server
      --token string                   Bearer token for authentication to the API server
      --user string                    The name of the kubeconfig user to use

Use "kubectl-openebs [command] --help" for more information about a command.

Signed-off-by: prateekpandey14 prateekpandey14@gmail.com

for example:

kubectl openebs --kubeconfig=/config/admin.kubeconfig

Signed-off-by: prateekpandey14 <prateekpandey14@gmail.com>
Copy link
Member

@shubham14bajpai shubham14bajpai left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@prateekpandey14 prateekpandey14 linked an issue Sep 11, 2020 that may be closed by this pull request
@prateekpandey14 prateekpandey14 merged commit 690e8a8 into openebs:master Sep 14, 2020
@prateekpandey14 prateekpandey14 deleted the add-flags branch September 14, 2020 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add the ability to specify KUBECONFIG variable in openebsctl
2 participants