storcon: use https safekeeper api (#11065)

## Problem

Storage controller uses http for requests to safekeeper management API.

Closes: https://github.com/neondatabase/cloud/issues/24835

## Summary of changes
- Add `use_https_safekeeper_api` option to storcon to use https api
- Use https for requests to safekeeper management API if this option is
enabled
- Add `ssl_ca_file` option to storcon for ability to specify custom root
CA certificate
This commit is contained in:
Dmitrii Kovalkov
2025-03-07 21:22:47 +04:00
committed by GitHub
parent 87e6117dfd
commit e876794ce5
14 changed files with 193 additions and 63 deletions

View File

@@ -1,7 +1,6 @@
use std::str::FromStr;
use std::time::Duration;
use anyhow::anyhow;
use pageserver_api::controller_api::{
AvailabilityZone, NodeAvailability, NodeDescribeResponse, NodeRegisterRequest,
NodeSchedulingPolicy, TenantLocateResponseShard,
@@ -211,7 +210,10 @@ impl Node {
use_https: bool,
) -> anyhow::Result<Self> {
if use_https && listen_https_port.is_none() {
return Err(anyhow!("https is enabled, but node has no https port"));
anyhow::bail!(
"cannot create node {id}: \
https is enabled, but https port is not specified"
);
}
Ok(Self {
@@ -244,7 +246,11 @@ impl Node {
pub(crate) fn from_persistent(np: NodePersistence, use_https: bool) -> anyhow::Result<Self> {
if use_https && np.listen_https_port.is_none() {
return Err(anyhow!("https is enabled, but node has no https port"));
anyhow::bail!(
"cannot load node {} from persistent: \
https is enabled, but https port is not specified",
np.node_id,
);
}
Ok(Self {