Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
improve descriptions and examples
  • Loading branch information
Kai Kummerer committed May 15, 2024
commit 8df5e651ab914da28db627d9a9e3eca7c53f1dce
4 changes: 2 additions & 2 deletions internal/cmd/ske/kubeconfig/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ func NewCmd(p *print.Printer) *cobra.Command {
`Create a kubeconfig for the SKE cluster with name "my-cluster"`,
"$ stackit ske kubeconfig create my-cluster"),
examples.NewExample(
`Create a login kubeconfig for the SKE cluster with name "my-cluster".`,
"This kubeconfig does not contain any credentials and instead obtains valid credentials via the STACKIT CLI",
`Get a login kubeconfig for the SKE cluster with name "my-cluster". `+
"This kubeconfig does not contain any credentials and instead obtains valid credentials via the STACKIT CLI.",
"$ stackit ske kubeconfig create my-cluster --login"),
examples.NewExample(
`Create a kubeconfig for the SKE cluster with name "my-cluster" and set the expiration time to 30 days`,
Expand Down
18 changes: 13 additions & 5 deletions internal/cmd/ske/kubeconfig/login/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,21 @@ const (
func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: "login",
Short: "login plugin for kubectl",
Long: "login plugin for kubectl to create a short-lived kubeconfig to authenticate against a STACKIT Kubernetes Engine (SKE) cluster. To obtain a kubeconfig for use with the login command, use the 'kubeconfig create --login' command.",
Args: args.NoArgs,
Short: "Login plugin for kubernetes clients",
Long: fmt.Sprintf("%s\n%s",
"Login plugin for kubernetes clients, that creates short-lived credentials to authenticate against a STACKIT Kubernetes Engine (SKE) cluster.",
"To obtain a kubeconfig for use with the login command, run 'kubeconfig create --login'.",
),
Args: args.NoArgs,
Example: examples.Build(
examples.NewExample(
"login to a SKE cluster specified in the kubeconfig",
"$ kubectl get pod"),
`Get a login kubeconfig for the SKE cluster with name "my-cluster". `+
"This kubeconfig does not contain any credentials and instead obtains valid credentials via the STACKIT CLI.",
"$ stackit ske kubeconfig create my-cluster --login"),
examples.NewExample(
"Use the previously saved kubeconfig to authenticate to the SKE cluster, in this case with kubectl.",
"$ kubectl cluster-info",
"$ kubectl get pods"),
),
RunE: func(cmd *cobra.Command, args []string) error {
ctx := context.Background()
Expand Down