This repository has been archived by the owner on Nov 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
standalone_template.yaml
113 lines (113 loc) · 2.78 KB
/
standalone_template.yaml
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
apiVersion: v1
kind: Template
metadata:
name: maxscale-standalone
objects:
- apiVersion: v1
kind: Secret
metadata:
name: ${NAME}
stringData:
service-password: ${MAXSCALE_SERVICE_PW}
monitor-password: ${MAXSCALE_MONITOR_PW}
- apiVersion: v1
kind: Service
metadata:
name: ${NAME}
spec:
ports:
- name: master-only
port: 3306
targetPort: 3306
- name: read-write
port: 3307
targetPort: 3307
selector:
name: ${NAME}
- apiVersion: v1
kind: DeploymentConfig
metadata:
annotations:
template.alpha.openshift.io/wait-for-ready: "true"
name: ${NAME}
spec:
replicas: ${{REPLICA_COUNT}}
selector:
name: ${NAME}
template:
metadata:
labels:
name: ${NAME}
name: ${NAME}
spec:
containers:
- name: maxscale
image: docker.io/appuio/maxscale-docker:2.2.1-beta-4
env:
- name: MASTER_ONLY_LISTEN_ADDRESS
value: 0.0.0.0
- name: READ_WRITE_LISTEN_ADDRESS
value: 0.0.0.0
- name: DB1_ADDRESS
value: ${DB1_ADDRESS}
- name: DB2_ADDRESS
value: ${DB2_ADDRESS}
- name: DB3_ADDRESS
value: ${DB3_ADDRESS}
- name: SERVICE_PWD
valueFrom:
secretKeyRef:
name: ${NAME}
key: service-password
- name: MONITOR_PWD
valueFrom:
secretKeyRef:
name: ${NAME}
key: monitor-password
ports:
- name: master-only
containerPort: 3306
- name: read-write
containerPort: 3307
livenessProbe:
tcpSocket:
port: master-only
initialDelaySeconds: 3
periodSeconds: 3
readinessProbe:
tcpSocket:
port: master-only
initialDelaySeconds: 3
periodSeconds: 3
resources:
limits:
memory: 128Mi
requests:
memory: 128Mi
triggers:
- type: ConfigChange
parameters:
- description: The name assigned to all of the objects defined in this template.
displayName: Name
name: NAME
required: true
value: maxscale
- description: The password for the maxscale service user
name: MAXSCALE_SERVICE_PW
required: true
- description: The password for the maxscale monitor user
name: MAXSCALE_MONITOR_PW
required: true
- description: The for the first backend DB
name: DB1_ADDRESS
required: true
- description: The for the second backend DB
name: DB2_ADDRESS
required: true
- description: The for the third backend DB
name: DB3_ADDRESS
required: true
- description: Number of replicas
name: REPLICA_COUNT
value: "2"
required: true