Energent.ai offre agenti desktop virtuali basati su AI che automatizzano flussi di lavoro complessi multi-applicazione per utenti aziendali. Questa guida fornisce specifiche complete per la distribuzione su Google Cloud Platform utilizzando un'architettura moderna cloud-native con GKE, design multi-tenant e controlli di sicurezza di livello aziendale.
- Classificazione del documento: Pubblico
- Versione: 3.0
- Ultimo aggiornamento: 2025-05-28
- Architettura: GCP GKE + Serverless Hybrid
- Conformità: SOC 2, Migliori pratiche di sicurezza Google Cloud
Indice
- Panoramica dell'architettura
- Requisiti infrastrutturali GCP
- Specifiche del cluster GKE
- Architettura del livello dati
- Componenti serverless
- Sicurezza & Conformità
- Architettura di rete
- Pipeline CI/CD
- Monitoraggio & Osservabilità
- Processo di distribuzione
- Operazioni & Manutenzione
- Supporto & Escalation
1. Panoramica dell'architettura
1.1 Architettura multi-tenant cloud-native
Energent.ai si distribuisce su Google Cloud Platform utilizzando un'architettura moderna e scalabile che combina orchestrazione Kubernetes con componenti serverless per prestazioni ottimali ed efficienza dei costi.
┌──────────────────────────────────────────────────────────────────┐
│ AMBIENTE CLOUD GCP │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐ │
│ │ CLUSTER GKE │ │ SERVERLESS │ │ LIVELLO DATI │ │
│ │ │ │ │ │ │ │
│ │ • Multi-tenant │ │ • Funzioni Auth │ │ • Firestore │ │
│ │ • n2-standard-4 │ │ • Funzioni Bill │ │ • Cloud Storage │ │
│ │ • Auto-scaling │ │ • API Gateway │ │ • Filestore │ │
│ │ • Flux GitOps │ │ • Pub/Sub │ │ • Secret Mgr │ │
│ └─────────────────┘ └─────────────────┘ └─────────────────┘ │
│ │ │ │ │
│ └─────────────────────┼────────────────────┘ │
│ │ │
│ ┌─────────────────────────────────────────────────────────────┐ │
│ │ PERIMETRO DI SICUREZZA VPC │ │
│ │ • Subnet private • Cloud NAT • Regole firewall │ │
│ │ • Tunnel IAP • Endpoint VPC • Load Balancer │ │
│ └─────────────────────────────────────────────────────────────┘ │
└──────────────────────────────────────────────────────────────────┘
1.2 Modelli di distribuzione
| Modello | Descrizione | Caso d'uso | SLA |
|---|
| GKE Multi-Tenant | Cluster condiviso con isolamento namespace | Distribuzione aziendale standard | 99.9% |
| GKE dedicato | Cluster single-tenant | Alta sicurezza, conformità normativa | 99.95% |
| Distribuzione ibrida | GKE + integrazione on-premises cliente | Integrazione sistemi legacy | 99.9% |
2. Requisiti infrastrutturali GCP
2.1 Specifiche minime dell'infrastruttura
| Componente | Specifica | Scopo |
|---|
| Versione cluster GKE | 1.30+ | Orchestrazione Kubernetes |
| Tipo di istanza pool nodi | n2-standard-4 (4 vCPU, 16 GB RAM) | Carichi di lavoro ottimizzati |
| Configurazione minima nodi | 1 vCPU, 2 GB RAM per tenant | Allocazione risorse |
| Dischi persistenti | 100 GB SSD, crittografati | Storage persistente pod |
| Filestore | Base, crittografato | File system condiviso |
| Cloud Storage | Standard, versioning abilitato | Storage oggetti |
| Firestore | Modalità nativa, crittografia a riposo | Metadati e configurazione |
2.2 Dipendenze dei servizi GCP
| Servizio | Scopo | Configurazione |
|---|
| Google GKE | Orchestrazione Kubernetes | Cluster privato, registrazione abilitata |
| Compute Engine | Scalabilità dinamica nodi | Auto-scaling, istanze preemptive |
| Cloud Load Balancing | Distribuzione traffico | Terminazione SSL, Cloud Armor |
| Cloud Functions | Funzioni serverless | Runtime: Python 3.11, connettore VPC |
| API Gateway | Gestione API | Limitazione di velocità, autenticazione |
| Cloud Monitoring | Monitoraggio e registrazione | Monitoraggio GKE, metriche personalizzate |
| Secret Manager | Gestione segreti | Rotazione automatica, crittografia |
| Cloud KMS | Gestione chiavi | Chiavi gestite dal cliente, rotazione automatica |
3. Specifiche del cluster GKE
3.1 Configurazione del cluster
# Configurazione Terraform del cluster GKE
resource "google_container_cluster" "energent_cluster" {
name = "energent-production"
location = var.gcp_region
remove_default_node_pool = true
initial_node_count = 1
network = google_compute_network.vpc.name
subnetwork = google_compute_subnetwork.subnet.name
networking_mode = "VPC_NATIVE"
ip_allocation_policy {
cluster_secondary_range_name = "k8s-pod-range"
services_secondary_range_name = "k8s-service-range"
}
private_cluster_config {
enable_private_nodes = true
enable_private_endpoint = false
master_ipv4_cidr_block = "172.16.0.0/28"
}
master_auth {
client_certificate_config {
issue_client_certificate = false
}
}
workload_identity_config {
workload_pool = "${var.project_id}.svc.id.goog"
}
addons_config {
gcp_filestore_csi_driver_config {
enabled = true
}
network_policy_config {
disabled = false
}
}
cluster_telemetry {
type = "ENABLED"
}
logging_config {
enable_components = [
"SYSTEM_COMPONENTS",
"WORKLOADS",
"API_SERVER"
]
}
monitoring_config {
enable_components = [
"SYSTEM_COMPONENTS",
"WORKLOADS"
]
}
}
3.2 Configurazione del pool nodi
# Pool nodi primario
resource "google_container_node_pool" "energent_nodes" {
name = "energent-node-pool"
location = var.gcp_region
cluster = google_container_cluster.energent_cluster.name
node_count = 3
autoscaling {
min_node_count = 2
max_node_count = 20
}
node_config {
preemptible = false
machine_type = "n2-standard-4"
disk_size_gb = 100
disk_type = "pd-ssd"
service_account = google_service_account.gke_service_account.email
oauth_scopes = [
"https://www.googleapis.com/auth/logging.write",
"https://www.googleapis.com/auth/monitoring",
"https://www.googleapis.com/auth/cloud-platform"
]
workload_metadata_config {
mode = "GKE_METADATA"
}
labels = {
env = "production"
app = "energent-ai"
}
taint {
key = "workload"
value = "energent-ai"
effect = "NO_SCHEDULE"
}
}
management {
auto_repair = true
auto_upgrade = true
}
}
3.3 Allocazione risorse multi-tenant
| Livello Tenant | Limite CPU | Limite memoria | Storage | Flussi di lavoro concorrenti |
|---|
| Base | 1 vCPU | 2 GB | 10 GB | 1 |
| Standard | 2 vCPU | 4 GB | 25 GB | 2 |
| Premium | 4 vCPU | 8 GB | 50 GB | 4 |
| Enterprise | 8 vCPU | 16 GB | 100 GB | 8 |
4. Architettura del livello dati
4.1 Architettura di storage
4.1.1 Configurazione Cloud Storage
# Cloud Storage Bucket per l'archiviazione di oggetti
resource "google_storage_bucket" "energent_storage" {
name = "energent-${var.environment}-storage-${random_id.bucket_suffix.hex}"
location = var.gcp_region
uniform_bucket_level_access = true
versioning {
enabled = true
}
encryption {
default_kms_key_name = google_kms_crypto_key.storage_key.id
}
lifecycle_rule {
condition {
age = 90
}
action {
type = "SetStorageClass"
storage_class = "NEARLINE"
}
}
retention_policy {
retention_period = 2592000 # 30 giorni
}
labels = {
environment = var.environment
purpose = "energent-object-storage"
}
}
resource "google_storage_bucket_iam_member" "storage_admin" {
bucket = google_storage_bucket.energent_storage.name
role = "roles/storage.admin"
member = "serviceAccount:${google_service_account.gke_service_account.email}"
}
4.1.2 Configurazione Firestore
# Database Firestore per metadati e configurazione
resource "google_firestore_database" "energent_metadata" {
project = var.project_id
name = "energent-metadata-${var.environment}"
location_id = var.gcp_region
type = "FIRESTORE_NATIVE"
concurrency_mode = "OPTIMISTIC"
app_engine_integration_mode = "DISABLED"
point_in_time_recovery_enablement = "POINT_IN_TIME_RECOVERY_ENABLED"
delete_protection_state = "DELETE_PROTECTION_ENABLED"
}
# Regole di sicurezza Firestore
resource "google_firestore_database" "security_rules" {
depends_on = [google_firestore_database.energent_metadata]
# Il contenuto delle regole di sicurezza sarebbe definito qui
# Implementazione dell'isolamento dei tenant e dei controlli di accesso
}
4.1.3 Archiviazione condivisa Filestore
# Filestore per il file system condiviso
resource "google_filestore_instance" "energent_shared" {
name = "energent-shared-${var.environment}"
location = var.gcp_zone
tier = "BASIC_HDD"
file_shares {
capacity_gb = 1024
name = "energent-share"
}
networks {
network = google_compute_network.vpc.name
modes = ["MODE_IPV4"]
}
labels = {
environment = var.environment
purpose = "shared-storage"
}
}
5. Componenti serverless
5.1 Funzioni Cloud
5.1.1 Servizio di autenticazione
# Funzione Cloud per l'autenticazione
resource "google_cloudfunctions2_function" "auth_service" {
name = "energent-auth-${var.environment}"
location = var.gcp_region
build_config {
runtime = "python311"
entry_point = "auth_handler"
source {
storage_source {
bucket = google_storage_bucket.functions_source.name
object = google_storage_bucket_object.auth_source.name
}
}
}
service_config {
max_instance_count = 100
min_instance_count = 1
available_memory = "512Mi"
timeout_seconds = 60
environment_variables = {
FIRESTORE_PROJECT = var.project_id
SECRET_MANAGER_PROJECT = var.project_id
ENVIRONMENT = var.environment
}
vpc_connector = google_vpc_access_connector.connector.id
vpc_connector_egress_settings = "ALL_TRAFFIC"
service_account_email = google_service_account.functions_service_account.email
}
event_trigger {
trigger_region = var.gcp_region
event_type = "google.cloud.pubsub.topic.v1.messagePublished"
pubsub_topic = google_pubsub_topic.auth_events.id
}
labels = {
environment = var.environment
service = "authentication"
}
}
5.1.2 Servizio di fatturazione
# Funzione Cloud per la fatturazione
resource "google_cloudfunctions2_function" "billing_service" {
name = "energent-billing-${var.environment}"
location = var.gcp_region
build_config {
runtime = "python311"
entry_point = "billing_handler"
source {
storage_source {
bucket = google_storage_bucket.functions_source.name
object = google_storage_bucket_object.billing_source.name
}
}
}
service_config {
max_instance_count = 50
min_instance_count = 0
available_memory = "1Gi"
timeout_seconds = 300
environment_variables = {
FIRESTORE_PROJECT = var.project_id
STORAGE_BUCKET = google_storage_bucket.energent_storage.name
}
service_account_email = google_service_account.functions_service_account.email
}
}
5.2 Configurazione API Gateway
# API Gateway per funzioni serverless
resource "google_api_gateway_api" "energent_api" {
provider = google-beta
api_id = "energent-api-${var.environment}"
project = var.project_id
labels = {
environment = var.environment
service = "api-gateway"
}
}
resource "google_api_gateway_api_config" "energent_api_config" {
provider = google-beta
api = google_api_gateway_api.energent_api.api_id
api_config_id = "energent-config-${var.environment}"
project = var.project_id
openapi_documents {
document {
path = "spec.yaml"
contents = base64encode(templatefile("${path.module}/api-spec.yaml", {
project_id = var.project_id
region = var.gcp_region
}))
}
}
lifecycle {
create_before_destroy = true
}
}
resource "google_api_gateway_gateway" "energent_gateway" {
provider = google-beta
gateway_id = "energent-gateway-${var.environment}"
api_config = google_api_gateway_api_config.energent_api_config.id
location = var.gcp_region
project = var.project_id
labels = {
environment = var.environment
service = "api-gateway"
}
}
6. Sicurezza e conformità
6.1 Sicurezza della rete
6.1.1 Configurazione VPC
# Rete VPC e regole del firewall
resource "google_compute_network" "vpc" {
name = "energent-vpc-${var.environment}"
auto_create_subnetworks = false
mtu = 1460
}
resource "google_compute_subnetwork" "subnet" {
name = "energent-subnet-${var.environment}"
ip_cidr_range = "10.0.0.0/16"
region = var.gcp_region
network = google_compute_network.vpc.id
secondary_ip_range {
range_name = "k8s-pod-range"
ip_cidr_range = "10.1.0.0/16"
}
secondary_ip_range {
range_name = "k8s-service-range"
ip_cidr_range = "10.2.0.0/16"
}
private_ip_google_access = true
}
resource "google_compute_firewall" "allow_internal" {
name = "energent-allow-internal"
network = google_compute_network.vpc.name
allow {
protocol = "tcp"
ports = ["0-65535"]
}
allow {
protocol = "udp"
ports = ["0-65535"]
}
allow {
protocol = "icmp"
}
source_ranges = ["10.0.0.0/8"]
}
resource "google_compute_firewall" "allow_https" {
name = "energent-allow-https"
network = google_compute_network.vpc.name
allow {
protocol = "tcp"
ports = ["443"]
}
source_ranges = ["0.0.0.0/0"]
target_tags = ["https-server"]
}
6.1.2 Regole del firewall
| Direzione | Protocollo | Intervallo porte | Origine/Destinazione | Scopo |
|---|
| Inbound | HTTPS | 443 | 0.0.0.0/0 | Accesso API |
| Inbound | TCP | 1024-65535 | 10.0.0.0/8 | Traffico interno |
| Outbound | HTTPS | 443 | 0.0.0.0/0 | Chiamate API esterne |
| Outbound | TCP | 53 | 0.0.0.0/0 | Risoluzione DNS |
6.2 Standard di crittografia
| Stato dei dati | Metodo di crittografia | Gestione delle chiavi | Conformità |
|---|
| A riposo | AES-256-GCM | Cloud KMS con rotazione automatica | SOC 2, FIPS 140-2 Livello 3 |
| In transito | TLS 1.3 | Certificati gestiti da Google | SOC 2, PCI DSS |
| In memoria | Livello applicativo | Modulo di sicurezza hardware | SOC 2 |
| Backup | AES-256 | Cloud KMS cross-region | SOC 2, GDPR |
6.3 IAM e account di servizio
6.3.1 Account di servizio GKE
# Account di servizio GKE
resource "google_service_account" "gke_service_account" {
account_id = "energent-gke-${var.environment}"
display_name = "Energent GKE Service Account"
project = var.project_id
}
resource "google_project_iam_member" "gke_permissions" {
for_each = toset([
"roles/logging.logWriter",
"roles/monitoring.metricWriter",
"roles/monitoring.viewer",
"roles/storage.objectViewer"
])
project = var.project_id
role = each.value
member = "serviceAccount:${google_service_account.gke_service_account.email}"
}
# Binding per identità del carico di lavoro
resource "google_service_account_iam_member" "workload_identity" {
service_account_id = google_service_account.gke_service_account.name
role = "roles/iam.workloadIdentityUser"
member = "serviceAccount:${var.project_id}.svc.id.goog[energent-ai/energent-platform]"
}
7. Architettura di rete
7.1 Progettazione VPC
┌─────────────────────────────────────────────────────────────────┐
│ VPC (10.0.0.0/16) │
│ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ Subnet Pubblica│ │ Subnet Pubblica│ │ Sub Pubblica│ │
│ │ (10.0.1.0/24) │ │ (10.0.2.0/24) │ │(10.0.3.0/24)│ │
│ │ │ │ │ │ │ │
│ │ Cloud NAT │ │ Cloud NAT │ │ Cloud NAT │ │
│ │ Load Balancer │ │ Load Balancer │ │Load Balancer│ │
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
│ │ │ │ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ Subnet Privata │ │ Subnet Privata │ │Sub Privata │ │
│ │ (10.1.0.0/16) │ │ (10.1.0.0/16) │ │(10.1.0.0/16)│ │
│ │ │ │ │ │ │ │
│ │ Nodi GKE │ │ Nodi GKE │ │ Nodi GKE │ │
│ │ Funzioni VPC │ │ Funzioni VPC │ │ Funzioni │ │
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
│ │ │ │ │
│ ┌─────────────────┐ ┌─────────────────┐ ┌─────────────┐ │
│ │ Subnet Servizi │ │ Subnet Servizi │ │Sub Servizi │ │
│ │ (10.2.0.0/16) │ │ (10.2.0.0/16) │ │(10.2.0.0/16)│ │
│ │ │ │ │ │ │ │
│ │ Firestore │ │ Firestore │ │ Firestore │ │
│ │ Cloud Storage │ │ Cloud Storage │ │Cloud Storage│ │
│ └─────────────────┘ └─────────────────┘ └─────────────┘ │
└─────────────────────────────────────────────────────────────────┘
7.2 Connessioni di Servizio Private
| Servizio | Tipo | Scopo |
|---|
| Cloud Storage | Endpoint privato | Accesso allo storage |
| Firestore | Endpoint privato | Accesso ai metadati |
| GKE | Cluster privato | Accesso API cluster |
| Container Registry | Endpoint privato | Registro container |
| Cloud Monitoring | Endpoint privato | Monitoraggio e logging |
| Secret Manager | Endpoint privato | Accesso ai segreti |
8. Pipeline CI/CD
8.1 Infrastruttura come Codice (Terraform)
8.1.1 Struttura di Terraform
terraform/
├── environments/
│ ├── dev/
│ ├── staging/
│ └── production/
├── modules/
│ ├── gke/
│ ├── networking/
│ ├── security/
│ └── storage/
├── shared/
│ └── backend.tf
└── global/
└── iam.tf
8.1.2 Pipeline Terraform (Cloud Build)
# cloudbuild.yaml
steps:
# Terraform Init
- name: 'hashicorp/terraform:1.6.0'
entrypoint: 'sh'
args:
- '-c'
- |
cd terraform/environments/${_ENVIRONMENT}
terraform init -backend-config="bucket=${_TF_STATE_BUCKET}"
# Terraform Plan
- name: 'hashicorp/terraform:1.6.0'
entrypoint: 'sh'
args:
- '-c'
- |
cd terraform/environments/${_ENVIRONMENT}
terraform plan -var-file="${_ENVIRONMENT}.tfvars" -out=tfplan
# Terraform Apply (solo su branch principale)
- name: 'hashicorp/terraform:1.6.0'
entrypoint: 'sh'
args:
- '-c'
- |
if [ "${BRANCH_NAME}" = "main" ]; then
cd terraform/environments/${_ENVIRONMENT}
terraform apply -auto-approve tfplan
else
echo "Skipping apply for non-main branch"
fi
substitutions:
_ENVIRONMENT: 'production'
_TF_STATE_BUCKET: 'energent-terraform-state'
options:
logging: CLOUD_LOGGING_ONLY
machineType: 'E2_HIGHCPU_8'
timeout: 1200s
8.2 Kubernetes GitOps (Flux)
8.2.1 Configurazione Flux
# flux-system/gotk-sync.yaml
apiVersion: source.toolkit.fluxcd.io/v1beta2
kind: GitRepository
metadata:
name: energent-k8s
namespace: flux-system
spec:
interval: 1m
ref:
branch: main
url: https://github.com/energent-ai/k8s-manifests
---
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
kind: Kustomization
metadata:
name: energent-apps
namespace: flux-system
spec:
interval: 10m
path: './apps'
prune: true
sourceRef:
kind: GitRepository
name: energent-k8s
validation: client
8.3 Deployment Serverless (Cloud Build)
8.3.1 Configurazione Deployment Funzioni
# cloudbuild-functions.yaml
steps:
# Deploy Funzione Auth
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:latest'
entrypoint: 'bash'
args:
- '-c'
- |
cd functions/auth
gcloud functions deploy energent-auth-${_ENVIRONMENT} \
--runtime python311 \
--trigger-http \
--entry-point auth_handler \
--memory 512MB \
--timeout 60s \
--region ${_REGION} \
--vpc-connector ${_VPC_CONNECTOR} \
--set-env-vars ENVIRONMENT=${_ENVIRONMENT}
# Deploy Funzione Billing
- name: 'gcr.io/google.com/cloudsdktool/cloud-sdk:latest'
entrypoint: 'bash'
args:
- '-c'
- |
cd functions/billing
gcloud functions deploy energent-billing-${_ENVIRONMENT} \
--runtime python311 \
--trigger-topic billing-events \
--entry-point billing_handler \
--memory 1024MB \
--timeout 300s \
--region ${_REGION}
substitutions:
_ENVIRONMENT: 'production'
_REGION: 'us-central1'
_VPC_CONNECTOR: 'energent-vpc-connector'
options:
logging: CLOUD_LOGGING_ONLY
9. Monitoraggio & Osservabilità
9.1 Configurazione Cloud Monitoring
9.1.1 Monitoraggio GKE
# Cloud Monitoring per GKE
resource "google_monitoring_dashboard" "gke_dashboard" {
dashboard_json = jsonencode({
displayName = "Energent GKE Dashboard"
mosaicLayout = {
tiles = [
{
width = 6
height = 4
widget = {
title = "Utilizzo CPU Cluster GKE"
xyChart = {
dataSets = [{
timeSeriesQuery = {
timeSeriesFilter = {
filter = "resource.type=\"k8s_cluster\" AND metric.type=\"kubernetes.io/container/cpu/core_usage_time\""
}
}
}]
}
}
}
]
}
})
}
# Metriche basate su log
resource "google_logging_metric" "error_rate" {
name = "energent_error_rate"
filter = "resource.type=\"k8s_container\" AND resource.labels.namespace_name=\"energent-ai\" AND severity=\"ERROR\""
metric_descriptor {
metric_kind = "GAUGE"
value_type = "INT64"
display_name = "Energent Error Rate"
}
}
9.2 Metriche Applicative
| Categoria Metrica | Metriche | Obiettivo | Soglia di Allarme |
|---|
| Disponibilità | Uptime, Controlli Salute | 99.9% | < 99.5% |
| Performance | Tempo di Risposta, RPS | < 2s, > 1000 RPS | > 5s, < 500 RPS |
| Utilizzo Risorse | CPU, Memoria, Storage | < 80% | > 90% |
| Tassi di Errore | Errori 4xx, 5xx | < 1% | > 5% |
9.3 Audit Logging
# Configurazione Log di Audit Cloud
resource "google_project_iam_audit_config" "project_audit" {
project = var.project_id
service = "allServices"
audit_log_config {
log_type = "ADMIN_READ"
}
audit_log_config {
log_type = "DATA_READ"
}
audit_log_config {
log_type = "DATA_WRITE"
}
}
# Sink Log per Eventi di Sicurezza
resource "google_logging_project_sink" "security_sink" {
name = "energent-security-sink"
destination = "storage.googleapis.com/${google_storage_bucket.audit_logs.name}"
filter = "protoPayload.serviceName=\"container.googleapis.com\" OR protoPayload.serviceName=\"iam.googleapis.com\""
unique_writer_identity = true
}
10. Processo di Deployment
10.1 Cronologia Deployment
| Fase | Durata | Attività | Stakeholder |
|---|
| Pre-Deployment | 2-3 giorni | Pianificazione infrastruttura, revisione sicurezza | IT Cliente, Sicurezza, Soluzioni Energent |
| Infrastruttura | 1-2 giorni | Deployment Terraform, configurazione VPC | DevOps Cliente, Piattaforma Energent |
| Cluster GKE | 0.5 giorno | Provisioning cluster, pool nodi | DevOps Cliente, Piattaforma Energent |
| Applicazione | 0.5 giorno | Deployment Flux, rollout applicazione | Team Piattaforma Energent |
| Integrazione | 1-2 giorni | IAM, monitoraggio, testing | IT Cliente, Supporto Energent |
| Go-Live | 0.5 giorno | Passaggio a produzione, validazione | Tutti gli stakeholder |
10.2 Comandi di Deployment
10.2.1 Deployment Infrastruttura
# Deployment Infrastruttura con Terraform
cd terraform/environments/production
terraform init -backend-config="bucket=energent-terraform-state"
terraform plan -var-file="production.tfvars"
terraform apply -auto-approve
# Verifica cluster GKE
gcloud container clusters get-credentials energent-production --region us-central1
kubectl get nodes
10.2.2 Deployment Applicazione
# Installare Flux GitOps
flux bootstrap github \
--owner=energent-ai \
--repository=k8s-manifests \
--branch=main \
--path=./clusters/production
# Deploy componenti serverless
gcloud builds submit --config cloudbuild-functions.yaml \
--substitutions _ENVIRONMENT=production,_REGION=us-central1
# Verifica del deployment
kubectl get pods -n energent-ai
kubectl get ingress -n energent-ai
10.3 Validazione del Deployment
# Endpoint di controllo dello stato
curl -k https://api.energent.example.com/health
curl -k https://api.energent.example.com/metrics
# Validazione Kubernetes
kubectl top nodes
kubectl get hpa -n energent-ai
kubectl logs -n energent-ai -l app=energent-platform
11. Operazioni e Manutenzione
11.1 Backup e Recupero di Emergenza
11.1.1 Strategia di Backup
| Componente | Frequenza | Conservazione | RTO | RPO |
|---|
| Stato Cluster GKE | Giornaliero | 30 giorni | < 4 ore | < 24 ore |
| Dati Applicativi | In tempo reale | 90 giorni | < 1 ora | < 15 minuti |
| Configurazione | Al cambiamento | 1 anno | < 30 minuti | 0 |
| Log di Audit | In tempo reale | 7 anni | < 24 ore | 0 |
11.1.2 Procedure di Recupero di Emergenza
# Backup cluster GKE usando Velero
velero backup create energent-cluster-backup \
--include-namespaces energent-ai \
--storage-location gcp
# Recupero punto-in-tempo Firestore
gcloud firestore databases restore \
--source-database=energent-metadata-production \
--destination-database=energent-metadata-restored \
--backup-time=2025-05-28T10:00:00Z
11.2 Scalabilità e Prestazioni
11.2.1 Configurazione Auto-Scaling
# Horizontal Pod Autoscaler
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: energent-platform-hpa
namespace: energent-ai
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: energent-platform
minReplicas: 3
maxReplicas: 50
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
- type: Resource
resource:
name: memory
target:
type: Utilization
averageUtilization: 80
11.3 Aggiornamento e Manutenzione
11.3.1 Aggiornamenti Rolling
# Aggiornamento cluster GKE
gcloud container clusters upgrade energent-production \
--master \
--cluster-version 1.30 \
--region us-central1
# Aggiornamento rolling applicativo tramite Flux
git commit -am "Update energent-platform to v2.1.0"
git push origin main
# Flux rileva e applica automaticamente le modifiche
12. Supporto ed Escalation
12.1 Livelli di Supporto
| Livello | Tempo di Risposta | Canali | Ambito |
|---|
| L1 - Base | < 4 ore | Email, Portale | Domande generali, documentazione |
| L2 - Standard | < 2 ore | Telefono, Email, Meet | Problemi tecnici, supporto integrazione |
| L3 - Premium | < 1 ora | Telefono, Meet, Video | Problemi tecnici complessi, architettura |
| L4 - Critico | < 30 minuti | Telefono, SMS, Escalation | Interruzioni di produzione, incidenti di sicurezza |
12.2 Copertura Supporto 24/7
Supporto Enterprise:
Escalation di Emergenza:
12.3 Accordi di Livello di Servizio
| Servizio | SLA | Penalità |
|---|
| Disponibilità Piattaforma | Uptime 99.9% | Credito mensile del 10% per ogni 0.1% di deficit |
| Tempo di Risposta (P95) | < 2 secondi | Credito mensile del 5% se > 5 secondi |
| Risposta Supporto | Per livello sopra | Escalation al livello successivo |
| Recupero Dati | RTO < 4 ore | Credito mensile del 25% se superato |
Appendici
Appendice A: Costi Servizi GCP
| Servizio | Costo Mensile Stimato | Fattore di Scalabilità |
|---|
| Cluster GKE | $75 | Fisso per cluster |
| Compute Engine (3x n2-standard-4) | $850 | Lineare per nodo |
| Dischi Persistenti (300GB) | $60 | Lineare per GB |
| Cloud Storage (1TB) | $20 | Lineare per GB |
| Firestore | $120 | Basato sull'utilizzo |
| Cloud Functions | $35 | Basato sulle richieste |
| Costo Base Totale | ~$1,160/mese | Per 100 tenant |
Appendice B: Lista di Controllo Conformità Sicurezza
Appendice C: Guida alla Risoluzione dei Problemi
Problemi Comuni:
-
Nodi GKE Non Si Uniscono al Cluster
- Verificare i permessi dell'account di servizio
- Controllare il routing delle subnet e Cloud NAT
-
Pod Applicativi in CrashLoop
- Controllare limiti e richieste di risorse
- Verificare le richieste di volumi persistenti
-
Problemi di Connettività di Rete
- Verificare la configurazione del connettore VPC
- Controllare le regole firewall
- Classificazione Documento: Pubblico
- Versione: 3.0
- Ultimo Aggiornamento: 2025-05-28
- Prossima Revisione: 2025-08-28
- Contatto: support@energent.ai