docker-image-update-notifier.yaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. apiVersion: v1
  2. kind: ServiceAccount
  3. metadata:
  4. namespace: default
  5. name: diun
  6. ---
  7. apiVersion: rbac.authorization.k8s.io/v1
  8. kind: ClusterRole
  9. metadata:
  10. name: diun
  11. rules:
  12. - apiGroups:
  13. - ""
  14. resources:
  15. - pods
  16. verbs:
  17. - get
  18. - watch
  19. - list
  20. ---
  21. apiVersion: rbac.authorization.k8s.io/v1
  22. kind: ClusterRoleBinding
  23. metadata:
  24. name: diun
  25. roleRef:
  26. apiGroup: rbac.authorization.k8s.io
  27. kind: ClusterRole
  28. name: diun
  29. subjects:
  30. - kind: ServiceAccount
  31. name: diun
  32. namespace: default
  33. ---
  34. apiVersion: apps/v1
  35. kind: Deployment
  36. metadata:
  37. namespace: default
  38. name: diun
  39. spec:
  40. replicas: 1
  41. selector:
  42. matchLabels:
  43. app: diun
  44. template:
  45. metadata:
  46. labels:
  47. app: diun
  48. annotations:
  49. diun.enable: "true"
  50. spec:
  51. serviceAccountName: diun
  52. containers:
  53. - name: diun
  54. image: crazymax/diun:latest
  55. imagePullPolicy: Always
  56. args: ["serve"]
  57. env:
  58. - name: TZ
  59. value: "Europe/Paris"
  60. - name: LOG_LEVEL
  61. value: "info"
  62. - name: LOG_JSON
  63. value: "false"
  64. - name: DIUN_WATCH_WORKERS
  65. value: "20"
  66. - name: DIUN_WATCH_SCHEDULE
  67. value: "0 */6 * * *"
  68. - name: DIUN_WATCH_JITTER
  69. value: "30s"
  70. - name: DIUN_PROVIDERS_KUBERNETES
  71. value: "true"
  72. - name: DIUN_PROVIDERS_KUBERNETES_WATCHBYDEFAULT
  73. value: "true"
  74. - name: DIUN_NOTIF_NTFY_ENDPOINT
  75. value: "http://ntfy"
  76. - name: DIUN_NOTIF_NTFY_TOKEN
  77. value: "tk_vlw5tjsiwnb8b91w2lv4hh9ad6q5b"
  78. - name: DIUN_NOTIF_NTFY_TOPIC
  79. value: "image-update"
  80. volumeMounts:
  81. - mountPath: "/data"
  82. name: "data"
  83. restartPolicy: Always
  84. volumes:
  85. # Set up a data directory for diun
  86. # For production usage, you should consider using PV/PVC instead(or simply using storage like NAS)
  87. # For more details, please see https://kubernetes.io/docs/concepts/storage/volumes/
  88. - name: "data"
  89. hostPath:
  90. path: /mnt/diun/data
  91. type: Directory