This demo shows how to use the git-sync
sidekick container along side volumes
and volumeMounts
to create a markdown powered blog.
The pod is composed of 3 containers that share directories using 2 volumes:
- The
git-sync
container clones a git repo into themarkdown
volume - The
hugo
container read from themarkdown
volume and render it into thehtml
volume. - The
nginx
container serve the content from thehtml
volume.
Build the demo containers, and push them to a registry
docker build -t <some-registry>/git-sync ..
docker build -t <some-registry>/hugo hugo/
docker push <some-registry>/hugo <some-registry>/git-sync
If you end up using a different registry, be sure to update config/deployment.yaml
.
Create the pod and the service for the blog
kubectl create -f config
Open the service external ip in your browser