deployment.yaml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: popeye
  5. spec:
  6. selector:
  7. matchLabels:
  8. app.kubernetes.io/name: popeye
  9. app.kubernetes.io/part-of: popeye
  10. template:
  11. metadata:
  12. labels:
  13. app.kubernetes.io/name: popeye
  14. app.kubernetes.io/part-of: popeye
  15. spec:
  16. serviceAccountName: popeye
  17. initContainers:
  18. - name: popeye
  19. image: derailed/popeye:v0.21.1
  20. command: ["/bin/popeye"]
  21. env:
  22. - name: POPEYE_REPORT_DIR
  23. value: /var/www
  24. args:
  25. - --force-exit-zero
  26. - --out
  27. - html
  28. - --save
  29. - --output-file
  30. - index.html
  31. resources:
  32. limits:
  33. cpu: 500m
  34. memory: 100Mi
  35. volumeMounts:
  36. - mountPath: /var/www
  37. name: data
  38. containers:
  39. - image: nixery.dev/shell/busybox
  40. name: busybox
  41. command: ["/bin/httpd"]
  42. args: ["-f", "-p", "0.0.0.0:8080", "-h", "/var/www"]
  43. resources:
  44. limits:
  45. cpu: 10m
  46. memory: 15Mi
  47. requests:
  48. cpu: 1m
  49. memory: 10Mi
  50. securityContext:
  51. allowPrivilegeEscalation: false
  52. capabilities:
  53. drop:
  54. - "ALL"
  55. add:
  56. - "CHOWN"
  57. - "DAC_OVERRIDE"
  58. - "SETGID"
  59. - "SETUID"
  60. - "NET_BIND_service"
  61. - "SYS_CHROOT"
  62. readOnlyRootFilesystem: true
  63. runAsNonRoot: true
  64. runAsUser: 1000
  65. runAsGroup: 1000
  66. livenessProbe:
  67. httpGet:
  68. port: 8080
  69. readinessProbe:
  70. httpGet:
  71. port: 8080
  72. volumeMounts:
  73. - name: data
  74. mountPath: /var/www
  75. readOnly: true
  76. volumes:
  77. - name: data
  78. emptyDir:
  79. sizeLimit: 10M