Custom shell script is failing as connection refused

Hello All,

I have a custom shell script which has kubectl command inside it

Kubectl command

/bin/kubectl get pods -o wide | grep “registry-server” | head -1 |awk ‘{print $6}’

I am declaring the above command as variable and using it in a different curl command. When sensu check is executed I get the below error

Error

The connection to the server localhost:8080 was refused - did you specify the right host or port?

The error i believe is that the check is being executed as sensu user and kubectl command dos not work. Could anyone please suggest how to overcome this error??

Best Regards,

Vinod.

How about using ‘sudo’ ?

But any user can connect to a port, the connection refused in itself is not your core error.

Is 8080 expected?

···

On Wed, Jun 28, 2017 at 11:27 PM, Vinod Chandar vrvinodchandar@gmail.com wrote:

Hello All,

I have a custom shell script which has kubectl command inside it

Kubectl command

/bin/kubectl get pods -o wide | grep “registry-server” | head -1 |awk ‘{print $6}’

I am declaring the above command as variable and using it in a different curl command. When sensu check is executed I get the below error

Error

The connection to the server localhost:8080 was refused - did you specify the right host or port?

The error i believe is that the check is being executed as sensu user and kubectl command dos not work. Could anyone please suggest how to overcome this error??

Best Regards,

Vinod.