Skip to content

Port DEV-1224 installer hardening and cleanup from terraform-oci-red5pro - #31

Open
iolesyk wants to merge 2 commits into
masterfrom
feature/DEV-1224
Open

Port DEV-1224 installer hardening and cleanup from terraform-oci-red5pro#31
iolesyk wants to merge 2 commits into
masterfrom
feature/DEV-1224

Conversation

@iolesyk

@iolesyk iolesyk commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

Kafka/Stream Manager 2.0 installer hardening + main.tf cleanup. No intended behavior change outside the fixes listed below.

  • Fix: docker compose up failing with as-kafka-init is missing dependency kafka0 on every "autoscale" deployment (KAFKA_REPLICAS=0).
  • Fix: Docker install stalling/failing on boot when the OCI VCN DNS resolver is slow — added a Google DNS fallback to all three installer scripts, running before apt/curl instead of too late to help.
  • Merged the duplicated with-ssl/without-ssl SM2.0 docker-compose files into one base + a small SSL override.
  • Synced r5p_create_node_group.sh with a newer reference script (Mixer role, CPU-based autoscaling
  • Cleaned up main.tf: deduped repeated connection {}/env blocks, dropped dead code, batched .env writes.

Breaking changes

  • Removed variables: node_group_origins_connection_limit, node_group_edges_connection_limit, node_group_transcoders_connection_limit, node_config_restreamer, stream_manager_admin_ui_version. Remove these from .tfvars before applying, or terraform apply will error.

Ports the same batch of fixes/cleanup applied to the Oracle module's
feature/DEV-1224 branch, adapted for GCP:

- Fix SM2.0 as-kafka-init missing dependency on kafka0 with KAFKA_REPLICAS=0
- Merge with-ssl/without-ssl docker-compose files into base + ssl override
- Sync r5p_create_node_group.sh with newer reference version (Mixer role,
  CPU-based scaling, DO/OPENSTACK platforms; no Video Packager)
- Remove dead Restreamer/RMQ/Analytics node-group propertyOverrides and
  their orphaned Terraform variables (node_group_*_connection_limit,
  node_config_restreamer)
- Add Google DNS fallback to installer scripts so apt/curl don't stall
  when the cloud provider's default resolver is slow right after boot
- Suppress secret values (SSL keys, Kafka SASL config) from remote-exec
  console output
- main.tf cleanup: dedupe connection {} blocks, simplify locals, batch
  .env writes where the same duplication existed in this module
- AS_ADMIN_UI_VERSION now sources from stream_manager_version; removed
  the now-unused stream_manager_admin_ui_version variable
- Fixed install_google_cloud_ops_agent() to be set -e safe now that
  r5p_kafka_install.sh runs under set -euo pipefail

See the CHANGES-installer-hardening.md changelog for the full rationale
behind each change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…cope

Port the changes from terraform-oci-red5pro. The Let's Encrypt path was
broken here: r5p_ssl_check_sm2.sh still looked for
autoscaling-with-ssl/docker-compose.yml, a directory that no longer exists
since the compose files were merged into a base plus docker-compose.ssl.yml
overlay, so the script exited instead of ever enabling TLS.

r5p_ssl_check_sm2.sh:
- Layer docker-compose.ssl.yml from the installer directory and build
  COMPOSE_FILE from the value already in .env, preserving any other overlay
  and staying idempotent. Do not delete the base compose file: it is the
  first entry of COMPOSE_FILE and the following restart needs it.
- Wait for TRAEFIK_HOST, the FQDN Traefik serves and the ACME tls-challenge
  validates, rather than for the certificate identity, which may be a
  wildcard that never resolves.
- Resolve through the zone's authoritative name server. Polling starts before
  the operator creates the A record, so the first lookup cached an NXDOMAIN
  for the SOA negative TTL and hid the record long after it existed.
- Replace the fixed five minute sleep with a readiness gate on the admin
  health endpoint, requiring consecutive successes. Restarting while docker
  compose was still starting the stack corrupted it.
- Report whether the stack actually serves HTTPS after the restart.

r5p_ssl_check_install.sh:
- Same authoritative name server resolution for the standalone certbot path,
  where a cached NXDOMAIN also delayed certificate issuance.

Installer and terraform:
- Gate the Let's Encrypt path on TRAEFIK_HOST instead of SM_SSL_DOMAIN, and
  stop exporting SM_SSL_DOMAIN, which nothing consumes any more.
- Reject https_ssl_certificate=letsencrypt for type=autoscale with a precondition on the load balancer resource -
  the GCP load balancer only gets an SSL certificate for imported or existing certificates, so the ACME challenge can never complete.

Docs:
- https_ssl_certificate_domain_name documented for the scenarios where it is
  actually read. Remove it from the cluster and autoscale examples where it
  is unused, and drop the wildcard claim where the challenge type cannot
  issue one.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant