Bootstrap FreeKB - Trident - Resolve "could not find a Trident pod in the trident namespace. You may need to use the -n option to specify the correct namespace"
Trident - Resolve "could not find a Trident pod in the trident namespace. You may need to use the -n option to specify the correct namespace"

Updated:   |  Trident articles

Let's say something like this is being returned when attempting to create the Trident Backend on OpenShift.

could not find a Trident pod in the trident namespace. You may need to use the -n option to specify the correct namespace

 

As the error suggests, the oc get pods command can be used to determine if the Trident CSI pods exist. These pods are almost always created in the "trident" namespace.

~]$ oc get pods --namespace trident
NAME                           READY   STATUS    RESTARTS   AGE
trident-csi-28x7h              2/2     Running   0          6h57m
trident-csi-5fb5bb4886-gxh4s   6/6     Running   0          6h56m
trident-csi-8rmvd              2/2     Running   0          6h57m
trident-csi-cfdcq              2/2     Running   0          6h57m
trident-csi-gdm6n              2/2     Running   0          6h57m
trident-csi-mr682              2/2     Running   0          6h57m
trident-csi-qdr6v              2/2     Running   0          6h57m
trident-csi-rmvxx              2/2     Running   0          6h57m
trident-csi-tspz5              2/2     Running   0          6h57m
trident-csi-xfscd              2/2     Running   0          6h57m

 

If the Trident CSI pods exist, I would next look at the logs in the trident-main container in the Trident CSI pods. This can be done using the oc logs command. Notice in this example that following errors are in the containers logs.

  • Could not update Trident controller with node registration
  • could not log into the Trident CSI Controller
  • error communicating with Trident CSI Controller
~]$ oc logs trident-csi-28x7h --container trident-main --namespace trident
time="2023-02-22T05:43:07Z" level=warning msg="Could not update Trident controller with node registration, will retry." error="could not log into the Trident CSI Controller: error communicating with Trident CSI Controller; Put \https://172.30.24.92:34571/trident/v1/node/ip-10-29-11-18.us-east-1.compute.internal\: dial tcp 172.30.24.92:34571: connect: connection refused" increment=10.76384808s requestID=b206db5a-1520-4bce-9c97-418d06f170b7 requestSource=Internal

 

I would also check the logs in the driver-registrar container. Notice in this example that the container was "still connecting" and then got connected.

~]$ oc logs pod/trident-csi-28x7h --namespace trident --container driver-registrar
I0222 05:43:06.632808  581480 main.go:166] Version: v2.5.1
I0222 05:43:06.632847  581480 main.go:167] Running node-driver-registrar in mode=registration
I0222 05:43:06.633303  581480 main.go:191] Attempting to open a gRPC connection with: "/plugin/csi.sock"
W0222 05:43:16.633763  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
W0222 05:43:26.633611  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
W0222 05:43:36.634142  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
W0222 05:43:46.633367  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
W0222 05:43:56.633771  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
W0222 05:44:06.634292  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
W0222 05:44:16.633575  581480 connection.go:173] Still connecting to unix:///plugin/csi.sock
I0222 05:44:22.131004  581480 main.go:198] Calling CSI driver to discover driver name
I0222 05:44:22.132713  581480 main.go:208] CSI driver name: "csi.trident.netapp.io"
I0222 05:44:22.132750  581480 node_register.go:53] Starting Registration Server at: /registration/csi.trident.netapp.io-reg.sock
I0222 05:44:22.132939  581480 node_register.go:62] Registration Server started at: /registration/csi.trident.netapp.io-reg.sock
I0222 05:44:22.133030  581480 node_register.go:92] Skipping HTTP server because endpoint is set to: ""
I0222 05:44:23.084053  581480 main.go:102] Received GetInfo call: &InfoRequest{}
I0222 05:44:23.084278  581480 main.go:109] "Kubelet registration probe created" path="/var/lib/kubelet/plugins/csi.trident.netapp.io/registration"
I0222 05:44:23.119315  581480 main.go:120] Received NotifyRegistrationStatus call: &RegistrationStatus{PluginRegistered:true,Error:,}

 

This happened to me because we had the creation of the Trident Backend automated with Ansible and we didn't have a pause that waited for the Trident CSI pods to get connected. The solution was simple. We just had to add a short pause (2 minutes) to give the Trident CSI pods time to get connected.

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 1b2a89 in the box below so that we can be sure you are a human.