Problem: Previously all of Kubernetes' image hosting has been out of gcr.io. There were significant egress costs associated with this when images were pulled from entities outside gcp. Refer to https://github.com/kubernetes/k8s.io/wiki/New-Registry-url-for-Kubernetes-(registry.k8s.io) Solution: As highlighted at KubeCon NA 2022 k8s infra SIG update, the replacement for k8s.gcr.io which is registry.k8s.io is now ready for mainstream use and the old k8s.gcr.io has been formally deprecated and projects are requested to migrate off it. This commit migrates remaining references for kubernetes/git-sync to registry.k8s.io. Signed-off-by: James Blair <mail@jamesblair.net> |
||
|---|---|---|
| .. | ||
| blog | ||
| config | ||
| hugo | ||
| README.md | ||
README.md
git-blog-demo
This demo shows how to use the git-sync sidekick container along side volumes and volumeMounts to create a markdown powered blog.
How it works
The pod is composed of 3 containers that share directories using 2 volumes:
- The
git-synccontainer clones a git repo into themarkdownvolume - The
hugocontainer read from themarkdownvolume and render it into thehtmlvolume. - The
nginxcontainer serve the content from thehtmlvolume.
Usage
Build demo containers (Optional)
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