# Localhost:8080 was refused via jenkins but works via manual execution in server

**URL:** <https://discuss.kubernetes.io/t/localhost-8080-was-refused-via-jenkins-but-works-via-manual-execution-in-server/19802>\
**Category:** General Discussions\
**Created:** [April 28, 2022, 5:53am UTC](https://discuss.kubernetes.io/t/localhost-8080-was-refused-via-jenkins-but-works-via-manual-execution-in-server/19802 "2022-04-28T05:53:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![souravmajumder](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/souravmajumder/32/9390_2.png) [@souravmajumder](https://discuss.kubernetes.io/u/souravmajumder)\
**Post date:** [April 28, 2022, 5:53am UTC](https://discuss.kubernetes.io/t/localhost-8080-was-refused-via-jenkins-but-works-via-manual-execution-in-server/19802/1 "2022-04-28T05:53:13Z")

</div>

Dear All,

I am very new to Kubernetes and in the beginning days of learning it .So advance apology If mistaking with some technical terms here. I have a strange issue where i am getting error message as port 8080 is refused while I am running the command via jenkins but it works fine when I run manually.

Command ran:  
kubectl apply -f \<kubernetes\_deployment.yml\>

Error in jenkins:  
“delta”: “0:00:00.049013”, “end”: “2022-04-26 14:47:53.248479”, “msg”: “non-zero return code”, “rc”: 1, “start”: “2022-04-26 14:47:53.199466”, “stderr”: “The connection to the server localhost:8080 was refused - did you specify the right host or port?”, “stderr\_lines”: [“The connection to the server localhost:8080 was refused - did you specify the right host or port?”], “stdout”: “”, “stdout\_lines”: }  
[WARNING]: Consider using ‘become’, ‘become\_method’, and ‘become\_user’ rather

## Jenkins Running on Ubuntu 18.04.6 LTS on Server 1

Jenkins Version:2.332.2  
Jenkins Server: Ubuntu 18.04.6 LTS

### Cluster information:

Kubernets running on server 2

Kubernetes version:  
Client Version: version.Info{Major:“1”, Minor:“23”, GitVersion:“v1.23.6”, GitCommit:“ad3338546da947756e8a88aa6822e9c11e7eac22”, GitTreeState:“clean”, BuildDate:“2022-04-14T08:49:13Z”, GoVersion:“go1.17.9”, Compiler:“gc”, Platform:“linux/amd64”}  
Server Version: version.Info{Major:“1”, Minor:“22”, GitVersion:“v1.22.6”, GitCommit:“07959215dd83b4ae6317b33c824f845abd578642”, GitTreeState:“clean”, BuildDate:“2022-03-30T18:28:25Z”, GoVersion:“go1.16.12”, Compiler:“gc”, Platform:“linux/amd64”}

Cloud being used: (put bare-metal if not on a public cloud) : Microsoft Azure

Installation method: Minikube

Host OS: Ubuntu 20.04.4 LTS
