mysql-deployment.yaml 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: mysql
  5. namespace: food-ai
  6. spec:
  7. replicas: 1
  8. selector:
  9. matchLabels:
  10. app: mysql
  11. template:
  12. metadata:
  13. labels:
  14. app: mysql
  15. spec:
  16. containers:
  17. - name: mysql
  18. image: food-ai-mysql:latest
  19. env:
  20. - name: MYSQL_ROOT_PASSWORD
  21. valueFrom:
  22. secretKeyRef:
  23. name: food-ai-secrets
  24. key: MYSQL_ROOT_PASSWORD
  25. - name: MYSQL_DATABASE
  26. value: "food_db"
  27. ports:
  28. - containerPort: 3306
  29. volumeMounts:
  30. - name: mysql-data
  31. mountPath: /var/lib/mysql
  32. - name: my-cnf
  33. mountPath: /etc/mysql/conf.d
  34. - name: logs
  35. mountPath: /logs
  36. resources:
  37. limits:
  38. cpu: "1"
  39. memory: "1Gi"
  40. requests:
  41. cpu: "500m"
  42. memory: "512Mi"
  43. volumes:
  44. - name: mysql-data
  45. persistentVolumeClaim:
  46. claimName: mysql-data-pvc
  47. - name: my-cnf
  48. configMap:
  49. name: food-ai-config
  50. items:
  51. - key: my.cnf
  52. path: my.cnf
  53. - name: logs
  54. persistentVolumeClaim:
  55. claimName: logs-pvc