github.com/1aal/kubeblocks@v0.0.0-20231107070852-e1c03e598921/docs/user_docs/cli/kbcli_cluster_connect.md (about) 1 --- 2 title: kbcli cluster connect 3 --- 4 5 Connect to a cluster or instance. 6 7 ``` 8 kbcli cluster connect (NAME | -i INSTANCE-NAME) [flags] 9 ``` 10 11 ### Examples 12 13 ``` 14 # connect to a specified cluster, default connect to the leader/primary instance 15 kbcli cluster connect mycluster 16 17 # connect to cluster as user 18 kbcli cluster connect mycluster --as-user myuser 19 20 # connect to a specified instance 21 kbcli cluster connect -i mycluster-instance-0 22 23 # connect to a specified component 24 kbcli cluster connect mycluster --component mycomponent 25 26 # show cli connection example with password mask 27 kbcli cluster connect mycluster --show-example --client=cli 28 29 # show java connection example with password mask 30 kbcli cluster connect mycluster --show-example --client=java 31 32 # show all connection examples with password mask 33 kbcli cluster connect mycluster --show-example 34 35 # show cli connection examples with real password 36 kbcli cluster connect mycluster --show-example --client=cli --show-password 37 ``` 38 39 ### Options 40 41 ``` 42 --as-user string Connect to cluster as user 43 --client string Which client connection example should be output, only valid if --show-example is true. 44 --component string The component to connect. If not specified, pick up the first one. 45 -h, --help help for connect 46 -i, --instance string The instance name to connect. 47 --show-example Show how to connect to cluster/instance from different clients. 48 --show-password Show password in example. 49 ``` 50 51 ### Options inherited from parent commands 52 53 ``` 54 --as string Username to impersonate for the operation. User could be a regular user or a service account in a namespace. 55 --as-group stringArray Group to impersonate for the operation, this flag can be repeated to specify multiple groups. 56 --as-uid string UID to impersonate for the operation. 57 --cache-dir string Default cache directory (default "$HOME/.kube/cache") 58 --certificate-authority string Path to a cert file for the certificate authority 59 --client-certificate string Path to a client certificate file for TLS 60 --client-key string Path to a client key file for TLS 61 --cluster string The name of the kubeconfig cluster to use 62 --context string The name of the kubeconfig context to use 63 --disable-compression If true, opt-out of response compression for all requests to the server 64 --insecure-skip-tls-verify If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure 65 --kubeconfig string Path to the kubeconfig file to use for CLI requests. 66 --match-server-version Require server version to match client version 67 -n, --namespace string If present, the namespace scope for this CLI request 68 --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") 69 -s, --server string The address and port of the Kubernetes API server 70 --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 71 --token string Bearer token for authentication to the API server 72 --user string The name of the kubeconfig user to use 73 ``` 74 75 ### SEE ALSO 76 77 * [kbcli cluster](kbcli_cluster.md) - Cluster command. 78 79 #### Go Back to [CLI Overview](cli.md) Homepage. 80