From 644151a1d3fbc2524daf541e449ed203d0588108 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 17 Dec 2018 11:44:50 -0800 Subject: [PATCH] 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. --- demo/config/deployment.yaml | 14 +++----------- demo/config/service.yaml | 2 +- docs/ssh.md | 7 +++---- 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/demo/config/deployment.yaml b/demo/config/deployment.yaml index dc59b79..e235cb7 100644 --- a/demo/config/deployment.yaml +++ b/demo/config/deployment.yaml @@ -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: {} diff --git a/demo/config/service.yaml b/demo/config/service.yaml index e9d30b4..e50a381 100644 --- a/demo/config/service.yaml +++ b/demo/config/service.yaml @@ -3,7 +3,7 @@ kind: Service metadata: name: blog-service spec: - type: "LoadBalancer" + type: LoadBalancer ports: - port: 80 selector: diff --git a/docs/ssh.md b/docs/ssh.md index bff08a7..4f875b5 100644 --- a/docs/ssh.md +++ b/docs/ssh.md @@ -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).