Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion internal/cmd/sentinel.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func init() {
sentinelCmd.Flags().DurationVar(&sentinelCheckInterval, "check-interval", 15*time.Second, "Health check interval")
sentinelCmd.Flags().IntVar(&sentinelHTTPPort, "http-port", 80, "Maintenance page HTTP port")
sentinelCmd.Flags().IntVar(&sentinelHTTPSPort, "https-port", 443, "Maintenance page HTTPS port")
sentinelCmd.Flags().StringVar(&sentinelForwardedPorts, "forwarded-ports", "80,443,8080,50051", "Comma-separated ports to DNAT forward (port 22 handled by sshpiper)")
sentinelCmd.Flags().StringVar(&sentinelForwardedPorts, "forwarded-ports", "80,443", "Comma-separated ports to DNAT forward (port 22 handled by sshpiper)")
sentinelCmd.Flags().IntVar(&sentinelHealthyThreshold, "healthy-threshold", 2, "Consecutive healthy checks before switching to proxy")
sentinelCmd.Flags().IntVar(&sentinelUnhealthyThreshold, "unhealthy-threshold", 2, "Consecutive unhealthy checks before switching to maintenance")
sentinelCmd.Flags().IntVar(&sentinelBinaryPort, "binary-port", 8888, "Port to serve containarium binary for spot VM downloads (0 to disable)")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Example: Production Consumer (kafeido-infra style)
# =============================================================================
# This example shows how a production deployment (e.g., kafeido-infra) would
# consume the containarium module with VPC networking and GLB backend.
# consume the containarium module with VPC networking.
#
# Copy and adapt this for your production environment.

Expand Down Expand Up @@ -51,8 +51,6 @@ module "containarium" {

# Production features
enable_iap_firewall = true
enable_health_check_firewall = true
enable_glb_backend = true
jwt_secret = var.jwt_secret
fail2ban_whitelist_cidr = "10.0.0.0/8"
instance_tags = ["containarium-jump-server-usw1", "containarium-sentinel"]
Expand Down Expand Up @@ -172,6 +170,3 @@ output "jump_server_ip" {
value = module.containarium.jump_server_ip
}

output "sentinel_instance_group" {
value = module.containarium.sentinel_instance_group
}
18 changes: 0 additions & 18 deletions terraform/modules/containarium/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,6 @@ resource "google_compute_firewall" "allow_iap_ssh" {
description = "Allow IAP SSH tunneling to Containarium instances"
}

# Health check firewall (for GCP load balancer health checks)
resource "google_compute_firewall" "allow_health_check" {
count = var.enable_health_check_firewall ? 1 : 0
name = "${var.instance_name}-allow-health-check"
network = local.network
project = var.project_id

allow {
protocol = "tcp"
ports = ["8080", "22"]
}

source_ranges = ["130.211.0.0/22", "35.191.0.0/16"]
target_tags = var.instance_tags

description = "Allow GCP health check probes to Containarium instances"
}

# -----------------------------------------------------------------------------
# Regular (non-spot) VM Instance
# -----------------------------------------------------------------------------
Expand Down
5 changes: 0 additions & 5 deletions terraform/modules/containarium/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,6 @@ output "sentinel_instance_self_link" {
value = local.use_sentinel ? google_compute_instance.sentinel[0].self_link : null
}

output "sentinel_instance_group" {
description = "Self link of the sentinel unmanaged instance group (for GLB)"
value = local.use_sentinel && var.enable_glb_backend ? google_compute_instance_group.sentinel[0].self_link : null
}

output "spot_vm_name" {
description = "Name of the spot VM"
value = var.use_spot_instance ? google_compute_instance.jump_server_spot[0].name : null
Expand Down
27 changes: 1 addition & 26 deletions terraform/modules/containarium/sentinel.tf
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ resource "google_compute_firewall" "sentinel_to_spot" {

allow {
protocol = "tcp"
ports = ["22", "80", "443", "8080", "50051"]
ports = ["22", "80", "443", "8080"]
}

source_tags = ["containarium-sentinel"]
Expand Down Expand Up @@ -167,28 +167,3 @@ resource "google_compute_firewall" "sentinel_mgmt_ssh" {
description = "Allow SSH management to sentinel on port 2222 (port 22 handled by sshpiper)"
}

# -----------------------------------------------------------------------------
# Optional: Unmanaged Instance Group for GLB backend
# -----------------------------------------------------------------------------

resource "google_compute_instance_group" "sentinel" {
count = local.use_sentinel && var.enable_glb_backend ? 1 : 0

name = "${var.instance_name}-sentinel-group"
zone = var.zone
project = var.project_id

instances = [
google_compute_instance.sentinel[0].self_link,
]

named_port {
name = "http"
port = 8080
}

named_port {
name = "ssh"
port = 22
}
}
12 changes: 0 additions & 12 deletions terraform/modules/containarium/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,6 @@ variable "enable_iap_firewall" {
default = false
}

variable "enable_health_check_firewall" {
description = "Create firewall rule for GCP health check IP ranges"
type = bool
default = false
}

variable "enable_glb_backend" {
description = "Create unmanaged instance group with named ports for GLB"
type = bool
default = false
}

variable "spot_vm_external_ip" {
description = "Give spot VM an ephemeral external IP (false = Cloud NAT only)"
type = bool
Expand Down
Loading