stackage-server/etc/kube/deployment_template.yaml
ketzacoatl e0e8e3ee17 update CI spec to use Gitlab review apps
Summary of changes:

* rename DOCKER_IMAGE to DEPLOYMENT_IMAGE
* docker image builds now run for any branch/tag
* include jobs for deploying and stopping the review app on kube
* review apps are deployed to the `fpco-untrusted` cluster
* review apps are available based the following URL scheme:
  https://stackage-server-$CI_BUILD_REF_SLUG.review.fpco-untrusted.fpcomplete.com/
* master deploys to prod, and the previous staging env has been dropped
* import the kube specs we've used in CI/prod, update to use envvars
  for APPROOT, DEPLOYMENT_APP, DEPLOYMENT_NAME, and DEPLOYMENT_IMAGE
2017-04-20 13:23:44 -04:00

54 lines
1.4 KiB
YAML

# Kubernetes
---
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: "${DEPLOYMENT_NAME}"
spec:
replicas: 2
minReadySeconds: 5
template:
metadata:
labels:
app: "${DEPLOYMENT_APP}"
spec:
containers:
- name: stackage-server
image: "${DEPLOYMENT_IMAGE}"
imagePullPolicy: Always
ports:
- name: http
containerPort: 3000
command: ["stackage-server"]
workingDir: /app
env:
- name: APPROOT
value: "${APPROOT}"
readinessProbe:
httpGet:
path: /
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect
- name: HTTPS
value: "on"
initialDelaySeconds: 5
timeoutSeconds: 1
periodSeconds: 5
successThreshold: 1
livenessProbe:
httpGet:
path: /
port: 3000
httpHeaders:
# Works around stackage-server's `forceSSL` redirect
- name: HTTPS
value: "on"
initialDelaySeconds: 60
timeoutSeconds: 1
periodSeconds: 10
successThreshold: 1
failureThreshold: 3
imagePullSecrets:
- name: registry-key