Securing database access in Google Cloud Platform while running workloads in Kubernetes is harder than people admit. The problem isn’t just locking down credentials. It’s controlling who and what gets in, how, and when—without breaking your deployment pipelines. Misconfigurations creep in fast. Secrets get baked into containers. Service accounts get overprivileged. RBAC rules get loose. One small oversight, and the blast radius expands.
GCP database access security starts with identity. Kubernetes workloads need precise, minimal permissions to connect to Cloud SQL, Bigtable, or Spanner. Using Workload Identity Federation over long-lived keys removes static credentials from your cluster. Map Kubernetes service accounts to GCP service accounts with only the exact roles required. Audit those roles often. Never give write access where read-only fits the job.
The connection path must be locked down. Use the Cloud SQL Auth Proxy or private IPs to prevent exposure over the public internet. Configure network policies in Kubernetes to control pod-to-pod and pod-to-service traffic, so only the right workloads can talk to the database. Avoid broad CIDR blocks in firewall rules. Keep it tight.