Skip to content

Commit

Permalink
chore: update kubernetes cluster deployment for new metrics logic
Browse files Browse the repository at this point in the history
  • Loading branch information
yHSJ committed Nov 25, 2024
1 parent c9be536 commit b1f3cd6
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
5 changes: 0 additions & 5 deletions bootstrap/stage2/control-plane.tf
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,6 @@ resource "kubernetes_deployment_v1" "control_plane" {
value = "${local.secret_mount_path}/admin.sk"
}

env {
name = "API_KEY"
value = var.api_key
}

env {
name = "KUBERNETES_NAMESPACE"
value_from {
Expand Down
15 changes: 11 additions & 4 deletions crates/operator/src/custom_resource.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ impl From<Resources> for ResourceRequirements {
)]
#[kube(status = "HydraDoomNodeStatus")]
#[kube(printcolumn = r#"
{"name": "Node State", "jsonPath":".status.nodeState", "type": "string"},
{"name": "Game State", "jsonPath":".status.gameState", "type": "string"},
{"name": "Transactions", "jsonPath":".status.transactions", "type": "string"},
{"name": "Local URI", "jsonPath":".status.localUrl", "type": "string"},
{"name": "Node State", "jsonPath":".status.nodeState", "type": "string"},
{"name": "Game State", "jsonPath":".status.gameState", "type": "string"},
{"name": "Transactions", "jsonPath":".status.transactions", "type": "string"},
{"name": "Local URI", "jsonPath":".status.localUrl", "type": "string"},
{"name": "External URI", "jsonPath": ".status.externalUrl", "type": "string"}
"#)]
#[serde(rename_all = "camelCase")]
Expand Down Expand Up @@ -297,13 +297,20 @@ impl HydraDoomNode {
"localhost".to_string(),
"--port".to_string(),
constants.port.to_string(),
"--admin_key_file".to_string(),
format!("{}/admin.sk", constants.secret_dir),
]),
ports: Some(vec![ContainerPort {
name: Some("metrics".to_string()),
container_port: constants.metrics_port,
protocol: Some("TCP".to_string()),
..Default::default()
}]),
env: Some(vec![EnvVar {
name: "API_KEY".to_string(),
value: Some(config.api_key.clone()),
value_from: None,
}]),
..Default::default()
},
Container {
Expand Down

0 comments on commit b1f3cd6

Please sign in to comment.