闭社主体 forked from https://github.com/tootsuite/mastodon
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
3.2 KiB

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: {{ include "mastodon.fullname" . }}-web
  5. labels:
  6. {{- include "mastodon.labels" . | nindent 4 }}
  7. spec:
  8. {{- if not .Values.autoscaling.enabled }}
  9. replicas: {{ .Values.replicaCount }}
  10. {{- end }}
  11. selector:
  12. matchLabels:
  13. {{- include "mastodon.selectorLabels" . | nindent 6 }}
  14. component: rails
  15. template:
  16. metadata:
  17. {{- with .Values.podAnnotations }}
  18. annotations:
  19. {{- toYaml . | nindent 8 }}
  20. # roll the pods to pick up any db migrations
  21. rollme: {{ randAlphaNum 5 | quote }}
  22. {{- end }}
  23. labels:
  24. {{- include "mastodon.selectorLabels" . | nindent 8 }}
  25. component: rails
  26. spec:
  27. {{- with .Values.imagePullSecrets }}
  28. imagePullSecrets:
  29. {{- toYaml . | nindent 8 }}
  30. {{- end }}
  31. serviceAccountName: {{ include "mastodon.serviceAccountName" . }}
  32. securityContext:
  33. {{- toYaml .Values.podSecurityContext | nindent 8 }}
  34. volumes:
  35. - name: assets
  36. persistentVolumeClaim:
  37. claimName: {{ template "mastodon.fullname" . }}-assets
  38. - name: system
  39. persistentVolumeClaim:
  40. claimName: {{ template "mastodon.fullname" . }}-system
  41. containers:
  42. - name: {{ .Chart.Name }}
  43. securityContext:
  44. {{- toYaml .Values.securityContext | nindent 12 }}
  45. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  46. imagePullPolicy: {{ .Values.image.pullPolicy }}
  47. command:
  48. - bundle
  49. - exec
  50. - puma
  51. - -C
  52. - config/puma.rb
  53. envFrom:
  54. - configMapRef:
  55. name: {{ include "mastodon.fullname" . }}-env
  56. - secretRef:
  57. name: {{ template "mastodon.fullname" . }}
  58. env:
  59. - name: "DB_PASS"
  60. valueFrom:
  61. secretKeyRef:
  62. name: {{ .Release.Name }}-postgresql
  63. key: postgresql-password
  64. - name: "REDIS_PASSWORD"
  65. valueFrom:
  66. secretKeyRef:
  67. name: {{ .Release.Name }}-redis
  68. key: redis-password
  69. - name: "PORT"
  70. value: {{ .Values.application.web.port | quote }}
  71. volumeMounts:
  72. - name: assets
  73. mountPath: /opt/mastodon/public/assets
  74. - name: system
  75. mountPath: /opt/mastodon/public/system
  76. ports:
  77. - name: http
  78. containerPort: {{ .Values.application.web.port }}
  79. protocol: TCP
  80. livenessProbe:
  81. httpGet:
  82. path: /health
  83. port: http
  84. readinessProbe:
  85. httpGet:
  86. path: /health
  87. port: http
  88. resources:
  89. {{- toYaml .Values.resources | nindent 12 }}
  90. {{- with .Values.nodeSelector }}
  91. nodeSelector:
  92. {{- toYaml . | nindent 8 }}
  93. {{- end }}
  94. {{- with .Values.affinity }}
  95. affinity:
  96. {{- toYaml . | nindent 8 }}
  97. {{- end }}
  98. {{- with .Values.tolerations }}
  99. tolerations:
  100. {{- toYaml . | nindent 8 }}
  101. {{- end }}