blog.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. ---
  2. apiVersion: v1
  3. kind: Namespace
  4. metadata:
  5. name: blog
  6. ---
  7. apiVersion: apps/v1
  8. kind: Deployment
  9. metadata:
  10. name: jekyll
  11. namespace: blog
  12. spec:
  13. selector:
  14. matchLabels:
  15. app: jekyll
  16. replicas: 2
  17. template:
  18. metadata:
  19. labels:
  20. app: jekyll
  21. spec:
  22. containers:
  23. - name: jekyll
  24. image: jibby0/docker-jekyll-webhook:latest
  25. ports:
  26. - containerPort: 80
  27. name: http-web-svc
  28. # TODO re-add caching
  29. # tbh this whole auto-update thing isn't really necessary with k8s anymore
  30. #volumeMounts:
  31. #- mountPath: "/vendor"
  32. # name: vendor-cache
  33. env:
  34. - name: TZ
  35. value: America/New_York
  36. - name: REPO
  37. value: https://github.com/jibby0/blog.git
  38. - name: WEBHOOK_SECRET
  39. envFrom:
  40. - secretRef:
  41. name: webhook
  42. livenessProbe:
  43. httpGet:
  44. path: /
  45. port: 80
  46. failureThreshold: 10
  47. initialDelaySeconds: 300
  48. periodSeconds: 10
  49. ---
  50. apiVersion: v1
  51. kind: Service
  52. metadata:
  53. name: jekyll-service
  54. namespace: blog
  55. spec:
  56. selector:
  57. app: jekyll
  58. type: ClusterIP
  59. ports:
  60. - name: jekyll-port
  61. protocol: TCP
  62. port: 80
  63. targetPort: http-web-svc
  64. ---
  65. apiVersion: traefik.containo.us/v1alpha1
  66. kind: IngressRoute
  67. metadata:
  68. name: jekyll
  69. namespace: blog
  70. spec:
  71. entryPoints:
  72. - websecure
  73. routes:
  74. - kind: Rule
  75. match: Host(`jibby.org`)
  76. services:
  77. - kind: Service
  78. name: jekyll-service
  79. port: 80
  80. middlewares:
  81. - name: well-known-redirect
  82. # HACK: for mastodon
  83. ---
  84. apiVersion: traefik.containo.us/v1alpha1
  85. kind: Middleware
  86. metadata:
  87. name: well-known-redirect
  88. namespace: blog
  89. spec:
  90. redirectRegex:
  91. regex: ^https://jibby.org/.well-known/webfinger(.*)
  92. replacement: https://mastodon.jibby.org/.well-known/webfinger${1}
  93. permanent: true