-
Notifications
You must be signed in to change notification settings - Fork 2
/
mysql-openshift-template.yml
160 lines (160 loc) · 4.36 KB
/
mysql-openshift-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
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
apiVersion: v1
kind: Template
labels:
template: ticket-monster-mysql
metadata:
annotations:
description: 'MySQL database service, without persistent storage. WARNING: Any
data stored will be lost upon pod destruction. Only use this template for testing'
iconClass: icon-mysql-database
tags: database,mysql
creationTimestamp: null
name: ticket-monster-mysql
objects:
- apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
name: ${DATABASE_SERVICE_NAME}
spec:
portalIP: ''
ports:
- name: mysql
nodePort: 0
port: 3306
protocol: TCP
targetPort: 3306
selector:
name: ${DATABASE_SERVICE_NAME}
sessionAffinity: None
type: ClusterIP
status:
loadBalancer: {}
- apiVersion: v1
kind: DeploymentConfig
metadata:
creationTimestamp: null
name: ${DATABASE_SERVICE_NAME}
spec:
replicas: 1
selector:
name: ${DATABASE_SERVICE_NAME}
strategy:
type: Recreate
template:
metadata:
creationTimestamp: null
labels:
name: ${DATABASE_SERVICE_NAME}
spec:
containers:
- capabilities: {}
env:
- name: MYSQL_USER
value: ${MYSQL_USER}
- name: MYSQL_PASSWORD
value: ${MYSQL_PASSWORD}
- name: MYSQL_DATABASE
value: ${MYSQL_DATABASE}
- name: "MYSQL_MASTER_USER"
value: "${MYSQL_MASTER_USER}"
- name: "MYSQL_MASTER_PASSWORD"
value: "${MYSQL_MASTER_PASSWORD}"
- name: "MYSQL_ROOT_PASSWORD"
value: "${MYSQL_ROOT_PASSWORD}"
- name: "MYSQL_BINLOG_FORMAT"
value: "ROW"
image: docker.io/centos/mysql-56-centos7:latest
imagePullPolicy: IfNotPresent
command:
- "run-mysqld-master"
livenessProbe:
initialDelaySeconds: 30
tcpSocket:
port: 3306
timeoutSeconds: 1
name: ${DATABASE_SERVICE_NAME}
ports:
- containerPort: 3306
protocol: TCP
resources:
limits:
memory: ${MEMORY_LIMIT}
securityContext:
capabilities: {}
privileged: false
terminationMessagePath: /dev/termination-log
volumeMounts:
- mountPath: /var/lib/mysql/data
name: ${DATABASE_SERVICE_NAME}-data
dnsPolicy: ClusterFirst
restartPolicy: Always
volumes:
- emptyDir:
medium: ''
name: ${DATABASE_SERVICE_NAME}-data
triggers:
- imageChangeParams:
automatic: true
containerNames:
- mysql
from:
kind: ImageStreamTag
name: mysql-56-centos7:latest
namespace: ${NAMESPACE}
lastTriggeredImage: ''
type: ImageChange
- type: ConfigChange
status: {}
parameters:
- description: Maximum amount of memory the container can use.
displayName: Memory Limit
name: MEMORY_LIMIT
value: 512Mi
- description: The OpenShift Namespace where the ImageStream resides.
displayName: Namespace
name: NAMESPACE
value: openshift
- description: The name of the OpenShift Service exposed for the database.
displayName: Database Service Name
name: DATABASE_SERVICE_NAME
required: true
value: mysql
- description: Username for MySQL user that will be used for accessing the database.
displayName: MySQL User
from: user[A-Z0-9]{3}
generate: expression
name: MYSQL_USER
required: true
value: ticket
- description: Password for the MySQL user.
displayName: MySQL Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: MYSQL_PASSWORD
value: monster
- description: Username for MySQL user that will access the database as a slave
displayName: MySQL Master User
from: user[A-Z0-9]{3}
generate: expression
name: MYSQL_MASTER_USER
required: false
value: replicator
- description: Password for the MySQL Masteruser.
displayName: MySQL Master Password
from: '[a-zA-Z0-9]{16}'
generate: expression
name: MYSQL_MASTER_PASSWORD
required: false
value: replpass
- description: Root password
displayName: MySQL Root Password
from: '[a-zA-Z0-9]{16}'
value: admin
name: MYSQL_ROOT_PASSWORD
required: true
- description: Name of the MySQL database accessed.
displayName: MySQL Database Name
name: MYSQL_DATABASE
required: true
value: ticketmonster