I just have this concept that i want to implement on our environment and i just want to ask if there is any way i can do it.
So, I want to configure Jenkins
and GKE
to automatically provision a pod with the current state of an application, and database, when creating a bug in Jira
. Basically I want Jenkins
to get triggered by an issue created by an user, in Jira
, and then build a replica of the application when the issue got created.
My question is this: Can GKE
be manipulated or linked in some way with Jenkins
so that it'll create a snapshot of the App + Database
and then create a new Pod based on those 2 snapshots?
The workflow should be something like this:Jira => Jenkins => GKE (snapshots) => GKE (Pods creating)
I would like Jenkins to communicate with GKE
and get on creating a new set of Pods
automatically, so that i won't have to intervene in any way.
Is there any way i can do something like this? This is just a concept for now, I'm not rushing on anything, just asking for some opinions on this.
Any ideas or suggestions?
Thank you
Here is how you could do. For each new Jira task:
To deploy Kubernetes resources from Jenkins you can use the DevOps steps of the Kubernetes Pipeline plugin.
You can use Jobs to run the database backup and restore tasks.
Your question is not specific to GKE. It's about Kubernetes. You probably need to write some code and use the Kubernetes API to achieve what you described, which is a pretty custom use case/workflow.
Some pointers on using the Kubernetes API: https://kubernetes.io/docs/reference/