mastodon.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. ---
  2. apiVersion: v1
  3. kind: Namespace
  4. metadata:
  5. name: mastodon
  6. ---
  7. apiVersion: v1
  8. kind: PersistentVolumeClaim
  9. metadata:
  10. name: mastodon-web-pvc
  11. namespace: mastodon
  12. labels:
  13. app: mastodon
  14. spec:
  15. storageClassName: ceph-block
  16. accessModes:
  17. - ReadWriteOnce
  18. resources:
  19. requests:
  20. storage: 5Gi
  21. ---
  22. apiVersion: v1
  23. kind: PersistentVolumeClaim
  24. metadata:
  25. name: mastodon-sidekiq-pvc
  26. namespace: mastodon
  27. labels:
  28. app: mastodon
  29. spec:
  30. storageClassName: ceph-block
  31. accessModes:
  32. - ReadWriteOnce
  33. resources:
  34. requests:
  35. storage: 5Gi
  36. ---
  37. apiVersion: apps/v1
  38. kind: Deployment
  39. metadata:
  40. name: mastodon
  41. namespace: mastodon
  42. spec:
  43. strategy:
  44. type: Recreate
  45. selector:
  46. matchLabels:
  47. app: mastodon
  48. replicas: 1
  49. template:
  50. metadata:
  51. labels:
  52. app: mastodon
  53. spec:
  54. containers:
  55. - name: web
  56. image: tootsuite/mastodon:v4.0.2
  57. command: ["bash", "-c", "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"]
  58. ports:
  59. - containerPort: 3000
  60. name: http-web-svc
  61. envFrom:
  62. - secretRef:
  63. name: mastodon-secret
  64. volumeMounts:
  65. - mountPath: "/mastodon/public/system"
  66. name: system
  67. livenessProbe:
  68. httpGet:
  69. path: /health
  70. port: 3000
  71. failureThreshold: 10
  72. initialDelaySeconds: 30
  73. periodSeconds: 30
  74. timeoutSeconds: 10
  75. - name: streaming
  76. image: tootsuite/mastodon:v4.0.2
  77. command: ["node", "./streaming"]
  78. ports:
  79. - containerPort: 4000
  80. name: http-stream-svc
  81. envFrom:
  82. - secretRef:
  83. name: mastodon-secret
  84. livenessProbe:
  85. httpGet:
  86. path: /api/v1/streaming/health
  87. port: 4000
  88. failureThreshold: 10
  89. initialDelaySeconds: 30
  90. periodSeconds: 30
  91. timeoutSeconds: 10
  92. - name: sidekiq
  93. image: tootsuite/mastodon:v4.0.2
  94. command: ["bundle", "exec", "sidekiq"]
  95. envFrom:
  96. - secretRef:
  97. name: mastodon-secret
  98. volumeMounts:
  99. - mountPath: "/mastodon/public/system"
  100. name: system
  101. volumes:
  102. - name: system
  103. persistentVolumeClaim:
  104. claimName: mastodon-web-pvc
  105. ---
  106. apiVersion: v1
  107. kind: Service
  108. metadata:
  109. name: mastodon-service
  110. namespace: mastodon
  111. spec:
  112. selector:
  113. app: mastodon
  114. type: ClusterIP
  115. ports:
  116. - name: mast-web-port
  117. protocol: TCP
  118. port: 3000
  119. targetPort: http-web-svc
  120. - name: mast-stream-port
  121. protocol: TCP
  122. port: 4000
  123. targetPort: http-stream-svc
  124. ---
  125. apiVersion: traefik.containo.us/v1alpha1
  126. kind: IngressRoute
  127. metadata:
  128. name: mastodon
  129. namespace: mastodon
  130. spec:
  131. entryPoints:
  132. - websecure
  133. routes:
  134. - kind: Rule
  135. match: Host(`mastodon.jibby.org`)
  136. services:
  137. - kind: Service
  138. name: mastodon-service
  139. port: 3000
  140. - kind: Rule
  141. match: Host(`streaming.mastodon.jibby.org`)
  142. services:
  143. - kind: Service
  144. name: mastodon-service
  145. port: 4000