Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
19751abe
Commit
19751abe
authored
Feb 02, 2015
by
Johan Euphrosine
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
contrib/git-sync: add demo
parent
5aba5f00
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
126 additions
and
0 deletions
+126
-0
README.md
contrib/git-sync/demo/README.md
+28
-0
.keep
contrib/git-sync/demo/blog/archetypes/.keep
+0
-0
config.toml
contrib/git-sync/demo/blog/config.toml
+3
-0
about.md
contrib/git-sync/demo/blog/content/about.md
+9
-0
first.md
contrib/git-sync/demo/blog/content/post/first.md
+9
-0
.keep
contrib/git-sync/demo/blog/layouts/.keep
+0
-0
.keep
contrib/git-sync/demo/blog/static/.keep
+0
-0
pod.yaml
contrib/git-sync/demo/config/pod.yaml
+50
-0
service.yaml
contrib/git-sync/demo/config/service.yaml
+8
-0
Dockerfile
contrib/git-sync/demo/hugo/Dockerfile
+13
-0
run-hugo
contrib/git-sync/demo/hugo/run-hugo
+6
-0
No files found.
contrib/git-sync/demo/README.md
0 → 100644
View file @
19751abe
# 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-sync`
container clones a git repo into the
`markdown`
volume
-
The
`hugo`
container read from the
`markdown`
volume and render it into the
`html`
volume.
-
The
`nginx`
container serve the content from the
`html`
volume.
## Usage
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
```
Create the pod and the service for the blog
```
kubectl pods create config/pod.html
kubectl services create config/pod.html
``
`
Open the external ip in your browser
contrib/git-sync/demo/blog/archetypes/.keep
0 → 100644
View file @
19751abe
contrib/git-sync/demo/blog/config.toml
0 → 100644
View file @
19751abe
baseurl
=
"http://example.com"
languageCode
=
"en-us"
title
=
"example blog"
contrib/git-sync/demo/blog/content/about.md
0 → 100644
View file @
19751abe
+++
date = "2014-12-19T15:29:48-08:00"
draft = true
title = "about"
+++
## A headline
Some content about the blog.
contrib/git-sync/demo/blog/content/post/first.md
0 → 100644
View file @
19751abe
+++
date = "2014-12-19T15:30:18-08:00"
draft = true
title = "first"
+++
## first port
This is the first post.
contrib/git-sync/demo/blog/layouts/.keep
0 → 100644
View file @
19751abe
contrib/git-sync/demo/blog/static/.keep
0 → 100644
View file @
19751abe
contrib/git-sync/demo/config/pod.yaml
0 → 100644
View file @
19751abe
id
:
blog-pod
kind
:
Pod
apiVersion
:
v1beta1
desiredState
:
manifest
:
version
:
v1beta1
containers
:
-
name
:
git-sync
image
:
proppy/git-sync
imagePullPolicy
:
PullAlways
env:
:
-
name
:
GIT_SYNC_REPO
value
:
https://github.com/proppy/blog.git
-
name
:
GIT_SYNC_DEST
value
:
/git
volumeMounts
:
-
name
:
markdown
mountPath
:
/git
-
name
:
hugo
image
:
proppy/hugo
imagePullPolicy
:
PullAlways
env
:
-
name
:
SRC
value
:
/src
-
name
:
BUILD_DRAFT
value
:
'
true'
-
name
:
BASE_URL
value
:
kube.proppy.sh
volumeMounts
:
-
name
:
markdown
mountPath
:
/src
-
name
:
html
mountPath
:
/dest
-
name
:
nginx
image
:
nginx
volumeMounts
:
-
name
:
html
mountPath
:
/usr/share/nginx/html
ports
:
-
name
:
http-server
containerPort
:
80
volumes
:
-
name
:
markdown
source
:
emptyDir
:
{}
-
name
:
html
source
:
emptyDir
:
{}
labels
:
name
:
blog
contrib/git-sync/demo/config/service.yaml
0 → 100644
View file @
19751abe
id
:
blog-service
kind
:
Service
apiVersion
:
v1beta1
port
:
80
containerPort
:
http-server
selector
:
name
:
blog
createExternalLoadBalancer
:
true
contrib/git-sync/demo/hugo/Dockerfile
0 → 100644
View file @
19751abe
FROM
golang
RUN
go get
-v
github.com/spf13/hugo
RUN
git clone
--recursive
https://github.com/spf13/hugoThemes.git /themes
VOLUME
["/src", "/dest"]
EXPOSE
1313
ENV
SRC /src
ENV
DEST /dest
ENV
THEME hyde
ENV
BUILD_DRAFT false
ENV
BASE_URL ""
ADD
run-hugo /run-hugo
ENTRYPOINT
["/run-hugo"]
CMD
["server", "--source=${SRC}", "--theme=${THEME}", "--buildDrafts=${BUILD_DRAFT}", "--baseUrl=${BASE_URL}", "--watch", "--destination=${DEST}", "--appendPort=false"]
contrib/git-sync/demo/hugo/run-hugo
0 → 100755
View file @
19751abe
#!/bin/bash
set
-ex
if
[
!
-d
${
SRC
}
/themes
]
;
then
ln
-s
/themes
${
SRC
}
/themes
fi
hugo
$(
eval echo
$*
)
# force default CMD env expansion
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment