2018-06-24 13:00:40 +00:00
|
|
|
function (slug, sha) {
|
2018-07-27 23:49:30 +00:00
|
|
|
|
2018-06-16 15:19:52 +00:00
|
|
|
local app = "symposion-app-" + slug,
|
2018-06-24 04:30:13 +00:00
|
|
|
local namespace = "rego-review",
|
2018-06-16 09:05:37 +00:00
|
|
|
local domain = slug + ".dev.lca2019.org",
|
2018-07-28 00:46:10 +00:00
|
|
|
local tls_secret = slug + "-tls",
|
2018-07-27 23:49:30 +00:00
|
|
|
|
2018-06-16 15:19:52 +00:00
|
|
|
"deployment.json":
|
2018-06-16 09:05:37 +00:00
|
|
|
{
|
|
|
|
"apiVersion": "v1",
|
2018-06-16 15:19:52 +00:00
|
|
|
"items": [
|
|
|
|
{
|
|
|
|
"apiVersion": "v1",
|
|
|
|
"kind": "Service",
|
|
|
|
"metadata": {
|
|
|
|
"labels": {
|
2018-07-27 23:49:30 +00:00
|
|
|
"app": app,
|
2018-06-24 13:19:19 +00:00
|
|
|
"slug": slug
|
2018-06-16 15:19:52 +00:00
|
|
|
},
|
|
|
|
"name": app,
|
|
|
|
"namespace": namespace
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"port": 8000,
|
|
|
|
"protocol": "TCP",
|
|
|
|
"targetPort": 8000
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|
|
|
|
],
|
2018-06-16 15:19:52 +00:00
|
|
|
"selector": {
|
2018-07-27 23:49:30 +00:00
|
|
|
"app": app,
|
2018-06-24 13:19:19 +00:00
|
|
|
"slug": slug
|
2018-06-16 15:19:52 +00:00
|
|
|
},
|
|
|
|
"sessionAffinity": "None",
|
|
|
|
"type": "ClusterIP"
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|
|
|
|
},
|
2018-06-16 15:19:52 +00:00
|
|
|
{
|
|
|
|
"apiVersion": "extensions/v1beta1",
|
|
|
|
"kind": "Deployment",
|
2018-06-16 09:05:37 +00:00
|
|
|
"metadata": {
|
|
|
|
"labels": {
|
2018-07-27 23:49:30 +00:00
|
|
|
"app": app,
|
2018-06-24 13:19:19 +00:00
|
|
|
"slug": slug,
|
2018-06-16 15:19:52 +00:00
|
|
|
},
|
|
|
|
"name": app,
|
|
|
|
"namespace": namespace
|
2018-06-16 09:05:37 +00:00
|
|
|
},
|
|
|
|
"spec": {
|
2018-06-16 15:19:52 +00:00
|
|
|
"replicas": 1,
|
|
|
|
"revisionHistoryLimit": 1,
|
|
|
|
"selector": {
|
|
|
|
"matchLabels": {
|
2018-07-27 23:49:30 +00:00
|
|
|
"app": app,
|
2018-06-24 13:19:19 +00:00
|
|
|
"slug": slug
|
2018-06-16 15:19:52 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"strategy": {
|
|
|
|
"rollingUpdate": {
|
|
|
|
"maxSurge": 1,
|
|
|
|
"maxUnavailable": 1
|
|
|
|
},
|
|
|
|
"type": "RollingUpdate"
|
|
|
|
},
|
|
|
|
"template": {
|
|
|
|
"metadata": {
|
|
|
|
"labels": {
|
2018-07-27 23:49:30 +00:00
|
|
|
"app": app,
|
2018-06-24 13:00:40 +00:00
|
|
|
"slug": slug
|
2018-06-16 15:19:52 +00:00
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"containers": [
|
2018-06-16 09:05:37 +00:00
|
|
|
{
|
2018-06-16 15:19:52 +00:00
|
|
|
"env": [
|
|
|
|
{
|
|
|
|
"name": "SYMPOSION_APP_DEBUG",
|
|
|
|
"value": "1"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DJANGO_SECRET_KEY",
|
|
|
|
"value": "paGhahQuain5ohYoh0moorai"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "DATABASE_URL",
|
|
|
|
"value": "sqlite:////tmp/symposion.sqlite"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "GCS_BUCKET",
|
|
|
|
"value": "CEA51A5-A613-4AEF-A9FB-D0A57D77C13B"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "GOOGLE_APPLICATION_CREDENTIALS",
|
|
|
|
"value": "/dev/null"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "STRIPE_PUBLIC_KEY",
|
|
|
|
"value": "5CEA51A5-A613-4AEF-A9FB-D0A57D77C13B"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "STRIPE_SECRET_KEY",
|
|
|
|
"value": "5CEA51A5-A613-4AEF-A9FB-D0A57D77C13B"
|
|
|
|
},
|
2018-06-24 12:04:31 +00:00
|
|
|
{
|
|
|
|
"name": "SYMPOSION_DEV_MODE",
|
|
|
|
"value": "LAPTOP"
|
|
|
|
},
|
2018-06-29 23:37:30 +00:00
|
|
|
{
|
|
|
|
"name": "ANALYTICS_KEY",
|
|
|
|
"value": "UA-000000000-1"
|
|
|
|
}
|
2018-06-16 15:19:52 +00:00
|
|
|
],
|
2018-06-24 13:00:40 +00:00
|
|
|
"image": "asia.gcr.io/linuxconfsydney/symposion_app_2019_dev:" + sha,
|
2018-06-16 15:19:52 +00:00
|
|
|
"imagePullPolicy": "Always",
|
|
|
|
"livenessProbe": {
|
|
|
|
"failureThreshold": 3,
|
|
|
|
"httpGet": {
|
|
|
|
"path": "/admin/login/",
|
|
|
|
"port": 8000,
|
|
|
|
"scheme": "HTTP"
|
|
|
|
},
|
2018-07-31 11:02:20 +00:00
|
|
|
"initialDelaySeconds": 180,
|
2018-06-16 15:19:52 +00:00
|
|
|
"periodSeconds": 10,
|
|
|
|
"successThreshold": 1,
|
2018-07-31 11:02:20 +00:00
|
|
|
"timeoutSeconds": 5
|
2018-06-16 15:19:52 +00:00
|
|
|
},
|
2018-08-02 12:18:31 +00:00
|
|
|
"name": app,
|
2018-06-16 15:19:52 +00:00
|
|
|
"ports": [
|
|
|
|
{
|
|
|
|
"containerPort": 8000,
|
|
|
|
"protocol": "TCP"
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"resources": {},
|
|
|
|
"terminationMessagePath": "/dev/termination-log",
|
|
|
|
"terminationMessagePolicy": "File"
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|
|
|
|
],
|
2018-06-16 15:19:52 +00:00
|
|
|
"dnsPolicy": "ClusterFirst",
|
|
|
|
"restartPolicy": "Always",
|
|
|
|
"schedulerName": "default-scheduler",
|
|
|
|
"securityContext": {},
|
|
|
|
"terminationGracePeriodSeconds": 30
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|
2018-06-16 15:19:52 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"kind": "List"
|
|
|
|
},
|
2018-07-27 23:49:30 +00:00
|
|
|
"ingress.json":
|
|
|
|
{
|
|
|
|
"kind": "Ingress",
|
|
|
|
"apiVersion": "extensions/v1beta1",
|
|
|
|
"metadata": {
|
|
|
|
"name": app,
|
|
|
|
"namespace": namespace,
|
|
|
|
"annotations": {
|
|
|
|
"kubernetes.io/ingress.class": "nginx-review",
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"backend": {
|
|
|
|
"serviceName": app,
|
|
|
|
"servicePort": 80
|
|
|
|
},
|
|
|
|
"tls": [
|
|
|
|
{
|
|
|
|
"hosts": [
|
|
|
|
domain
|
|
|
|
],
|
|
|
|
"secretName": tls_secret,
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"rules": [
|
|
|
|
{
|
|
|
|
"host": domain,
|
|
|
|
"http": {
|
|
|
|
"paths": [
|
|
|
|
{
|
|
|
|
"path": "/",
|
|
|
|
"backend": {
|
|
|
|
"serviceName": app,
|
|
|
|
"servicePort": 8000
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2018-06-16 09:05:37 +00:00
|
|
|
]
|
2018-06-24 11:05:48 +00:00
|
|
|
}
|
2018-07-28 00:46:10 +00:00
|
|
|
},
|
|
|
|
"certificate.json":
|
|
|
|
{
|
|
|
|
"apiVersion": "certmanager.k8s.io/v1alpha1",
|
|
|
|
"kind": "Certificate",
|
|
|
|
"metadata": {
|
|
|
|
"name": slug,
|
|
|
|
"namespace": "rego-review",
|
|
|
|
},
|
|
|
|
"spec": {
|
|
|
|
"acme": {
|
|
|
|
"config": [
|
|
|
|
{
|
|
|
|
"domains": [
|
|
|
|
domain
|
|
|
|
],
|
|
|
|
"http01": {
|
|
|
|
"ingressClass": "nginx-review"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"commonName": "",
|
|
|
|
"dnsNames": [
|
|
|
|
domain
|
|
|
|
],
|
|
|
|
"issuerRef": {
|
|
|
|
"kind": "ClusterIssuer",
|
|
|
|
"name": "letsencrypt-prod"
|
|
|
|
},
|
|
|
|
"secretName": tls_secret
|
|
|
|
}
|
2018-07-27 23:49:30 +00:00
|
|
|
}
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|