2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018

07/26/2020: Use Kubernetes init container to Git Clone and provide mounted directory

Acknowledgements

I took this idea from the TGI Kubernetes 39 video (https://www.youtube.com/watch?time_continue=3432&v=xYMA-S75_9U)

Process

Inside your pod manifest, define an init container like this:

template:
  spec:
    initContainers:
    - name: download-theme
      image: alpine-git
      command:
      - git
      - clone
      - https://github.com/soggiest/heptio-dex.git
      - /theme
      volumeMounts:
      - name: theme
        mountPath: /theme/

Some work needs to be done to make this work but the idea is sound.



subscribe via RSS