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: kubectl plugin #645

Closed
wants to merge 2 commits into from
Closed

Conversation

prometherion
Copy link
Member

This is a first implementation of a potential kubectl plugin for Kamaji. Happy to receive suggestions on commands to add, still need to understand how to distribute it, although it can be used as a direct binary, or as a kubectl plugin by placing the binary in the $PATH.

A plugin to manage your Kamaji Tenant Control Planes with ease.

Usage:
  kubectl-kamaji [command]

Aliases:
  kubectl-kamaji, kubectl kamaji

Available Commands:
  certificates Certificate operations
  completion   Generate the autocompletion script for the specified shell
  help         Help about any command
  kubeconfig   kubeconfig operations
  token        bootstrap token operations

Flags:
      --as string                      Username to impersonate for the operation. User could be a regular user or a service account in a namespace.
      --as-group stringArray           Group to impersonate for the operation, this flag can be repeated to specify multiple groups.
      --as-uid string                  UID to impersonate for the operation.
      --cache-dir string               Default cache directory (default "/home/prometherion/.kube/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
      --disable-compression            If true, opt-out of response compression for all requests to the server
  -h, --help                           help for kubectl-kamaji
      --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 (default "default")
      --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
      --tls-server-name string         Server name to use for server certificate validation. If it is not provided, the hostname used to contact the server is used
      --token string                   Bearer token for authentication to the API server
      --user string                    The name of the kubeconfig user to use

Use "kubectl-kamaji [command] --help" for more information about a command.
Performs operations on kubeconfig objects related to the given Tenant Control Plane.

Usage:
  kubectl-kamaji kubeconfig [command]

Available Commands:
  get         Get kubeconfig
  rotate      Rotate a kubeconfig
Creates the required join token commands to let a Worker Node join the given Tenant Control Plane.

Usage:
  kubectl-kamaji token [command]

Available Commands:
  join        Print join command
Performs operations on Tenant Control Plance related certificates.

Usage:
  kubectl-kamaji certificates [command]

Available Commands:
  rotate      Get kubeconfig

Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
Copy link

netlify bot commented Dec 4, 2024

Deploy Preview for kamaji-documentation canceled.

Name Link
🔨 Latest commit d43d0a7
🔍 Latest deploy log https://app.netlify.com/sites/kamaji-documentation/deploys/675083754f6a870007e8b60b

Signed-off-by: Dario Tranchitella <dario@tranchitella.eu>
@bsctl
Copy link
Member

bsctl commented Dec 7, 2024

@prometherion is there any specific reason why not an independent repository for this binary?

@prometherion
Copy link
Member Author

My plan was to have everything in a single repository to reuse some functions without the toil of importing external packages and have a compatibility matrix.

However, since we need to publish the package externally, such as krew, we need semantic versioning in place, which is not the case with Kamaji, unless changing its format (e.g.: edge-24.10.1 to 24.10.1+edge).

The plan was to share feedback with you too, and it sounds to me that having a separate repository would be way better, considering that we could have a bug in the CLI that would need a new release unrelated to Kamaji, and vice-versa.

If you agree, I'd close the PR and create a new repository only for the kamaji CLI.

@prometherion
Copy link
Member Author

Created github.com/clastix/kamaji-kubectl-plugin, see you space cowboy

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.

2 participants