Skip to main content

πŸ”„ Replicare su Nuovo Progetto GCP

Prerequisiti​

  • Account GCP con billing
  • gcloud, terraform, kubectl, helm installati

Step-by-Step​

1. Crea Progetto​

NEW_PROJECT="visla-prod-2026"
gcloud projects create $NEW_PROJECT --name="Visla Production"

# Collega billing
BILLING_ACCOUNT=$(gcloud billing accounts list --format='value(ACCOUNT_ID)' | head -1)
gcloud billing projects link $NEW_PROJECT --billing-account=$BILLING_ACCOUNT

2. Abilita API​

gcloud services enable \
compute.googleapis.com container.googleapis.com \
sqladmin.googleapis.com secretmanager.googleapis.com \
artifactregistry.googleapis.com servicenetworking.googleapis.com \
cloudbuild.googleapis.com

3. Copia Terraform​

cp -r infra/terraform_k8s infra/terraform_prod
cd infra/terraform_prod

Modifica terraform.tfvars:

project_id = "visla-prod-2026"

4. Applica Terraform​

terraform init
terraform apply

5. Popola Secrets​

openssl rand -base64 64 | gcloud secrets versions add visla-jwt-secret --data-file=-
echo -n "sk_live_xxx" | gcloud secrets versions add visla-stripe-api-key --data-file=-

6. Configura kubectl​

gcloud container clusters get-credentials visla-k8s-cluster \
--zone europe-west8-a --project visla-prod-2026

7. Installa Helm Charts​

helm upgrade --install traefik traefik/traefik -f k8s/traefik-values.yaml
helm upgrade --install visla-redis bitnami/redis -f k8s/redis-values.yaml
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.13.3/cert-manager.yaml

8. Cloudflare Tunnel​

kubectl create secret generic cloudflare-tunnel-token --from-literal=token="TOKEN"
kubectl apply -f k8s/cloudflare-tunnel.yaml

9. Deploy Servizi​

kubectl apply -f k8s/deployments/
kubectl apply -f k8s/ingress-routes.yaml

βœ… Checklist​

  • Progetto creato
  • APIs abilitate
  • Terraform applicato
  • Secrets popolati
  • Helm charts installati
  • Cloudflare configurato
  • Deployments applicati