-1

I have created a K8 deployment for KIE WB and KIE Server. For KIE WB I have created a Docker Image that configures the Post Commit hook so my repos are pushed to GitHub.

All of this works great.

My question revolves around restoring a repository upon pod creation. So when my pod starts up I would like to clone my GitHub repos then they're restored without having to manually import them.

I thought I could use the GitHub API and get a tarball and drop them into the .niogit/ path but that's not working (I see the file structure in git is different, it looks like just the java source and not the required files for KIE WB recognize that it's a repo).

I know I have to be doing something that has been done but I am not finding anything to get this going. I don't want to reinvent the wheel either :)

Any ideas?

Gabe
  • 49,577
  • 28
  • 142
  • 181

1 Answers1

1

You need to use initContainers with Kubernetes git-sync https://github.com/kubernetes/git-sync/

Please see Answers to Question How to clone a private git repository into a kubernetes pod using ssh keys in secrets?

So the Kubernetes git-sync initContainer will pull a git repository into a local directory which is shared with your Drools Container via emptyDir volume mount.

For More Information on initContainers please read https://kubernetes.io/docs/concepts/workloads/pods/init-containers/

Sagar Velankar
  • 845
  • 5
  • 5