mastodon.yaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143
  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. selector:
  44. matchLabels:
  45. app: mastodon
  46. replicas: 1
  47. template:
  48. metadata:
  49. labels:
  50. app: mastodon
  51. spec:
  52. containers:
  53. - name: web
  54. image: tootsuite/mastodon:v4.0.2
  55. command: ["bash", "-c", "rm -f /mastodon/tmp/pids/server.pid; bundle exec rails s -p 3000"]
  56. ports:
  57. - containerPort: 3000
  58. name: http-web-svc
  59. envFrom:
  60. - secretRef:
  61. name: mastodon-secret
  62. volumeMounts:
  63. - mountPath: "/mastodon/public/system"
  64. name: system
  65. livenessProbe:
  66. httpGet:
  67. path: /health
  68. port: 3000
  69. failureThreshold: 10
  70. initialDelaySeconds: 30
  71. periodSeconds: 30
  72. timeoutSeconds: 10
  73. - name: streaming
  74. image: tootsuite/mastodon:v4.0.2
  75. command: ["node", "./streaming"]
  76. ports:
  77. - containerPort: 4000
  78. name: http-stream-svc
  79. envFrom:
  80. - secretRef:
  81. name: mastodon-secret
  82. livenessProbe:
  83. httpGet:
  84. path: /api/v1/streaming/health
  85. port: 4000
  86. failureThreshold: 10
  87. initialDelaySeconds: 30
  88. periodSeconds: 30
  89. timeoutSeconds: 10
  90. - name: sidekiq
  91. image: tootsuite/mastodon:v4.0.2
  92. command: ["bundle", "exec", "sidekiq"]
  93. envFrom:
  94. - secretRef:
  95. name: mastodon-secret
  96. volumeMounts:
  97. - mountPath: "/mastodon/public/system"
  98. name: system
  99. volumes:
  100. - name: system
  101. persistentVolumeClaim:
  102. claimName: mastodon-web-pvc
  103. ---
  104. apiVersion: v1
  105. kind: Service
  106. metadata:
  107. name: mastodon-service
  108. namespace: mastodon
  109. spec:
  110. selector:
  111. app: mastodon
  112. type: ClusterIP
  113. ports:
  114. - name: mast-web-port
  115. protocol: TCP
  116. port: 3000
  117. targetPort: http-web-svc
  118. - name: mast-stream-port
  119. protocol: TCP
  120. port: 4000
  121. targetPort: http-stream-svc
  122. ---
  123. apiVersion: traefik.containo.us/v1alpha1
  124. kind: IngressRoute
  125. metadata:
  126. name: mastodon
  127. namespace: mastodon
  128. spec:
  129. entryPoints:
  130. - websecure
  131. routes:
  132. - kind: Rule
  133. match: Host(`mastodon.jibby.org`)
  134. services:
  135. - kind: Service
  136. name: mastodon-service
  137. port: 3000
  138. - kind: Rule
  139. match: Host(`streaming.mastodon.jibby.org`)
  140. services:
  141. - kind: Service
  142. name: mastodon-service
  143. port: 4000