How to Send Event from Github to Jenkins Hosted in Private VPN

Jenkins setup:

jenkins is setup on GKE and exposed using nginx ingress
Accessible using VPN
Issue - Trying to send event to Jenkins from Github, but showing unable to reach to host

Any solution we can used instead of publicly exposed jenkins..

Regards,

Gaurav Tayade

Somehow you need something that is exposed to the internet so that github can send events there. You could setup a small service exposed to the internet that only accepts requests from github (I assume that is a known list of IPs) on a dedicated port and forwards that to your Jenkins inside your VPN

1 Like

Hello and welcome to this community, @tayadegaurav11! :waving_hand:

If you want to receive GitHub webhooks without exposing Jenkins to the public internet, there are a few options worth considering:

  • Use GitHub Actions as a proxy:
    You could have a small workflow that runs on GitHub’s side and triggers Jenkins builds via its API over VPN or through a secure tunnel.
  • Set up a webhook relay/tunnel:
    Tools like Webhook Relay or ngrok can securely forward incoming webhooks to your private Jenkins endpoint without opening it to the internet.
  • Run a self-hosted GitHub runner inside your network:
    This runner could receive GitHub events and then trigger Jenkins jobs internally, without needing any public ingress.
  • Fallback: Polling SCM in Jenkins:
    Not real-time, but Jenkins can periodically poll GitHub for changes if webhooks aren’t an option. :person_shrugging:

In practice, the most common and lightweight approach is to expose just the webhook endpoint via a secure tunnel (like ngrok) or a relay service. If you go this route, it’s a good idea to restrict access, so only the webhook endpoint is exposed, not the whole Jenkins controller.