forked from brysontyrrell/PatchServer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdeploy.template.yml
93 lines (93 loc) · 2.01 KB
/
deploy.template.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
apiVersion: v1
kind: Secret
metadata:
name: registry-auth
namespace: ${CI_PROJECT_PATH_SLUG}
data:
.dockerconfigjson: ${REGISTRY_AUTH}
type: kubernetes.io/dockerconfigjson
---
apiVersion: v1
kind: Secret
metadata:
name: database-uri
namespace: ${CI_PROJECT_PATH_SLUG}
data:
uri: ${SQLALCHEMY_DATABASE_URI_BASE64}
type: Opaque
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
namespace: ${CI_PROJECT_PATH_SLUG}
labels:
app: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
spec:
replicas: 1
selector:
matchLabels:
app: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
template:
metadata:
labels:
app: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
spec:
containers:
- name: ${CI_PROJECT_PATH_SLUG}
image: ${CI_REGISTRY_IMAGE}:${IMAGE}
env:
- name: SQLALCHEMY_DATABASE_URI
valueFrom:
secretKeyRef:
name: database-uri
key: uri
imagePullSecrets:
- name: registry-auth
---
apiVersion: v1
kind: Service
metadata:
labels:
name: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
namespace: ${CI_PROJECT_PATH_SLUG}
spec:
clusterIP: None
ports:
- name: default
port: 5000
protocol: TCP
targetPort: 5000
selector:
app: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
sessionAffinity: None
type: ClusterIP
---
apiVersion: v1
data:
auth: ${NGINX_BASIC_AUTH}
kind: Secret
metadata:
name: basic-auth
namespace: ${CI_PROJECT_PATH_SLUG}
type: Opaque
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
namespace: ${CI_PROJECT_PATH_SLUG}
annotations:
nginx.ingress.kubernetes.io/whitelist-source-range: ${WHITELIST_SOURCE_RANGE}
spec:
rules:
- host: ${FQDN}
http:
paths:
- backend:
serviceName: ${CI_PROJECT_PATH_SLUG}-${CI_BUILD_REF_NAME}
servicePort: 5000
tls:
- hosts:
- ${FQDN}
secretName: ${TLS_SECRET_NAME}