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:
@@ -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 ..
|
||||
|
||||
@@ -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: {}
|
||||
|
||||
Reference in New Issue
Block a user