Rate This Document
Findability
Accuracy
Completeness
Readability

kubectl Not Installed or Configured When Analyzing Container Processes

Symptom

Real-time profiling or sampling profiling of container processes fails, and a message is displayed indicating that kubectl is not installed or configured in the target environment.

Possible Causes

  1. kubectl is not installed in the target environment.
  2. kubectl has been installed in the target environment, but the permission has not been configured.
  3. The management node of the Kubernetes cluster is faulty.

Troubleshooting Procedure

If kubectl has been installed but the permission has not been configured, perform the following operations:

  1. Create a file directory.
    1
    mkdir -p $HOME/.kube
    
  2. Copy the management node configuration file to the compute node.
    1
    sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    

    Do not allocate a permission to compute nodes in the production environment because this operation will cause security risks.

  3. Assign a permission on the configuration file.
    1
    sudo chmod -R 777 $HOME/.kube/config