Skip to content

Instantly share code, notes, and snippets.

@atemate
Created May 4, 2021 20:27
Show Gist options
  • Save atemate/258f318de8bfb0896df62f4fa0fe6e7d to your computer and use it in GitHub Desktop.
Save atemate/258f318de8bfb0896df62f4fa0fe6e7d to your computer and use it in GitHub Desktop.
K8b pod manifest that clones a private repo
apiVersion: v1
kind: Pod
metadata:
name: test
spec:
volumes:
- name: git-source
emptyDir: {}
- name: ssh-secret-volume
secret:
secretName: ssh-secret
items:
- key: id_rsa
path: id_rsa
mode: 0600
initContainers:
- image: alpine/git:1.0.27
name: git-clone
volumeMounts:
- name: git-source
mountPath: /tmp/git
- name: ssh-secret-volume
mountPath: /etc/ssh
env:
- name: GIT_SSH_COMMAND
value: 'ssh -i /etc/ssh/id_rsa -o "StrictHostKeyChecking=no"'
command:
- git
- clone
- [email protected]:pierpaolo28/Feature-Store-for-ML.git
- -b
- main
- /tmp/git
containers:
- image: python:3.7
name: main
volumeMounts:
- name: git-source
mountPath: /tmp/git
command:
- ls
- /tmp/git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment