Skip to content

Deployment FAQ

Service fails to start: etcd connection refused

Section titled “Service fails to start: etcd connection refused”

Check that etcd is running and reachable from the service container:

Terminal window
# Test connectivity
nc -zv etcd-host 2379
# Check etcd health
etcdctl --endpoints=http://etcd-host:2379 endpoint health

In Kubernetes, use the etcd service DNS name, not localhost.

Another process is listening on the same port. Find and stop it:

Terminal window
lsof -i :8888
kill -9 <PID>

In Kubernetes, ensure no two pods use the same hostPort.

Check for goroutine leaks:

Terminal window
curl http://localhost:6060/debug/pprof/goroutine?debug=1

Enable pprof in your config:

Log:
Mode: console
# Add pprof route in main.go:
import _ "net/http/pprof"
go http.ListenAndServe(":6060", nil)
  1. Check MaxConns — increase if connection pool is exhausted.
  2. Check Timeout — too low for your workload.
  3. Check downstream RPC timeouts.
  4. Check CPU-based load shedding threshold (CpuThreshold).
MaxConns: 50000
Timeout: 5000
CpuThreshold: 950

Use Kubernetes rolling deployments with proper readiness probes:

strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
readinessProbe:
httpGet: {path: /healthz, port: 8888}
initialDelaySeconds: 5
periodSeconds: 5