Skip to content

Commit 51df175

Browse files
committed
interim
1 parent cb89c39 commit 51df175

File tree

12 files changed

+43
-39
lines changed

12 files changed

+43
-39
lines changed

kubernetes/certs/redis.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,16 @@ spec:
1515
- digital signature
1616
- key encipherment
1717
- server auth
18+
- client auth
1819
subject:
1920
organizations:
2021
- redis
2122
commonName: redis
23+
dnsNames:
24+
- redisproxy
25+
- redis-0.redis
26+
- redis-1.redis
27+
- redis-2.redis
2228
issuerRef:
2329
name: ca-issuer
2430
kind: Issuer

kubernetes/certs/redisproxy.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ spec:
1515
- digital signature
1616
- key encipherment
1717
- server auth
18+
- client auth
1819
subject:
1920
organizations:
2021
- redisproxy

kubernetes/certs/sentinel.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ spec:
1515
- digital signature
1616
- key encipherment
1717
- server auth
18+
- client auth
1819
subject:
1920
organizations:
2021
- sentinel

kubernetes/kub-down

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ kubectl delete \
88
-f certs/mysql-replication.yaml \
99
-f certs/mysql-openemr-client.yaml \
1010
-f certs/phpmyadmin.yaml \
11-
-f certs/mysql-phpmyadmin-client.yaml
11+
-f certs/mysql-phpmyadmin-client.yaml \
1212
-f certs/redis.yaml \
1313
-f certs/redis-openemr-client.yaml \
1414
-f certs/sentinel.yaml \

kubernetes/kub-down.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ kubectl delete ^
88
-f certs/mysql-replication.yaml ^
99
-f certs/mysql-openemr-client.yaml ^
1010
-f certs/phpmyadmin.yaml ^
11-
-f certs/mysql-phpmyadmin-client.yaml
11+
-f certs/mysql-phpmyadmin-client.yaml ^
1212
-f certs/redis.yaml ^
1313
-f certs/redis-openemr-client.yaml ^
1414
-f certs/sentinel.yaml ^

kubernetes/kub-up

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ kubectl apply \
1313
-f certs/mysql-replication.yaml \
1414
-f certs/mysql-openemr-client.yaml \
1515
-f certs/phpmyadmin.yaml \
16-
-f certs/mysql-phpmyadmin-client.yaml
16+
-f certs/mysql-phpmyadmin-client.yaml \
1717
-f certs/redis.yaml \
1818
-f certs/redis-openemr-client.yaml \
1919
-f certs/sentinel.yaml \

kubernetes/kub-up.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ kubectl apply ^
1111
-f certs/mysql-replication.yaml ^
1212
-f certs/mysql-openemr-client.yaml ^
1313
-f certs/phpmyadmin.yaml ^
14-
-f certs/mysql-phpmyadmin-client.yaml
14+
-f certs/mysql-phpmyadmin-client.yaml ^
1515
-f certs/redis.yaml ^
1616
-f certs/redis-openemr-client.yaml ^
1717
-f certs/sentinel.yaml ^

kubernetes/openemr/deployment.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,11 @@ spec:
4646
key: admin-pass
4747
- name: OE_USER
4848
value: "admin"
49+
- name: PHPREDIS_BUILD
50+
value: "e571a81f8d3009aab38cbb88dde865edeb0607ac"
4951
- name: REDIS_SERVER
5052
# TODO - change below back to redisproxy after get the proxy working
51-
value: "redis"
53+
value: "redis-0.redis"
5254
- name: REDIS_PASSWORD
5355
value: "defaultpassword"
5456
- name: REDIS_TLS

