63 lines
1.4 KiB
Bash
Executable File
63 lines
1.4 KiB
Bash
Executable File
# Create a fixed deployment file
|
|
cat > fixed-backend.yml << EOF
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: backend
|
|
namespace: sk1
|
|
spec:
|
|
replicas: 2
|
|
selector:
|
|
matchLabels:
|
|
app: backend
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: backend
|
|
spec:
|
|
containers:
|
|
- name: backend
|
|
image: gcr.io/$(gcloud config get-value project)/backend:latest
|
|
resources:
|
|
limits:
|
|
cpu: "500m"
|
|
memory: "512Mi"
|
|
requests:
|
|
cpu: "200m"
|
|
memory: "256Mi"
|
|
ports:
|
|
- containerPort: 4000
|
|
env:
|
|
- name: PORT
|
|
value: "4000"
|
|
- name: MONGO_URI
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mongodb-secret
|
|
key: MONGO_URI
|
|
- name: JWT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mongodb-secret
|
|
key: JWT_SECRET
|
|
- name: GOOGLE_PLACES_API_KEY
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: mongodb-secret
|
|
key: GOOGLE_PLACES_API_KEY
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /api
|
|
port: 4000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 20
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /api
|
|
port: 4000
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 10
|
|
EOF
|
|
|
|
# Apply the fixed deployment
|
|
kubectl apply -f fixed-backend.yml |