Skip to content

Commit

Permalink
fix(k8s): fix build-sync Pod crash loop issue
Browse files Browse the repository at this point in the history
  • Loading branch information
edvald committed Feb 19, 2020
1 parent 0c69b6e commit 86ee925
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 3 deletions.
2 changes: 1 addition & 1 deletion garden-service/src/plugins/kubernetes/hot-reload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ export function configureHotReload({

const rsyncContainer = {
name: "garden-rsync",
image: "gardendev/rsync:0.1",
image: "gardendev/rsync:0.2.0",
imagePullPolicy: "IfNotPresent",
env: [
// This makes sure the server is accessible on any IP address, because CIDRs can be different across clusters.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ spec:
name: garden-build-sync
containers:
- name: sync
image: "gardendev/rsync:0.1"
image: "gardendev/rsync:0.2.0"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: rsync
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe("configureHotReload", () => {
},
{
name: "garden-rsync",
image: "gardendev/rsync:0.1",
image: "gardendev/rsync:0.2.0",
imagePullPolicy: "IfNotPresent",
env: [
{
Expand Down
7 changes: 7 additions & 0 deletions rsync-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM alpine:3.11.3

RUN apk add --no-cache rsync

ADD entrypoint.sh /

ENTRYPOINT ["/entrypoint.sh"]
22 changes: 22 additions & 0 deletions rsync-server/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/sh
VOLUME=${VOLUME:-/data}
ALLOW=${ALLOW:-192.168.0.0/16 172.16.0.0/12}

mkdir -p ${VOLUME}

cat <<EOF > /etc/rsyncd.conf
uid = 0
#gid =
use chroot = no
log file = /dev/stdout
reverse lookup = no
munge symlinks = yes
[volume]
hosts deny = *
hosts allow = ${ALLOW}
read only = false
path = ${VOLUME}
comment = docker volume
EOF

exec /usr/bin/rsync --no-detach --daemon --config /etc/rsyncd.conf
6 changes: 6 additions & 0 deletions rsync-server/garden.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Module
type: container
name: rsync-server
description: The rsync server image, used for hot reloading and in-cluster build syncs
image: gardendev/rsync:0.2.0
dockerfile: Dockerfile

0 comments on commit 86ee925

Please sign in to comment.