mysql-deployment.yaml 1.3 KB

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