Replace git-sync with...

an 'initContainer' in the deployment that directly
executes a `git clone` command and checks out the
source code once.
This commit is contained in:
Kris De Volder
2019-07-17 11:47:42 -07:00
parent 4243d316ee
commit 1256af3c27
2 changed files with 6 additions and 12 deletions

View File

@@ -14,7 +14,7 @@ cd docker-boot-dev
# Then build it into a docker image
docker build -t theia-spring-boot .
# If using a 'kind' cluster, we must upload the image to the k8s cluster
# If using a 'kind' cluster, we must upload the image to the cluster
kind load docker-image theia-spring-boot
cd ..

View File

@@ -45,20 +45,14 @@ spec:
requests:
cpu: "2000m"
memory: 1000M
- name: git-sync
image: k8s.gcr.io/git-sync:v3.0.1
initContainers:
- name: git-clone
image: alpine/git
volumeMounts:
- name: source
mountPath: /tmp/git
env:
- name: GIT_SYNC_REPO
value: https://github.com/spring-projects/spring-petclinic.git
- name: GIT_SYNC_BRANCH
value: master
- name: GIT_SYNC_DEST
value: spring-petclinic
- name: GIT_SYNC_PERMISSIONS
value: "0777"
workingDir: /tmp/git
command: ["git", "clone", "https://github.com/spring-projects/spring-petclinic.git"]
volumes:
- name: source
emptyDir: {}