finanzas-deployment.yaml 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: finanzas
  5. namespace: finanzas
  6. spec:
  7. type: NodePort
  8. ports:
  9. - name: "8080"
  10. port: 8080
  11. nodePort: 30346
  12. targetPort: 8080
  13. selector:
  14. app: finanzas
  15. ---
  16. apiVersion: apps/v1
  17. kind: Deployment
  18. metadata:
  19. name: finanzas
  20. namespace: finanzas
  21. labels:
  22. app: finanzas
  23. spec:
  24. replicas: 1
  25. selector:
  26. matchLabels:
  27. app: finanzas
  28. strategy:
  29. type: Recreate
  30. template:
  31. metadata:
  32. labels:
  33. app: finanzas
  34. spec:
  35. containers:
  36. - name: finanzas
  37. image: registry.reymota.es/finanzas:<TAG>
  38. env:
  39. - name: IMG_VERSION
  40. value: "<TAG>"
  41. - name: ENVIRONMENT
  42. valueFrom:
  43. configMapKeyRef:
  44. key: ENTORNO
  45. name: env-prod
  46. - name: DEBUG
  47. valueFrom:
  48. configMapKeyRef:
  49. key: DEBUG
  50. name: env-prod
  51. # - name: APP_VERSION
  52. # valueFrom:
  53. # configMapKeyRef:
  54. # key: APP_VERSION
  55. # name: env-prod
  56. - name: DATABASE
  57. valueFrom:
  58. configMapKeyRef:
  59. key: DATABASE
  60. name: env-prod
  61. - name: SQL_HOST
  62. valueFrom:
  63. configMapKeyRef:
  64. key: SQL_HOST
  65. name: env-prod
  66. - name: SQL_PORT
  67. valueFrom:
  68. configMapKeyRef:
  69. key: SQL_PORT
  70. name: env-prod
  71. ports:
  72. - containerPort: 8000
  73. protocol: TCP
  74. volumeMounts:
  75. - mountPath: /app/mediafiles
  76. name: finanzas-media
  77. - mountPath: /app/finanzas/migrations
  78. name: finanzas-finanzas-migrations
  79. - mountPath: /app/reymotausers/migrations
  80. name: finanzas-reymotausers-migrations
  81. - mountPath: /app/staticfiles
  82. name: static-volume
  83. imagePullSecrets:
  84. - name: myregistrykey
  85. restartPolicy: Always
  86. volumes:
  87. - name: finanzas-media
  88. persistentVolumeClaim:
  89. claimName: finanzas-media
  90. - name: finanzas-finanzas-migrations
  91. persistentVolumeClaim:
  92. claimName: finanzas-finanzas-migrations
  93. - name: finanzas-reymotausers-migrations
  94. persistentVolumeClaim:
  95. claimName: finanzas-reymotausers-migrations
  96. - name: static-volume
  97. persistentVolumeClaim:
  98. claimName: static-volume
  99. status: {}