feat: OCI deployment — Terraform VM + OKE stacks, OCIR, K8s manifests
- terraform-vm/: ARM VM (A1.Flex Free Tier), Docker Compose, Block Volume, LB+WAF+SSL - terraform-oke/: OKE cluster (3 nodes Intel), NodePort, LB+WAF+SSL - k8s/: namespace, deployments, services, PVC, secrets, configmap - Dockerfile.frontend: self-contained nginx+dist image - push-images.sh: multi-arch build (amd64+arm64) + push to OCIR - dns.tf: conditional OCI DNS Zone + A record (when domain available) - Both stacks 100% independent, no shared modules - .gitignore: terraform state, .terraform/, *.tfvars
This commit is contained in:
198
deploy/terraform-oke/variables.tf
Normal file
198
deploy/terraform-oke/variables.tf
Normal file
@@ -0,0 +1,198 @@
|
||||
# -----------------------------------------------------------------------------
|
||||
# OCI Authentication
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "tenancy_ocid" {
|
||||
description = "OCID of the OCI tenancy"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "user_ocid" {
|
||||
description = "OCID of the OCI user for API authentication"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "fingerprint" {
|
||||
description = "Fingerprint of the OCI API signing key"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "private_key_path" {
|
||||
description = "Path to the OCI API private key PEM file"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
description = "OCI region for deployment"
|
||||
type = string
|
||||
default = "us-ashburn-1"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Compartment
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "compartment_ocid" {
|
||||
description = "OCID of the existing compartment for all resources"
|
||||
type = string
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Networking
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "vcn_cidr" {
|
||||
description = "CIDR block for the VCN"
|
||||
type = string
|
||||
default = "10.0.0.0/16"
|
||||
}
|
||||
|
||||
variable "public_subnet_cidr" {
|
||||
description = "CIDR block for the public subnet (Load Balancer)"
|
||||
type = string
|
||||
default = "10.0.1.0/24"
|
||||
}
|
||||
|
||||
variable "nodes_subnet_cidr" {
|
||||
description = "CIDR block for the private subnet (OKE worker nodes)"
|
||||
type = string
|
||||
default = "10.0.2.0/24"
|
||||
}
|
||||
|
||||
variable "api_subnet_cidr" {
|
||||
description = "CIDR block for the private subnet (OKE API endpoint)"
|
||||
type = string
|
||||
default = "10.0.3.0/24"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# OKE Cluster
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "kubernetes_version" {
|
||||
description = "Kubernetes version for the OKE cluster"
|
||||
type = string
|
||||
default = "v1.30.1"
|
||||
}
|
||||
|
||||
variable "cluster_name" {
|
||||
description = "Name of the OKE cluster"
|
||||
type = string
|
||||
default = "oci-cis-agent-oke"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Node Pool
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "node_shape" {
|
||||
description = "Shape of the OKE worker nodes"
|
||||
type = string
|
||||
default = "VM.Standard3.Flex"
|
||||
}
|
||||
|
||||
variable "node_ocpus" {
|
||||
description = "Number of OCPUs per worker node"
|
||||
type = number
|
||||
default = 2
|
||||
}
|
||||
|
||||
variable "node_memory_gb" {
|
||||
description = "Memory in GB per worker node"
|
||||
type = number
|
||||
default = 16
|
||||
}
|
||||
|
||||
variable "node_count" {
|
||||
description = "Number of worker nodes in the node pool"
|
||||
type = number
|
||||
default = 3
|
||||
}
|
||||
|
||||
variable "node_boot_volume_gb" {
|
||||
description = "Boot volume size in GB per worker node"
|
||||
type = number
|
||||
default = 50
|
||||
}
|
||||
|
||||
variable "ssh_public_key" {
|
||||
description = "SSH public key for worker node access"
|
||||
type = string
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Application Configuration
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "app_secret" {
|
||||
description = "Application secret key (64-byte hex string, 128 characters)"
|
||||
type = string
|
||||
sensitive = true
|
||||
|
||||
validation {
|
||||
condition = can(regex("^[0-9a-fA-F]{128}$", var.app_secret))
|
||||
error_message = "app_secret must be a 128-character hexadecimal string (64 bytes)."
|
||||
}
|
||||
}
|
||||
|
||||
variable "jwt_expiry_hours" {
|
||||
description = "JWT token expiry time in hours"
|
||||
type = number
|
||||
default = 12
|
||||
}
|
||||
|
||||
variable "app_timezone" {
|
||||
description = "Timezone for the application (e.g. America/Sao_Paulo)"
|
||||
type = string
|
||||
default = "UTC"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# OCIR (Oracle Cloud Infrastructure Registry)
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "ocir_namespace" {
|
||||
description = "Object Storage namespace for OCIR (tenancy namespace)"
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "ocir_repo_prefix" {
|
||||
description = "Repository prefix in OCIR (e.g. oci-cis-agent)"
|
||||
type = string
|
||||
default = "oci-cis-agent"
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Load Balancer
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "lb_min_bandwidth_mbps" {
|
||||
description = "Minimum bandwidth for the flexible load balancer in Mbps"
|
||||
type = number
|
||||
default = 10
|
||||
}
|
||||
|
||||
variable "lb_max_bandwidth_mbps" {
|
||||
description = "Maximum bandwidth for the flexible load balancer in Mbps"
|
||||
type = number
|
||||
default = 100
|
||||
}
|
||||
|
||||
variable "node_port" {
|
||||
description = "NodePort for the Kubernetes frontend service (must match K8s Service spec)"
|
||||
type = number
|
||||
default = 30080
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# DNS (Optional)
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "domain_name" {
|
||||
description = "Domain name for DNS zone and A record. Leave empty to skip DNS setup."
|
||||
type = string
|
||||
default = ""
|
||||
}
|
||||
|
||||
# -----------------------------------------------------------------------------
|
||||
# Tags
|
||||
# -----------------------------------------------------------------------------
|
||||
variable "freeform_tags" {
|
||||
description = "Freeform tags to apply to all resources"
|
||||
type = map(string)
|
||||
default = {
|
||||
"Project" = "oci-cis-agent"
|
||||
"ManagedBy" = "terraform"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user