Skip to content

Commit a056032

Browse files
authored
feat: expose the flight-sql port (#206)
1 parent 98a7606 commit a056032

35 files changed

+294
-47
lines changed

common/src/peer_info.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ pub struct CeramicPeerInfo {
5757
pub ipfs_rpc_addr: String,
5858
/// Ceramic API address of the peer.
5959
pub ceramic_addr: String,
60+
/// Flight SQL API address of the peer.
61+
pub flight_addr: String,
6062
/// Set of p2p addresses of the peer.
6163
/// Each address contains the /p2p/<peer_id> protocol.
6264
pub p2p_addrs: Vec<String>,

operator/src/network/ceramic.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ use crate::{
3434
};
3535

3636
use super::{
37-
controller::CERAMIC_ONE_SWARM_PORT, debug_mode_security_context,
37+
controller::{CERAMIC_ONE_FLIGHT_SQL_PORT, CERAMIC_ONE_SWARM_PORT},
38+
debug_mode_security_context,
3839
storage::PersistentStorageConfig,
3940
};
4041

@@ -124,6 +125,12 @@ pub fn service_spec() -> ServiceSpec {
124125
protocol: Some("TCP".to_owned()),
125126
..Default::default()
126127
},
128+
ServicePort {
129+
port: CERAMIC_ONE_FLIGHT_SQL_PORT,
130+
name: Some("flight".to_owned()),
131+
protocol: Some("TCP".to_owned()),
132+
..Default::default()
133+
},
127134
ServicePort {
128135
port: CERAMIC_ONE_SWARM_PORT,
129136
name: Some("swarm-tcp".to_owned()),
@@ -251,6 +258,13 @@ impl CeramicInfo {
251258
self.stateful_set, self.service
252259
)
253260
}
261+
/// Determine the Flight SQL address of a Ceramic peer
262+
pub fn flight_addr(&self, ns: &str, peer: i32) -> String {
263+
format!(
264+
"http://{}-{peer}.{}.{ns}.svc.cluster.local:{CERAMIC_ONE_FLIGHT_SQL_PORT}",
265+
self.stateful_set, self.service
266+
)
267+
}
254268
}
255269

256270
impl From<&CeramicInfo> for IpfsInfo {

operator/src/network/controller.rs

Lines changed: 112 additions & 44 deletions
Large diffs are not rendered by default.

operator/src/network/ipfs.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use crate::{
2222
};
2323

2424
use super::{
25-
controller::{CERAMIC_ONE_IPFS_PORT, CERAMIC_ONE_SWARM_PORT},
25+
controller::{CERAMIC_ONE_FLIGHT_SQL_PORT, CERAMIC_ONE_IPFS_PORT, CERAMIC_ONE_SWARM_PORT},
2626
debug_mode_security_context,
2727
};
2828

@@ -243,6 +243,12 @@ impl RustIpfsConfig {
243243
protocol: Some("TCP".to_owned()),
244244
..Default::default()
245245
},
246+
ContainerPort {
247+
container_port: CERAMIC_ONE_FLIGHT_SQL_PORT,
248+
name: Some("flight".to_owned()),
249+
protocol: Some("TCP".to_owned()),
250+
..Default::default()
251+
},
246252
ContainerPort {
247253
container_port: 9465,
248254
name: Some("metrics".to_owned()),

operator/src/network/testdata/ceramic_go_svc_1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,11 @@ Request {
2929
"port": 5101,
3030
"protocol": "TCP"
3131
},
32+
{
33+
"name": "flight",
34+
"port": 5102,
35+
"protocol": "TCP"
36+
},
3237
{
3338
"name": "swarm-tcp",
3439
"port": 4101,

operator/src/network/testdata/ceramic_ss_1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ Request {
274274
"name": "rpc",
275275
"protocol": "TCP"
276276
},
277+
{
278+
"containerPort": 5102,
279+
"name": "flight",
280+
"protocol": "TCP"
281+
},
277282
{
278283
"containerPort": 9465,
279284
"name": "metrics",

operator/src/network/testdata/ceramic_ss_weighted_0

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ Request {
274274
"name": "rpc",
275275
"protocol": "TCP"
276276
},
277+
{
278+
"containerPort": 5102,
279+
"name": "flight",
280+
"protocol": "TCP"
281+
},
277282
{
278283
"containerPort": 9465,
279284
"name": "metrics",

operator/src/network/testdata/ceramic_ss_weighted_1

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ Request {
274274
"name": "rpc",
275275
"protocol": "TCP"
276276
},
277+
{
278+
"containerPort": 5102,
279+
"name": "flight",
280+
"protocol": "TCP"
281+
},
277282
{
278283
"containerPort": 9465,
279284
"name": "metrics",

operator/src/network/testdata/ceramic_ss_weighted_2

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ Request {
274274
"name": "rpc",
275275
"protocol": "TCP"
276276
},
277+
{
278+
"containerPort": 5102,
279+
"name": "flight",
280+
"protocol": "TCP"
281+
},
277282
{
278283
"containerPort": 9465,
279284
"name": "metrics",

operator/src/network/testdata/ceramic_ss_weighted_3

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ Request {
274274
"name": "rpc",
275275
"protocol": "TCP"
276276
},
277+
{
278+
"containerPort": 5102,
279+
"name": "flight",
280+
"protocol": "TCP"
281+
},
277282
{
278283
"containerPort": 9465,
279284
"name": "metrics",

0 commit comments

Comments
 (0)