2018-06-16 09:05:37 +00:00
|
|
|
function (slug) {
|
2018-06-16 15:19:52 +00:00
|
|
|
|
|
|
|
local app = "symposion-app-" + slug,
|
|
|
|
local namespace = "rego-dev",
|
2018-06-16 09:05:37 +00:00
|
|
|
local domain = slug + ".dev.lca2019.org",
|
|
|
|
|
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": {
|
|
|
|
"app": "symposion-app"
|
|
|
|
},
|
|
|
|
"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": {
|
|
|
|
"app": "symposion-app"
|
|
|
|
},
|
|
|
|
"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": {
|
|
|
|
"app": "symposion-app"
|
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": {
|
|
|
|
"app": "symposion-app"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"strategy": {
|
|
|
|
"rollingUpdate": {
|
|
|
|
"maxSurge": 1,
|
|
|
|
"maxUnavailable": 1
|
|
|
|
},
|
|
|
|
"type": "RollingUpdate"
|
|
|
|
},
|
|
|
|
"template": {
|
|
|
|
"metadata": {
|
|
|
|
"labels": {
|
|
|
|
"app": "symposion-app"
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"image": "asia.gcr.io/linuxconfsydney/symposion_app_2019_dev:" + slug,
|
|
|
|
"imagePullPolicy": "Always",
|
|
|
|
"livenessProbe": {
|
|
|
|
"failureThreshold": 3,
|
|
|
|
"httpGet": {
|
|
|
|
"path": "/admin/login/",
|
|
|
|
"port": 8000,
|
|
|
|
"scheme": "HTTP"
|
|
|
|
},
|
|
|
|
"initialDelaySeconds": 120,
|
|
|
|
"periodSeconds": 10,
|
|
|
|
"successThreshold": 1,
|
|
|
|
"timeoutSeconds": 2
|
|
|
|
},
|
|
|
|
"name": "symposion-app",
|
|
|
|
"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"
|
|
|
|
},
|
|
|
|
"ingress-patch.json": [
|
|
|
|
{
|
|
|
|
"op": "add",
|
|
|
|
"path": "/spec/rules/-",
|
|
|
|
"value": {
|
|
|
|
"host": domain,
|
|
|
|
"http": {
|
|
|
|
"paths": [
|
2018-06-16 09:05:37 +00:00
|
|
|
{
|
2018-06-16 15:19:52 +00:00
|
|
|
"backend": {
|
|
|
|
"serviceName": app,
|
|
|
|
"servicePort": 8000
|
2018-06-16 09:05:37 +00:00
|
|
|
},
|
2018-06-16 15:19:52 +00:00
|
|
|
"path": "/"
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
2018-06-16 15:19:52 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
"op": "add",
|
|
|
|
"path": "/spec/tls/0/hosts/-",
|
|
|
|
"value": domain
|
2018-06-16 09:05:37 +00:00
|
|
|
}
|
|
|
|
],
|
|
|
|
}
|