check Integration
To verify and debug the Integration aspect in the Cluster API Provider for Tinkerbell (CAPT), which ensures that various components work together seamlessly to provision and manage Kubernetes clusters on bare-metal infrastructure, follow these steps:
1. Verify Integration of Key Resources
Integration in CAPT involves ensuring that various resources like Cluster
, Machine
, MachineDeployment
, KubeadmControlPlane
, and infrastructure-specific resources (like TinkerbellCluster
and TinkerbellMachine
) are correctly linked and working together.
Check Cluster Resource:
Start by ensuring that the Cluster
resource is in a healthy state.
kubectl get clusters -A
- Expected Output: The
Cluster
resource should be listed, with a status indicating that it isProvisioned
orReady
.
Describe Cluster Resource:
kubectl describe cluster <cluster-name> -n <namespace>
- Expected Output: The description should confirm that all necessary components, such as control plane and infrastructure resources, are correctly associated and in the expected state.
2. Verify Machine Integration
Check that Machines are correctly created and managed by MachineDeployment
or KubeadmControlPlane
, and that they are correctly associated with the infrastructure provider.
Check Machines:
kubectl get machines -A
- Expected Output: Machines should be listed with a status of
Running
,Provisioned
, orReady
. Each Machine should be correctly linked to aMachineDeployment
,KubeadmControlPlane
, or similar resource.
Describe Machines:
kubectl describe machine <machine-name> -n <namespace>
- Expected Output: This should provide detailed information, showing the correct association with the infrastructure provider (e.g.,
TinkerbellMachine
) and successful provisioning and integration steps.
3. Verify Control Plane Integration
Ensure that the control plane nodes managed by KubeadmControlPlane
are correctly provisioned and integrated.
Check Control Plane Status:
kubectl get kubeadmcontrolplanes -A
- Expected Output: The control plane should be listed with its status indicating
Ready
. Nodes should be correctly initialized and joined to the cluster.
Describe Control Plane:
kubectl describe kubeadmcontrolplane <control-plane-name> -n <namespace>
- Expected Output: The description should confirm the correct configuration and integration of control plane nodes, with no errors during initialization or joining processes.
4. Check Infrastructure Provider Integration
Ensure that infrastructure-specific resources like TinkerbellCluster
, TinkerbellMachineTemplate
, and TinkerbellMachine
are correctly configured and integrated with Cluster API resources.
Check Tinkerbell Resources:
kubectl get tinkerbellclusters -A
kubectl get tinkerbellmachines -A
kubectl get tinkerbellmachinetemplates -A
- Expected Output: These resources should be listed and have statuses indicating
Ready
orProvisioned
. They should be correctly linked to the correspondingCluster
,Machine
, andKubeadmControlPlane
resources.
Describe Tinkerbell Resources:
kubectl describe tinkerbellcluster <cluster-name> -n <namespace>
kubectl describe tinkerbellmachine <machine-name> -n <namespace>
kubectl describe tinkerbellmachinetemplate <template-name> -n <namespace>
- Expected Output: The descriptions should confirm correct integration and no errors during the interaction with Cluster API resources.
5. Check Bootstrap Integration
Ensure that the bootstrap process (typically managed by KubeadmConfig
or KubeadmConfigTemplate
) is correctly initializing nodes.
Check Bootstrap Configurations:
kubectl get kubeadmconfigs -A
kubectl get kubeadmconfigtemplates -A
- Expected Output: These resources should show a status of
Ready
, indicating successful bootstrap integration.
Describe Bootstrap Configurations:
kubectl describe kubeadmconfig <config-name> -n <namespace>
kubectl describe kubeadmconfigtemplate <template-name> -n <namespace>
- Expected Output: The descriptions should indicate successful completion of bootstrap processes and correct integration with other Cluster API resources.
6. Check Node Integration
Verify that all nodes (Machines) are correctly registered and functioning in the Kubernetes cluster.
Check Node Status:
kubectl get nodes
- Expected Output: All nodes corresponding to the Machines should be listed with a status of
Ready
.
Describe Nodes:
kubectl describe node <node-name>
- Expected Output: Descriptions should confirm correct configuration, kubelet operation, and successful joining to the Kubernetes cluster.
7. Check Events and Logs for Integration Issues
Integration issues often manifest as errors or warnings in Kubernetes events or controller logs.
Check Events:
kubectl get events -A --sort-by='.metadata.creationTimestamp'
- Expected Output: Look for any warnings or errors indicating issues in the integration process, such as resource conflicts, failed provisioning, or issues with node registration.
Check Controller Logs:
kubectl logs -n capt-system <pod-name>
Replace <pod-name>
with the actual pod name of the CAPT controller or relevant controllers managing the integration.
- Expected Output: Logs should provide detailed information about the interaction between Cluster API resources and Tinkerbell infrastructure, highlighting any errors or issues that occur during the integration process.
8. Verify Cluster Functionality
Ensure that the integrated Kubernetes cluster is functioning as expected by performing basic cluster operations.
Check Cluster Health:
kubectl get componentstatuses
- Expected Output: All core components of the Kubernetes control plane should be listed as
Healthy
.
Deploy a Test Workload:
To further verify integration, deploy a simple test workload:
kubectl create deployment nginx --image=nginx
kubectl get pods
- Expected Output: The test workload should be successfully deployed, with pods transitioning to a
Running
state, indicating that the integration between control plane, nodes, and underlying infrastructure is functioning correctly.
9. Advanced Debugging with Increased Verbosity
If you suspect deeper integration issues, increase the verbosity of relevant controllers to gather more detailed logs.
- Edit Deployment for Increased Verbosity:
kubectl edit deployment capt-controller-manager -n capt-system
- Add Verbosity Flag:
Add --v=5
or --v=10
to the command section for more detailed logging.
- Check Logs Again:
kubectl logs -n capt-system <pod-name>
10. Cross-Check All Related Resources
Cross-checking the state and conditions of all related resources can help ensure that integration is seamless and that there are no overlooked issues.
kubectl get all -n capt-system
kubectl get all -n kube-system
- Expected Output: All resources should be in a healthy state, reflecting correct integration and interaction between different components.
Conclusion
By following these steps, you can systematically verify and debug the integration of various components within the Cluster API Provider for Tinkerbell. This ensures that the different resources and controllers are working together to manage the Kubernetes cluster effectively on bare-metal infrastructure. Proper integration is critical for maintaining the reliability, scalability, and performance of your Kubernetes environment.