Fix hugo demo and docs

The hugo demo runs again.

Also removed docs on need to run as root.  Pretty sure you do not need
to.
This commit is contained in:
Tim Hockin 2018-12-17 11:44:50 -08:00
parent 1415acdf0e
commit 644151a1d3
3 changed files with 7 additions and 16 deletions

View File

@ -1,9 +1,7 @@
apiVersion: apps/v1beta2
apiVersion: apps/v1
kind: Deployment
metadata:
name: blog
labels:
name: blog
spec:
replicas: 1
selector:
@ -16,11 +14,10 @@ spec:
spec:
containers:
- name: git-sync
image: k8s.gcr.io/git-sync-amd64:v2.0.6
imagePullPolicy: Always
image: k8s.gcr.io/git-sync:v3.0.1
volumeMounts:
- name: markdown
mountPath: /git
mountPath: /tmp/git
env:
- name: GIT_SYNC_REPO
value: https://github.com/kubernetes/git-sync.git
@ -28,9 +25,6 @@ spec:
value: git-sync
- name: hugo
image: k8s.gcr.io/hugo
imagePullPolicy: Always
securityContext:
runAsUser: 0
volumeMounts:
- name: markdown
mountPath: /src
@ -48,8 +42,6 @@ spec:
volumeMounts:
- name: html
mountPath: /usr/share/nginx/html
ports:
- containerPort: 80
volumes:
- name: markdown
emptyDir: {}

View File

@ -3,7 +3,7 @@ kind: Service
metadata:
name: blog-service
spec:
type: "LoadBalancer"
type: LoadBalancer
ports:
- port: 80
selector:

View File

@ -61,6 +61,7 @@ volumes: [
## Step 3: Configure git-sync container
In your git-sync container configuration, mount the Secret Volume at "/etc/git-secret". Ensure that the environment variable GIT_SYNC_REPO is set to use a URL with the SSH protocol, and set GIT_SYNC_SSH to true.
```
{
name: "git-sync",
@ -82,9 +83,7 @@ In your git-sync container configuration, mount the Secret Volume at "/etc/git-s
},
...
],
securityContext: {
"runAsUser": 0
}
}
```
**Note:** Kubernetes mounts the Secret with permissions 0444 by default (not restrictive enough to be used as an SSH key), so make sure you use secret volume with `defaultMode: 256` (decimal number for octal 0400) and run the container as root.
**Note:** Kubernetes mounts the Secret with permissions 0444 by default (not restrictive enough to be used as an SSH key), so make sure you use secret volume with `defaultMode: 256` (decimal number for octal 0400).