Jenkins and Kubernetes Design Involving GitHub I am new to DevOps and am currently designing a CI/CD pipeline that involves integrating GitHub webhooks with Jenkins in a Kubernetes environment, and I would like to see whether this is feasible or not.
Currently, I have a GitHub repository setup with some code. In Kubernetes, we have a volume setup where we plan to clone said repository into this volume. This repository will need to be up-to-date at all times, but we shouldn't manually update this repository every time a change is made. With Jenkins, we want to setup webhooks in GitHub so any time changes made in the code repository will be updated in the volume.
I am still new to the idea of webhooks and Jenkins will interact in a Kubernetes environment, specifically a volume, so any thoughts and comments would be appreciated.
Thanks in advance!
I would use the webhooks GitHub provides if you don't need something specific from Jenkins (Jenkins is in many cases a consumer of GitHub events/webhooks).
https://docs.github.com/en/developers/webhooks-and-events/webhook-events-and-payloads#push
Using this webhook you could inspect each payload for specific parameters (ref, repo, etc...) and do something (like pull) if those parameters are met. In either case, you will need a service that can process the webhook/payload and perform the work/automation.