docker-image-update-notifier.yaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. diun.include_tags: '^\d+\.\d+\.\d+$'
  51. diun.exclude_tags: 'edge;latest'
  52. spec:
  53. serviceAccountName: diun
  54. containers:
  55. - name: diun
  56. image: crazymax/diun:4.31.0
  57. imagePullPolicy: IfNotPresent
  58. args: ["serve"]
  59. env:
  60. - name: TZ
  61. value: "Europe/Paris"
  62. - name: LOG_LEVEL
  63. value: "info"
  64. - name: LOG_JSON
  65. value: "false"
  66. - name: DIUN_WATCH_WORKERS
  67. value: "20"
  68. - name: DIUN_WATCH_SCHEDULE
  69. value: "0 */6 * * *"
  70. - name: DIUN_WATCH_JITTER
  71. value: "30s"
  72. - name: DIUN_DEFAULTS_WATCHREPO
  73. value: "true"
  74. - name: DIUN_DEFAULTS_MAXTAGS
  75. value: "10"
  76. - name: DIUN_NOTIF_NTFY_ENDPOINT
  77. value: "http://ntfy"
  78. - name: DIUN_NOTIF_NTFY_TOKEN
  79. value: "tk_vlw5tjsiwnb8b91w2lv4hh9ad6q5b"
  80. - name: DIUN_NOTIF_NTFY_TOPIC
  81. value: "image-update"
  82. - name: DIUN_PROVIDERS_KUBERNETES
  83. value: "true"
  84. - name: DIUN_PROVIDERS_KUBERNETES_WATCHBYDEFAULT
  85. value: "false"
  86. volumeMounts:
  87. - mountPath: "/data"
  88. name: "data"
  89. restartPolicy: Always
  90. volumes:
  91. # Set up a data directory for diun
  92. # For production usage, you should consider using PV/PVC instead(or simply using storage like NAS)
  93. # For more details, please see https://kubernetes.io/docs/concepts/storage/volumes/
  94. - name: "data"
  95. hostPath:
  96. path: /mnt/diun/data
  97. type: Directory