cbio-setup.yml 5.83 KB
Newer Older
Ľuboslav Pivarč's avatar
init  
Ľuboslav Pivarč committed
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
apiVersion: v1
kind: Namespace
metadata:
  name: cbio-on-demand

---

apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: cbio-on-demand
  name: cbio-api
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
  selector:
    matchLabels:
      app: cbio-api
      type: ondemand
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: cbio-api
        type: ondemand
    spec:
      serviceAccountName: cbio-api
      containers:
      - name: cbio-api
Ľuboslav Pivarč's avatar
Ľuboslav Pivarč committed
34
        image: lpivo/api:tr7
Ľuboslav Pivarč's avatar
init  
Ľuboslav Pivarč committed
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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
        ports:
        - name: http
          containerPort: 8080
        livenessProbe:
          httpGet:
            path: /actuator/health
            port: http
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 2
        readinessProbe:
          httpGet:
            path: /actuator/health
            port: http
          initialDelaySeconds: 1
          periodSeconds: 10
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 2

---

apiVersion: v1
kind: Service
metadata:
  name: cbio-api
  namespace: cbio-on-demand
  labels:
    app: cbio-api
    type: ondemand
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
  selector:
    app: cbio-api
    type: ondemand
  ports:
  - port: 80
    targetPort: http

---

apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
  name: identifiers.example.com
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
  scope: Namespaced
  group: example.com
  version: v1beta1
  names:
    kind: identifier
    singular: identifier
    plural: identifiers

---

apiVersion: v1
kind: ConfigMap
metadata:
  name: mysql-cbio-db
  namespace: cbio-on-demand
data:
  mysql.conf: "# Copyright (c) 2014, 2016, Oracle and/or its affiliates. All rights
    reserved.\n#\n# This program is free software; you can redistribute it and/or
    modify\n# it under the terms of the GNU General Public License as published
    by\n# the Free Software Foundation; version 2 of the License.\n#\n# This program
    is distributed in the hope that it will be useful,\n# but WITHOUT ANY WARRANTY;
    without even the implied warranty of\n# MERCHANTABILITY or FITNESS FOR A PARTICULAR
    PURPOSE.  See the\n# GNU General Public License for more details.\n#\n# You
    should have received a copy of the GNU General Public License\n# along with
    this program; if not, write to the Free Software\n# Foundation, Inc., 51 Franklin
    St, Fifth Floor, Boston, MA  02110-1301 USA\n\n#\n# The MySQL  Server configuration
    file.\n#\n# For explanations see\n# http://dev.mysql.com/doc/mysql/en/server-system-variables.html\n\n[mysqld]\npid-file\t=
    /var/run/mysqld/mysqld.pid\nsocket\t\t= /var/run/mysqld/mysqld.sock\ndatadir\t\t=
    /var/lib/mysql\n#log-error\t= /var/log/mysql/error.log\n# By default we only
    accept connections from localhost\n#bind-address\t= 127.0.0.1\n# Disabling symbolic-links
    is recommended to prevent assorted security risks\nsymbolic-links=0\n\n#\n#
    * Fine Tuning\n#\n\nkey_buffer_size         = 4G\nmax_heap_table_size     =
    512M\ntmp_table_size          = 512M\nmax_allowed_packet      = 256M\nthread_stack
    \           = 256K\nthread_cache_size       = 20\n# This replaces the startup
    script and checks MyISAM tables if needed\n# the first time they are touched\nmyisam-recover-options
    \ = BACKUP\nmax_connections        = 214\n#table_cache            = 64\n#thread_concurrency
    \    = 10\n#\n# * Query Cache Configuration\n#\nquery_cache_limit       = 1M\nquery_cache_size
    \       = 0\nquery_cache_type        = 0\n\n\njoin_buffer_size = 16M\ntable_open_cache
    = 400\n"

---

apiVersion: v1
kind: Secret
metadata:
  name: mysql-env
  namespace: cbio-on-demand
data:
  .env: TVlTUUxfUk9PVF9QQVNTV09SRD1QQHNzd29yZDEKTVlTUUxfVVNFUj1jYmlvCk1ZU1FMX1BBU1NXT1JEPVBAc3N3b3JkMQpNWVNRTF9EQVRBQkFTRT1jYmlvcG9ydGFsCgo=
type: Opaque

---

apiVersion: apps/v1
kind: Deployment
metadata:
  namespace: cbio-on-demand
  name: cbio-proxy
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
  selector:
    matchLabels:
        app: cbio-proxy
        type: ondemand
  strategy:
    rollingUpdate:
      maxSurge: 1
      maxUnavailable: 0
    type: RollingUpdate
  template:
    metadata:
      labels:
        app: cbio-proxy
        type: ondemand
    spec:
      containers:
      - name: cbio-proxy
        image: lpivo/k8s-saml:t6
        ports:
        - name: http
          containerPort: 80
        - name: api
          containerPort: 5000
        livenessProbe:
          httpGet:
            path: /
            port: http
          initialDelaySeconds: 10
          periodSeconds: 10
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 3
        readinessProbe:
          httpGet:
            path: /
            port: http
          initialDelaySeconds: 1
          periodSeconds: 10
          timeoutSeconds: 1
          successThreshold: 1
          failureThreshold: 2
        env:
        - name: SERVERNAME
          value: cbiood.edirex.ics.muni.cz
        - name: EMAILADMIN
          value: 456130@mail.muni.cz

---

apiVersion: v1
kind: Service
metadata:
  name: cbio-proxy-api
  namespace: cbio-on-demand
  labels:
    app: cbio-proxy
    type: ondemand
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
  selector:
    app: cbio-proxy
    type: ondemand
  ports:
  - port: 80
    targetPort: api

---


apiVersion: v1
kind: Service
metadata:
  name: cbio-proxy
  namespace: cbio-on-demand
  labels:
    app: cbio-proxy
    type: ondemand
  annotations:
    maintainer: Luboslav Pivarc <456130@muni.cz>
spec:
  selector:
    app: cbio-proxy
    type: ondemand
  ports:
  - port: 80
    targetPort: http