You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

53 lines
1.1 KiB

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: template
  5. namespace: template
  6. spec:
  7. selector:
  8. matchLabels:
  9. app: template
  10. # completely removes the pod on update BEFORE creating the new one.
  11. # this is needed since normal ceph block devices can only be mountet
  12. # ONCE at a time
  13. strategy:
  14. type: Recreate
  15. template:
  16. metadata:
  17. labels:
  18. app: template
  19. spec:
  20. containers:
  21. - image: mariadb:10.5.6
  22. name: mariadb
  23. env:
  24. # passwords can be dead simple because the database is only accessible from within the cluster
  25. - name: MYSQL_ROOT_PASSWORD
  26. value: "template"
  27. - name: MYSQL_DATABASE
  28. value: "template"
  29. volumeMounts:
  30. - name: db-vol
  31. mountPath: /var/lib/mysql
  32. volumes:
  33. - name: db-vol
  34. persistentVolumeClaim:
  35. claimName: template
  36. ---
  37. apiVersion: v1
  38. kind: Service
  39. metadata:
  40. name: template
  41. namespace: template
  42. spec:
  43. # internal floating ip
  44. externalIPs:
  45. - 10.0.0.9
  46. ports:
  47. - port: 3306
  48. targetPort: 3306
  49. selector:
  50. app: template