- Remove namespace: adopt-a-street from all metadata sections - Update CouchDB NODENAME to use namespace-agnostic format - Make all manifests deployable to any namespace - Maintain service names and selectors for functionality - All manifests validated with kubectl dry-run Now manifests can be deployed to any namespace using: kubectl apply -n <namespace> -f deploy/k8s/ 🤖 Generated with [AI Assistant] Co-Authored-By: AI Assistant <noreply@ai-assistant.com>
88 lines
2.1 KiB
YAML
88 lines
2.1 KiB
YAML
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: adopt-a-street-mongodb
|
|
labels:
|
|
app: mongodb
|
|
spec:
|
|
clusterIP: None # Headless service for StatefulSet
|
|
selector:
|
|
app: mongodb
|
|
ports:
|
|
- port: 27017
|
|
targetPort: 27017
|
|
name: mongodb
|
|
|
|
---
|
|
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: adopt-a-street-mongodb
|
|
spec:
|
|
serviceName: adopt-a-street-mongodb
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: mongodb
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mongodb
|
|
spec:
|
|
# Place MongoDB on Pi 5 nodes (more RAM)
|
|
affinity:
|
|
nodeAffinity:
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
nodeSelectorTerms:
|
|
- matchExpressions:
|
|
- key: kubernetes.io/arch
|
|
operator: In
|
|
values:
|
|
- arm64 # Pi 5 architecture
|
|
containers:
|
|
- name: mongodb
|
|
image: mongo:7.0
|
|
ports:
|
|
- containerPort: 27017
|
|
name: mongodb
|
|
resources:
|
|
requests:
|
|
memory: "512Mi"
|
|
cpu: "250m"
|
|
limits:
|
|
memory: "2Gi"
|
|
cpu: "1000m"
|
|
volumeMounts:
|
|
- name: mongodb-data
|
|
mountPath: /data/db
|
|
livenessProbe:
|
|
exec:
|
|
command:
|
|
- mongosh
|
|
- --eval
|
|
- "db.adminCommand('ping')"
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
readinessProbe:
|
|
exec:
|
|
command:
|
|
- mongosh
|
|
- --eval
|
|
- "db.adminCommand('ping')"
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 10
|
|
timeoutSeconds: 5
|
|
failureThreshold: 3
|
|
volumeClaimTemplates:
|
|
- metadata:
|
|
name: mongodb-data
|
|
spec:
|
|
accessModes: ["ReadWriteOnce"]
|
|
resources:
|
|
requests:
|
|
storage: 10Gi
|
|
# Uncomment and set your storage class if needed
|
|
# storageClassName: local-path
|