This guide will help you get started with KubeFlex quickly. Choose the scenario that best fits your needs.
Create the hosting kind cluster with ingress controller and install the kubeflex operator:
kflex init --create-kind
Create a control plane:
kflex create cp1
Interact with the new control plane, for example get namespaces and create a new:
kflex ctx cp1
kubectl get ns
kubectl create ns myns
Create a second control plane and check that the namespace created in the first control plane is not present:
kflex create cp2
kflex ctx cp2
kubectl get ns
To go back to the hosting cluster context, use the ctx command:
kflex ctx
To switch back to a control plane context, use the ctx <control plane name> command, e.g:
kflex ctx cp1
To delete a control plane, use the delete <control plane name> command, e.g:
kflex delete cp1
For a realistic development team scenario with complete isolation:
Initialize the hosting cluster:
kflex init --create-kind
Create Team Alpha’s control plane:
kflex create team-alpha --type k8s
Switch to Team Alpha’s isolated environment:
kflex ctx team-alpha
kubectl create namespace frontend
kubectl create namespace backend
kubectl create deployment web --image=nginx -n frontend
Create Team Beta’s control plane:
kflex create team-beta --type k8s
Switch to Team Beta’s environment:
kflex ctx team-beta
kubectl get namespaces # Notice: team-alpha's namespaces are not visible
kubectl create namespace api
kubectl create deployment api-server --image=httpd -n api
Verify complete isolation:
# Team Beta cannot see Team Alpha's resources
kubectl get deployments --all-namespaces
# shows Team Beta's deployments
# Switch back to Team Alpha
kflex ctx team-alpha
kubectl get deployments --all-namespaces
# shows Team Alpha's deployments
Return to host cluster management:
kflex ctx
kubectl get controlplanes
# Shows both team-alpha and team-beta control planes
Cleanup:
kflex delete team-alpha
kflex delete team-beta
Result: Each team operates with complete isolation - they cannot see or interfere with each other’s resources, yet they share the underlying infrastructure efficiently.