<p>I'm trying to setup my Jenkins instance in our On-premise Kubernetes cluster v1.18.6. Went thru multiple posts on the internet explaining the steps but using nodeport IP and not using the ingress.</p>
<p>I'm looking for</p>
<ol>
<li>Domain under which I want to access Jenkins: <code>jenkins.BU.org.com/jenkins</code>.</li>
<li>Master slaves communication using ingress controller. I believe Jenkins uses a custom protocol for communicating with its build agents, being Java RMI, and not HTTP based.</li>
</ol>
<p>What other extra changes I've to make from my end in addition to the steps mentioned in the below document.</p>
<p>Very new to Kubernetes and its dynamics, so any help here would be great for my learning, thanks.</p>
<p><a href="https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-kubernetes" rel="nofollow noreferrer">https://www.digitalocean.com/community/tutorials/how-to-install-jenkins-on-kubernetes</a></p>

Chel MS
<p>So starting out from bare bones I assume following things:</p>
<ul>
<li>You have a configured Kubernetes cluster available to you</li>
<li>You have the Ingress controller installed in your cluster</li>
</ul>
<p>First thing to make clear:</p>
<blockquote>
<p>Workloads which run within the Kubernetes cluster should communicate via Service resources and not Ingress resources.</p>
</blockquote>
<p>Second thing to keep in mind is:</p>
<blockquote>
<p>Use Ingress resource to make your workloads reachable from outside of your cluster</p>
</blockquote>
<p>And lastly since you are hoping to make your Jenkins instance accessible under <code>jenkins.BU.org.com/jenkins</code> then you will have to pick one of the following:</p>
<ul>
<li>Buy the <code>org.com</code> domain, since <code>jenkins.BU.org.com</code> is a subdomain of <code>org.com</code> domain</li>
<li>Setup your own private networking ( out of scope of this question and my knowledge honestly )</li>
</ul>
<p>So to answer your question you will need to do following things to make your Jenkins instance accessible from outside of the cluster:</p>
<ul>
<li>Create your Jenkins master Pod with some port open, say 8080</li>
<li>Create a Service resource which selects your Pod and forwards the port 80 to port 8080</li>
<li>Create an Ingress resource which forwards your desired domain name to your Service onto port 80</li>
<li>Create a LoadBalancer service to target your Ingress controller Pods</li>
<li>Associate the LoadBalancer service with your actual load balancer ( depending on your environment )</li>
<li>Associate your domain name to load balancer IPs for DNS resolution</li>
</ul>
<p>Another way to solve this would be:</p>
<ul>
<li>Create your Jenkins master Pod with some port open, say 8080</li>
<li>Create a Service resource of type NodePort which selects your Pod and forwards the port 80 to port 8080. This will open a port on your Node, and then you should be able to access your Pod via the IP address of the node.</li>
<li>Configure the DNS to resolve your desired domain name to the IP of your node.</li>
</ul>
<p>I would not recommend second approach, since it would imply making your node available to the internet directly.</p>
