mirror of
https://github.com/rancher/k3k.git
synced 2026-08-18 20:07:06 +00:00
* Add HCP (Hosted Control Plane) support Introduce hosted control plane mode for k3k virtual clusters, including API types, controller logic, server endpoint handling, CLI flags, CRD updates, kubeconfig generation, and examples. Co-Authored-By: RuFlo <ruv@ruv.net> * removed hcpRegitration command added HCP conformance tests warning for hcp fix multi-VM HCP conformance test networking Both QEMU workers booted with `-net user` and ended up registering the same InternalIP (10.0.2.15) because each VM gets its own isolated NAT slirp. Flannel propagated this to `public-ip` on both nodes, so VXLAN could not tunnel between workers and any cross-node pod traffic broke (89 failed / 335 passed of 424 conformance specs). Replace user-mode networking with a Linux bridge (k3kbr0, 192.168.100.0/24) and one TAP device per VM, so the two workers share an L2 segment with unique routable IPs. NAT outbound from the bridge keeps internet access working for image pulls. Also set unique hostnames via cloud-init (worker-1/worker-2) and drop the `--node-name` flag from INSTALL_K3S_EXEC, since k3s now picks the correct node name from the OS hostname on its own. Bump hydrophone back to `--parallel 4` to match the single-VM job (parallelism was reduced earlier when the failure was thought to be resource-related). added HCP print command updated crds adding e2e tests Refactor selectNonLoopbackSAN function to accept SANs directly and update related logic in ensureHCPRegistration * Update agent flag validation and enhance ingress host check with a warning log Refactor descriptions for cluster provisioning mode and role in CRDs and documentation Refactor logging in ServerURL function to use controller-runtime logger Rename selectNonLoopbackSAN to findNonLoopbackSAN for clarity and update references Refactor ServerURL function and related code to remove unused parameters and improve clarity Remove unused imports from kubeconfig.go to improve code clarity * suggested changes * fix comment * fix test --------- Co-authored-by: jpgouin <jeanphilippe.gouin@suse.com> Co-authored-by: RuFlo <ruv@ruv.net>
319 lines
7.7 KiB
Plaintext
319 lines
7.7 KiB
Plaintext
== k3kcli
|
|
|
|
CLI for K3K.
|
|
|
|
=== Options
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
-h, --help help for k3kcli
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli cluster
|
|
|
|
K3k cluster command.
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for cluster
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli cluster create
|
|
|
|
Create a new cluster.
|
|
|
|
----
|
|
k3kcli cluster create [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli cluster create [command options] NAME
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
--agent-args strings agents extra arguments
|
|
--agent-envs strings agents extra Envs
|
|
--agents int number of agents
|
|
--annotations stringArray Annotations to add to the cluster object (e.g. key=value)
|
|
--cluster-cidr string cluster CIDR
|
|
--custom-certs string The path for custom certificate directory
|
|
-h, --help help for create
|
|
--kubeconfig-server string override the kubeconfig server host
|
|
--labels stringArray Labels to add to the cluster object (e.g. key=value)
|
|
--mirror-host-nodes Mirror Host Cluster Nodes
|
|
--mode string k3k mode type (shared, virtual, hcp) (default "shared")
|
|
-n, --namespace string namespace of the k3k cluster
|
|
--persistence-type string persistence mode for the nodes (dynamic, ephemeral) (default "dynamic")
|
|
--policy string The policy to create the cluster in
|
|
--server-args strings servers extra arguments
|
|
--server-envs strings servers extra Envs
|
|
--servers int number of servers (default 1)
|
|
--service-cidr string service CIDR
|
|
--storage-class-name string storage class name for dynamic persistence type
|
|
--storage-request-size string storage size for dynamic persistence type
|
|
--timeout duration The timeout for waiting for the cluster to become ready (e.g., 10s, 5m, 1h). (default 3m0s)
|
|
--tls-sans strings additional Subject Alternative Names for the cluster server TLS certificate
|
|
--token string token of the cluster
|
|
--version string k3s version
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli cluster delete
|
|
|
|
Delete an existing cluster.
|
|
|
|
----
|
|
k3kcli cluster delete [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli cluster delete [command options] NAME
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for delete
|
|
--keep-data keeps persistence volumes created for the cluster after deletion
|
|
-n, --namespace string namespace of the k3k cluster
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli cluster list
|
|
|
|
List all existing clusters.
|
|
|
|
----
|
|
k3kcli cluster list [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli cluster list [command options]
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for list
|
|
-n, --namespace string namespace of the k3k cluster
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli cluster update
|
|
|
|
Update existing cluster
|
|
|
|
----
|
|
k3kcli cluster update [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli cluster update [command options] NAME
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
--agents int32 number of agents
|
|
--annotations stringArray Annotations to add to the cluster object (e.g. key=value)
|
|
-h, --help help for update
|
|
--labels stringArray Labels to add to the cluster object (e.g. key=value)
|
|
-n, --namespace string namespace of the k3k cluster
|
|
-y, --no-confirm Skip interactive approval before applying update
|
|
--servers int32 number of servers (default 1)
|
|
--version string k3s version
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli kubeconfig
|
|
|
|
Manage kubeconfig for clusters.
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for kubeconfig
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli kubeconfig generate
|
|
|
|
Generate kubeconfig for clusters.
|
|
|
|
----
|
|
k3kcli kubeconfig generate [flags]
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
--altNames strings altNames of the generated certificates for the kubeconfig
|
|
--cn string Common name (CN) of the generated certificates for the kubeconfig (default "system:admin")
|
|
--config-name string the name of the generated kubeconfig file
|
|
--expiration-days int Expiration date of the certificates used for the kubeconfig (default 365)
|
|
-h, --help help for generate
|
|
--kubeconfig-server string override the kubeconfig server host
|
|
--name string cluster name
|
|
-n, --namespace string namespace of the k3k cluster
|
|
--org strings Organization name (ORG) of the generated certificates for the kubeconfig
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli policy
|
|
|
|
K3k policy command.
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for policy
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli policy create
|
|
|
|
Create a new policy.
|
|
|
|
----
|
|
k3kcli policy create [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli policy create [command options] NAME
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
--annotations stringArray Annotations to add to the policy object (e.g. key=value)
|
|
-h, --help help for create
|
|
--labels stringArray Labels to add to the policy object (e.g. key=value)
|
|
--mode string The allowed mode type of the policy (default "shared")
|
|
--namespace strings The namespaces where to bind the policy
|
|
--overwrite Overwrite namespace binding of existing policy
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli policy delete
|
|
|
|
Delete an existing policy.
|
|
|
|
----
|
|
k3kcli policy delete [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli policy delete [command options] NAME
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for delete
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|
|
|
|
== k3kcli policy list
|
|
|
|
List all existing policies.
|
|
|
|
----
|
|
k3kcli policy list [flags]
|
|
----
|
|
|
|
=== Examples
|
|
|
|
----
|
|
k3kcli policy list [command options]
|
|
----
|
|
|
|
=== Options
|
|
|
|
----
|
|
-h, --help help for list
|
|
----
|
|
|
|
=== Options inherited from parent commands
|
|
|
|
----
|
|
--debug Turn on debug logs
|
|
--kubeconfig string kubeconfig path ($HOME/.kube/config or $KUBECONFIG if set)
|
|
----
|