Files
bakery-ia/infrastructure/kubernetes/base/components/frontend/frontend-service.yaml
Claude 71759dc67a Fix Tilt hanging on frontend deployment
Fixed the issue where Tilt would get stuck after building the frontend image:

1. Changed imagePullPolicy from 'Always' to 'IfNotPresent'
   - Prevents Kubernetes from trying to pull from a remote registry
   - Uses locally built images for development

2. Removed ':latest' tag from image reference
   - Now uses 'bakery/dashboard' without explicit tag
   - Allows Skaffold/Tilt to inject the correct tag ('dev')

3. Optimized health check configuration:
   - Use dedicated /health endpoint instead of /
   - Reduced readiness probe initialDelaySeconds from 20s to 5s
   - Reduced liveness probe initialDelaySeconds from 60s to 15s
   - Faster pod startup and readiness detection

These changes ensure Kubernetes can find and use the locally built image,
and the pod becomes ready much faster, preventing Tilt from hanging during deployment.
2025-11-06 18:43:23 +00:00

78 lines
1.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: frontend
namespace: bakery-ia
labels:
app.kubernetes.io/name: frontend
app.kubernetes.io/component: frontend
app.kubernetes.io/part-of: bakery-ia
spec:
replicas: 1
selector:
matchLabels:
app.kubernetes.io/name: frontend
app.kubernetes.io/component: frontend
template:
metadata:
labels:
app.kubernetes.io/name: frontend
app.kubernetes.io/component: frontend
spec:
containers:
- name: frontend
image: bakery/dashboard
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
name: http
env:
- name: NODE_ENV
value: "production"
envFrom:
- configMapRef:
name: bakery-config
resources:
requests:
memory: "512Mi"
cpu: "250m"
limits:
memory: "1Gi"
cpu: "500m"
livenessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 15
timeoutSeconds: 5
periodSeconds: 30
failureThreshold: 3
readinessProbe:
httpGet:
path: /health
port: 3000
initialDelaySeconds: 5
timeoutSeconds: 5
periodSeconds: 10
failureThreshold: 3
---
apiVersion: v1
kind: Service
metadata:
name: frontend-service
namespace: bakery-ia
labels:
app.kubernetes.io/name: frontend
app.kubernetes.io/component: frontend
spec:
type: ClusterIP
ports:
- port: 3000
targetPort: 3000
protocol: TCP
name: http
selector:
app.kubernetes.io/name: frontend
app.kubernetes.io/component: frontend