kubernetes/redis/configmap-pipy.yaml

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ data:
77
{
88
"redisAdminUser" : "admin",
99
"redisAdminPass" : "adminpassword",
10-
"caCert" : "certs/ca.crt",
11-
"tlsKey" : "certs/tls.key",
1210
"debug" : true,
1311
"port" : 6379,
1412
"servers" : ["redis-0.redis:6379", "redis-1.redis:6379", "redis-2.redis:6379"],
13+
"caCert" : "certs/ca.crt",
14+
"tlsKey" : "certs/tls.key",
1515
"connectTimeout" : "1s",
1616
"readTimeout" : "1s",
1717
"healthcheck" : {
@@ -36,21 +36,14 @@ data:
3636
_check: resp => (
3737
(data, role) => (
3838
unhealthy_nodes.remove(_target),
39+
config.debug && console.log(`Response data: ${resp.toString()}`),
3940
data = resp.shift(40).toString().split('\r\n'),
4041
role = data[3].split(':')[1],
4142
config.debug && console.log(`Role is ${role} for ${_target}`),
4243
role === 'master' && unhealthy_master.remove(_target)
4344
))()
4445
})
45-
.listen(config.port)
46-
.acceptTLS({
47-
certificate: {
48-
cert: new crypto.Certificate(pipy.load(config.caCert)),
49-
key: new crypto.PrivateKey(pipy.load(config.tlsKey))
50-
}
51-
}).to('preconnection')
52-
53-
.pipeline('preconnection')
46+
.listen(config.port)
5447
.handleData(
5548
(data, query, command, master_only) => (
5649
query = new Data(data).shift(20).toString(),
@@ -73,14 +66,6 @@ data:
7366
config.debug && console.log(`Sending request to node ${_target}`)
7467
)
7568
)
76-
.connectTLS({
77-
certificate: {
78-
cert: new crypto.Certificate(pipy.load(config.caCert)),
79-
key: new crypto.PrivateKey(pipy.load(config.tlsKey))
80-
}
81-
}).to('sendconnection')
82-
83-
.pipeline('sendconnection')
8469
.connect(() => _target,
8570
{
8671
connectTimeout: config.connectTimeout,
@@ -103,8 +88,7 @@ data:
10388
unhealthy_nodes.set(t, true),
10489
unhealthy_master.set(t, true)
10590
)),
106-
_counter = { n: 0 },
107-
console.log(`Debug 0`)
91+
_counter = { n: 0 }
10892
)
10993
)
11094
.fork('per-node',
@@ -115,23 +99,22 @@ data:
11599
.wait(
116100
() => _counter.n === 0
117101
)
118-
102+
119103
.pipeline('per-node')
120104
.replaceMessage(
121105
() => (
122106
_counter.n++,
123-
new Message(`AUTH ${config.redisAdminUser} ${config.redisAdminPass}\r\ninfo replication\r\n`),
124-
console.log(`Debug 1`)
107+
new Message(`AUTH ${config.redisAdminUser} ${config.redisAdminPass}\r\ninfo replication\r\n`)
125108
)
126109
)
127110
.connectTLS({
128111
certificate: {
129112
cert: new crypto.Certificate(pipy.load(config.caCert)),
130113
key: new crypto.PrivateKey(pipy.load(config.tlsKey))
131114
}
132-
}).to('healthconnection')
133-
134-
.pipeline('healthconnection')
115+
}).to('sendconnection')
116+
117+
.pipeline('sendconnection')
135118
.connect(
136119
() => _target,
137120
{
@@ -140,8 +123,7 @@ data:
140123
}
141124
)
142125
.handleData(
143-
data => _check(data),
144-
console.log(`Debug 2`)
126+
data => _check(data)
145127
)
146128
.handleStreamEnd(
147129
() => _counter.n--

kubernetes/redis/deployment-redisproxy.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
- env:
3838
- name: PIPY_CONFIG_FILE
3939
value: /proxy/proxy.js
40-
image: naqvis/pipy-worker:0.70.0-2-33-g1164e36
40+
image: naqvis/pipy:0.40.0-rc3-37-ga91d1a0
4141
name: redisproxy
4242
volumeMounts:
4343
- name: redisproxy-certs
@@ -61,4 +61,4 @@ spec:
6161
path: tls.key
6262
- name: redisproxyconf
6363
configMap:
64-
name: pipy-config
64+
name: pipy-config

0 commit comments

Comments
 (0)