Skip to content

Commit

Permalink
Merge d0627ec into 1c0e1e9
Browse files Browse the repository at this point in the history
  • Loading branch information
jprobinson committed Jul 19, 2017
2 parents 1c0e1e9 + d0627ec commit aa13f5d
Show file tree
Hide file tree
Showing 22 changed files with 1,631 additions and 0 deletions.
60 changes: 60 additions & 0 deletions examples/servers/reading-list/.drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# See: https://github.com/drone/drone/blob/v0.4.0/docs/build/README.md
build:

test:
image: golang:1.8
environment:
- GOPATH=/drone
commands:
- go get -u github.com/golang/dep/cmd/dep
- dep ensure -v
- go test -v .
when:
event: [push, pull_request]

build:
image: golang:1.8
environment:
- GOPATH=/drone
commands:
- cd server
# copy cert from host
- cp /etc/ssl/certs/ca-certificates.crt .
- CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server .
when:
event: tag

publish:
# build the Docker image and publish it to GCR
gcr:
repo: nyt-reading-list/server
tag: "$$TAG"
context: ./server
file: server/Dockerfile
token: >
$$GOOGLE_CREDENTIALS
storage_driver: overlay
when:
event: tag

deploy:
# apply the deployment changes to the GKE cluster
gke:
image: nytimes/drone-gke
project: nyt-reading-list
zone: us-central1-b
template: .kube.yml
cluster: central1
token: >
$$GOOGLE_CREDENTIALS
vars:
GCP_PROJECT_ID: nyt-reading-list
ENDPOINTS_VERSION: 2017-07-10r0
when:
event: tag

notify:
slack:
webhook_url: $$SLACK_WEBHOOK_URL
username: drone
channel: nyt-reading-list-deploy
97 changes: 97 additions & 0 deletions examples/servers/reading-list/.kube.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: reading-list-server
spec:
minReadySeconds: 30
replicas: 5
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 2
template:
metadata:
labels:
app: reading-list-server
spec:
terminationGracePeriodSeconds: 60
volumes:
- name: nyt-reading-list-tls
secret:
secretName: nyt-reading-list-tls
containers:
- name: esp
image: "gcr.io/endpoints-release/endpoints-runtime:1.3.0"
args: [
"-S", "443",
"-s", "nyt-reading-list.endpoints.{{.GCP_PROJECT_ID}}.cloud.goog",
"-v", "{{ .ENDPOINTS_VERSION }}",
"-a", "grpc://127.0.0.1:8081",
"-z", "healthz"
]
ports:
- containerPort: 443
protocol: TCP
lifecycle:
preStop:
exec:
command: ["/bin/sleep","60"]
volumeMounts:
- mountPath: /etc/nginx/ssl
readOnly: true
name: nyt-reading-list-tls
readinessProbe:
httpGet:
path: /healthz
port: 443
scheme: HTTP
initialDelaySeconds: 30
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: 443
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
- name: reading-list-server
image: gcr.io/nyt-reading-list/server:{{.TAG}}
ports:
- containerPort: 8081
protocol: TCP
- containerPort: 8080
protocol: TCP
readinessProbe:
httpGet:
path: /healthz
port: 8080
scheme: HTTP
initialDelaySeconds: 10
timeoutSeconds: 5
livenessProbe:
httpGet:
path: /healthz
port: 8080
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
env:
- name: GCP_PROJECT_ID
value: {{.GCP_PROJECT_ID}}
---
apiVersion: v1
kind: Service
metadata:
name: reading-list-server
labels:
app: reading-list-server
spec:
type: LoadBalancer
ports:
- name: reading-list-server
protocol: TCP
port: 443
selector:
app: reading-list-server
Loading

0 comments on commit aa13f5d

Please sign in to comment.