diff --git a/Cargo.lock b/Cargo.lock index cc25bf6..c532965 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -459,7 +459,7 @@ dependencies = [ [[package]] name = "hoprd_operator" -version = "0.2.6" +version = "0.2.7" dependencies = [ "async-recursion", "base64", diff --git a/Cargo.toml b/Cargo.toml index 2e57235..e65f240 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "hoprd_operator" -version = "0.2.6" +version = "0.2.7" authors = ["HOPR Association "] edition = "2021" diff --git a/src/constants.rs b/src/constants.rs index 2bb2752..51ba9b4 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -16,7 +16,6 @@ pub const IDENTITY_POOL_WALLET_DEPLOYER_PRIVATE_KEY_REF_KEY: &str = "DEPLOYER_PR pub const IDENTITY_POOL_WALLET_PRIVATE_KEY_REF_KEY: &str = "PRIVATE_KEY"; pub const IDENTITY_POOL_IDENTITY_PASSWORD_REF_KEY: &str = "IDENTITY_PASSWORD"; pub const IDENTITY_POOL_API_TOKEN_REF_KEY: &str = "HOPRD_API_TOKEN"; -pub const IDENTITY_POOL_METRICS_PASSWORD_REF_KEY: &str = "METRICS_PASSWORD"; // Annotations pub const ANNOTATION_LAST_CONFIGURATION: &str = "kubectl.kubernetes.io/last-applied-configuration"; diff --git a/src/hoprd/hoprd_deployment_spec.rs b/src/hoprd/hoprd_deployment_spec.rs index ebfc081..75a00c2 100644 --- a/src/hoprd/hoprd_deployment_spec.rs +++ b/src/hoprd/hoprd_deployment_spec.rs @@ -36,7 +36,7 @@ impl Default for HoprdDeploymentSpec { let mut limits: BTreeMap = BTreeMap::new(); let mut requests: BTreeMap = BTreeMap::new(); limits.insert("cpu".to_owned(), Quantity("1500m".to_owned())); - limits.insert("memory".to_owned(), Quantity("3Gi".to_owned())); + limits.insert("memory".to_owned(), Quantity("2Gi".to_owned())); requests.insert("cpu".to_owned(), Quantity("750m".to_owned())); requests.insert("memory".to_owned(), Quantity("512Mi".to_owned())); let resources_spec = serde_yaml::to_string(&ResourceRequirements { diff --git a/src/identity_pool/identity_pool_resource.rs b/src/identity_pool/identity_pool_resource.rs index a4b7cdb..007d6b0 100644 --- a/src/identity_pool/identity_pool_resource.rs +++ b/src/identity_pool/identity_pool_resource.rs @@ -587,8 +587,7 @@ impl IdentityPool { if let Some(wallet_data) = wallet.data { if wallet_data.contains_key(constants::IDENTITY_POOL_WALLET_DEPLOYER_PRIVATE_KEY_REF_KEY) && wallet_data.contains_key(constants::IDENTITY_POOL_IDENTITY_PASSWORD_REF_KEY) && - wallet_data.contains_key(constants::IDENTITY_POOL_API_TOKEN_REF_KEY) && - wallet_data.contains_key(constants::IDENTITY_POOL_METRICS_PASSWORD_REF_KEY) + wallet_data.contains_key(constants::IDENTITY_POOL_API_TOKEN_REF_KEY) { Ok(true) } else { diff --git a/src/identity_pool/identity_pool_service_monitor.rs b/src/identity_pool/identity_pool_service_monitor.rs index d61986a..65af004 100644 --- a/src/identity_pool/identity_pool_service_monitor.rs +++ b/src/identity_pool/identity_pool_service_monitor.rs @@ -10,10 +10,7 @@ use tracing::info; use crate::context_data::ContextData; use crate::servicemonitor::{ - ServiceMonitorEndpoints, ServiceMonitorEndpointsBasicAuth, - ServiceMonitorEndpointsBasicAuthPassword, ServiceMonitorEndpointsBasicAuthUsername, - ServiceMonitorEndpointsRelabelings, ServiceMonitorEndpointsRelabelingsAction, - ServiceMonitorNamespaceSelector, ServiceMonitorSelector, ServiceMonitorSpec, + ServiceMonitorEndpoints, ServiceMonitorEndpointsBearerTokenSecret, ServiceMonitorEndpointsRelabelings, ServiceMonitorEndpointsRelabelingsAction, ServiceMonitorNamespaceSelector, ServiceMonitorSelector, ServiceMonitorSpec }; use crate::{constants, servicemonitor::ServiceMonitor}; @@ -38,21 +35,14 @@ pub async fn create_service_monitor(context_data: Arc, name: &str, interval: Some("15s".to_owned()), path: Some("/api/v3/node/metrics".to_owned()), port: Some("api".to_owned()), - basic_auth: Some(ServiceMonitorEndpointsBasicAuth { - username: Some(ServiceMonitorEndpointsBasicAuthUsername { - key: constants::IDENTITY_POOL_API_TOKEN_REF_KEY.to_owned(), - name: Some(secret_name.to_owned()), - optional: Some(false), - }), - password: Some(ServiceMonitorEndpointsBasicAuthPassword { - key: constants::IDENTITY_POOL_METRICS_PASSWORD_REF_KEY.to_owned(), - name: Some(secret_name.to_owned()), - optional: Some(false), - }), - }), + basic_auth: None, authorization: None, bearer_token_file: None, - bearer_token_secret: None, + bearer_token_secret: Some(ServiceMonitorEndpointsBearerTokenSecret{ + key: constants::IDENTITY_POOL_API_TOKEN_REF_KEY.to_owned(), + name: Some(secret_name.to_owned()), + optional: Some(false), + }), follow_redirects: None, honor_labels: None, honor_timestamps: None,