Skip to content
This repository has been archived by the owner on May 3, 2022. It is now read-only.

Commit

Permalink
kubernetes: improve shipper's deployments
Browse files Browse the repository at this point in the history
This brings the Shipper you deploy out of the box closer to the way we
deploy it in Booking.

This also fixes a tiny bug where the metrics port was not exposed in the
`shipper` deployment.
  • Loading branch information
juliogreff authored and parhamdoustdar committed Sep 27, 2019
1 parent 34cc899 commit 10fb3f6
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Dockerfile.shipper
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM alpine:3.8
LABEL authors="Parham Doustdar <parham.doustdar@booking.com>, Alexey Surikov <alexey.surikov@booking.com>, Igor Sutton <igor.sutton@booking.com>, Ben Tyler <benjamin.tyler@booking.com>" LABEL authors="Parham Doustdar <parham.doustdar@booking.com>, Alexey Surikov <alexey.surikov@booking.com>, Igor Sutton <igor.sutton@booking.com>, Ben Tyler <benjamin.tyler@booking.com>"
RUN apk add ca-certificates RUN apk add ca-certificates
ADD build/shipper.linux-amd64 /bin/shipper ADD build/shipper.linux-amd64 /bin/shipper
ENTRYPOINT ["shipper", "-v", "4", "-logtostderr"] ENTRYPOINT ["shipper"]
2 changes: 1 addition & 1 deletion Dockerfile.shipper-state-metrics
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ FROM alpine:3.8
LABEL authors="Parham Doustdar <parham.doustdar@booking.com>, Alexey Surikov <alexey.surikov@booking.com>, Igor Sutton <igor.sutton@booking.com>, Ben Tyler <benjamin.tyler@booking.com>" LABEL authors="Parham Doustdar <parham.doustdar@booking.com>, Alexey Surikov <alexey.surikov@booking.com>, Igor Sutton <igor.sutton@booking.com>, Ben Tyler <benjamin.tyler@booking.com>"
RUN apk add ca-certificates RUN apk add ca-certificates
ADD build/shipper-state-metrics.linux-amd64 /bin/shipper-state-metrics ADD build/shipper-state-metrics.linux-amd64 /bin/shipper-state-metrics
ENTRYPOINT ["shipper-state-metrics", "-v", "2"] ENTRYPOINT ["shipper-state-metrics"]
15 changes: 14 additions & 1 deletion kubernetes/shipper-state-metrics.deployment.yaml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: shipper-state-metrics app: shipper-state-metrics
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template: template:
metadata: metadata:
labels: labels:
Expand All @@ -18,6 +23,14 @@ spec:
- name: shipper-state-metrics - name: shipper-state-metrics
image: <IMAGE> image: <IMAGE>
imagePullPolicy: Always imagePullPolicy: Always
args:
- "-v"
- "2"
ports: ports:
- containerPort: 8890 - name: metrics
containerPort: 8890
readinessProbe:
httpGet:
path: /metrics
port: 8890
serviceAccountName: shipper-management-cluster serviceAccountName: shipper-management-cluster
15 changes: 14 additions & 1 deletion kubernetes/shipper.deployment.yaml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,10 +9,17 @@ spec:
selector: selector:
matchLabels: matchLabels:
app: shipper app: shipper
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 1
type: RollingUpdate
template: template:
metadata: metadata:
labels: labels:
app: shipper app: shipper
annotations:
prometheus.io/scrape_port: '8889'
spec: spec:
containers: containers:
- name: shipper - name: shipper
Expand All @@ -27,8 +34,14 @@ spec:
- "9443" - "9443"
- "-resync" - "-resync"
- "10m" - "10m"
- "-v"
- "4"
- "-logtostderr"
ports: ports:
- containerPort: 9443 - name: metrics
containerPort: 8889
- name: webhook
containerPort: 9443
volumeMounts: volumeMounts:
- mountPath: /etc/webhook/certs - mountPath: /etc/webhook/certs
name: webhook-certs name: webhook-certs
Expand Down

0 comments on commit 10fb3f6

Please sign in to comment.