Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
k8s-ingress
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
3
Merge Requests
3
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
uplex-varnish
k8s-ingress
Commits
fc5c45b1
Commit
fc5c45b1
authored
Oct 02, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Controller runs as a non-root user.
Closes #38
parent
1821f0b9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
4 deletions
+29
-4
Dockerfile.controller
container/Dockerfile.controller
+11
-0
controller.yaml
deploy/controller.yaml
+9
-2
controller.yaml
examples/architectures/multi-controller/controller.yaml
+9
-2
No files found.
container/Dockerfile.controller
View file @
fc5c45b1
FROM golang:1.11.6 as builder
RUN go get -d -v github.com/slimhazard/gogitversion && \
cd /go/src/github.com/slimhazard/gogitversion && \
make install
...
...
@@ -12,6 +13,7 @@ COPY go.sum .
ENV GO111MODULE=on
RUN go mod download
RUN go mod verify
COPY ./pkg/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/pkg/
COPY ./cmd/ /go/src/code.uplex.de/uplex-varnish/k8s-ingress/cmd/
...
...
@@ -21,6 +23,15 @@ RUN go generate ./cmd/... && go build ./pkg/... ./cmd/... && \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o k8s-ingress cmd/*.go
FROM alpine:3.11.0
ENV USER=controller UID=10001
RUN adduser --disabled-password --gecos "viking controller" \
--home "/nonexistent" --shell "/sbin/nologin" --no-create-home \
--uid "${UID}" \
"${USER}"
COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/k8s-ingress /k8s-ingress
COPY --from=builder /go/src/code.uplex.de/uplex-varnish/k8s-ingress/pkg/varnish/vcl/*.tmpl /
USER controller:controller
ENTRYPOINT ["/k8s-ingress"]
deploy/controller.yaml
View file @
fc5c45b1
...
...
@@ -21,6 +21,9 @@ spec:
ports
:
-
name
:
http
containerPort
:
8080
volumeMounts
:
-
name
:
run
mountPath
:
"
/run"
livenessProbe
:
exec
:
command
:
...
...
@@ -33,6 +36,10 @@ spec:
command
:
-
/usr/bin/test
-
-e
-
/ready
-
/r
un/controller-r
eady
args
:
-
-readyfile=/ready
-
-readyfile=/run/controller-ready
volumes
:
-
name
:
run
emptyDir
:
medium
:
"
Memory"
examples/architectures/multi-controller/controller.yaml
View file @
fc5c45b1
...
...
@@ -22,6 +22,9 @@ spec:
ports
:
-
name
:
http
containerPort
:
8080
volumeMounts
:
-
name
:
run
mountPath
:
"
/run"
livenessProbe
:
exec
:
command
:
...
...
@@ -34,7 +37,11 @@ spec:
command
:
-
/usr/bin/test
-
-e
-
/ready
-
/r
un/controller-r
eady
args
:
-
-readyfile=/ready
-
-readyfile=/r
un/controller-r
eady
-
-class=varnish-coffee
volumes
:
-
name
:
run
emptyDir
:
medium
:
"
Memory"
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