π Replicare su Nuovo Progetto GCP
Prerequisitiβ
- Account GCP con billing
gcloud,terraform,kubectl,helminstallati
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