I use a private online server to set a jenkins environment though kubernetes.
I have the following service file:
apiVersion: v1
kind: Service
metadata:
name: jenkins
namespace: jenkins
spec:
type: NodePort
ports:
- port: 8080
targetPort: 8080
selector:
app: jenkins
It works, meaning that I can wget from my server the jenkins pod. However I cannot reach my service from my local computer web-browser.
To do so, I have to type the following command:
kubectl port-forward -n jenkins service/jenkins 8080:8080 --address=<localServerIp>
I have read that port-forward is debug only (Difference between kubectl port-forwarding and NodePort service). But I cannot find how to configure my service to be visible from the internet. I want the equivalent of the port-forward rule for a persistent port-forward.