diff --git a/.github/workflows/test-chart.yml b/.github/workflows/test-chart.yml index 3e02fc6..09e1519 100644 --- a/.github/workflows/test-chart.yml +++ b/.github/workflows/test-chart.yml @@ -17,7 +17,7 @@ permissions: jobs: lint-templates: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v3 @@ -53,7 +53,7 @@ jobs: # basic configuration can be used to successfully startup mastodon. # test-install: - runs-on: ubuntu-22.04 + runs-on: ubuntu-24.04 timeout-minutes: 15 strategy: @@ -75,7 +75,7 @@ jobs: # available for use in the templates, currently we need v3.6.0 or # higher. # - - k3s-channel: v1.21 + - k3s-channel: v1.28 helm-version: v3.8.0 env: @@ -109,7 +109,7 @@ jobs: run: | helm install mastodon . \ --values dev-values.yaml \ - --timeout 10m + --timeout 15m # This actions provides a report about the state of the k8s cluster, # providing logs etc on anything that has failed and workloads marked as @@ -125,7 +125,5 @@ jobs: deploy/mastodon-sidekiq deploy/mastodon-streaming deploy/mastodon-web - job/mastodon-assets-precompile - job/mastodon-chewy-upgrade job/mastodon-create-admin job/mastodon-db-migrate diff --git a/.gitignore b/.gitignore index ee3892e..a5b65d3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ charts/ +.DS_Store diff --git a/Chart.yaml b/Chart.yaml index 01f754e..9dcb978 100644 --- a/Chart.yaml +++ b/Chart.yaml @@ -15,12 +15,12 @@ type: application # This is the chart version. This version number should be incremented each time # you make changes to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 5.5.3 +version: 6.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: "v4.2.17" +appVersion: "v4.3.4" dependencies: - name: elasticsearch diff --git a/templates/deployment-streaming.yaml b/templates/deployment-streaming.yaml index 9f4a6b9..1139f9d 100644 --- a/templates/deployment-streaming.yaml +++ b/templates/deployment-streaming.yaml @@ -70,7 +70,7 @@ spec: securityContext: {{- toYaml . | nindent 12 }} {{- end }} - image: "{{ coalesce .Values.mastodon.streaming.image.repository .Values.image.repository }}:{{ coalesce .Values.mastodon.streaming.image.tag .Values.image.tag .Chart.AppVersion }}" + image: "{{ .Values.mastodon.streaming.image.repository }}:{{ coalesce .Values.mastodon.streaming.image.tag .Values.image.tag .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} command: - node diff --git a/templates/job-assets-precompile.yaml b/templates/job-assets-precompile.yaml deleted file mode 100644 index f3b8fa7..0000000 --- a/templates/job-assets-precompile.yaml +++ /dev/null @@ -1,93 +0,0 @@ -{{- if .Values.mastodon.hooks.assetsPrecompile.enabled -}} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "mastodon.fullname" . }}-assets-precompile - labels: - {{- include "mastodon.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": post-install - "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded - "helm.sh/hook-weight": "-2" -spec: - template: - metadata: - name: {{ include "mastodon.fullname" . }}-assets-precompile - {{- with .Values.jobAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - restartPolicy: Never - {{- if (not .Values.mastodon.s3.enabled) }} - # ensure we run on the same node as the other rails components; only - # required when using PVCs that are ReadWriteOnce - {{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }} - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app.kubernetes.io/part-of - operator: In - values: - - rails - topologyKey: kubernetes.io/hostname - {{- end }} - volumes: - - name: assets - persistentVolumeClaim: - claimName: {{ template "mastodon.pvc.assets" . }} - - name: system - persistentVolumeClaim: - claimName: {{ template "mastodon.pvc.system" . }} - {{- end }} - containers: - - name: {{ include "mastodon.fullname" . }}-assets-precompile - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: - - bash - - -c - - | - bundle exec rake assets:precompile && yarn cache clean - envFrom: - - configMapRef: - name: {{ include "mastodon.fullname" . }}-env - - secretRef: - name: {{ template "mastodon.secretName" . }} - env: - - name: "DB_PASS" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.postgresql.secretName" . }} - key: password - - name: "REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.redis.secretName" . }} - key: redis-password - {{- if and .Values.redis.sidekiq.enabled .Values.redis.sidekiq.auth.existingSecret }} - - name: "SIDEKIQ_REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.redis.sidekiq.secretName" . }} - key: redis-password - {{- end }} - {{- if and .Values.redis.cache.enabled .Values.redis.cache.auth.existingSecret }} - - name: "CACHE_REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.redis.cache.secretName" . }} - key: redis-password - {{- end }} - - name: "PORT" - value: {{ .Values.mastodon.web.port | quote }} - {{- if (not .Values.mastodon.s3.enabled) }} - volumeMounts: - - name: assets - mountPath: /opt/mastodon/public/assets - - name: system - mountPath: /opt/mastodon/public/system - {{- end }} -{{- end -}} diff --git a/templates/job-chewy-upgrade.yaml b/templates/job-chewy-upgrade.yaml deleted file mode 100644 index e760f34..0000000 --- a/templates/job-chewy-upgrade.yaml +++ /dev/null @@ -1,100 +0,0 @@ -{{- if .Values.elasticsearch.enabled -}} -apiVersion: batch/v1 -kind: Job -metadata: - name: {{ include "mastodon.fullname" . }}-chewy-upgrade - labels: - {{- include "mastodon.labels" . | nindent 4 }} - annotations: - "helm.sh/hook": post-install - "helm.sh/hook-delete-policy": before-hook-creation,hook-succeeded - "helm.sh/hook-weight": "-1" -spec: - template: - metadata: - name: {{ include "mastodon.fullname" . }}-chewy-upgrade - {{- with .Values.jobAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - spec: - restartPolicy: Never - {{- if (not .Values.mastodon.s3.enabled) }} - # ensure we run on the same node as the other rails components; only - # required when using PVCs that are ReadWriteOnce - {{- if or (eq "ReadWriteOnce" .Values.mastodon.persistence.assets.accessMode) (eq "ReadWriteOnce" .Values.mastodon.persistence.system.accessMode) }} - affinity: - podAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - - labelSelector: - matchExpressions: - - key: app.kubernetes.io/part-of - operator: In - values: - - rails - topologyKey: kubernetes.io/hostname - {{- end }} - volumes: - - name: assets - persistentVolumeClaim: - claimName: {{ template "mastodon.pvc.assets" . }} - - name: system - persistentVolumeClaim: - claimName: {{ template "mastodon.pvc.system" . }} - {{- end }} - containers: - - name: {{ include "mastodon.fullname" . }}-chewy-setup - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - command: - - bundle - - exec - - rake - - chewy:upgrade - envFrom: - - configMapRef: - name: {{ include "mastodon.fullname" . }}-env - - secretRef: - name: {{ template "mastodon.secretName" . }} - env: - - name: "DB_PASS" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.postgresql.secretName" . }} - key: password - - name: "REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.redis.secretName" . }} - key: redis-password - {{- if and .Values.redis.sidekiq.enabled .Values.redis.sidekiq.auth.existingSecret }} - - name: "SIDEKIQ_REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.redis.sidekiq.secretName" . }} - key: redis-password - {{- end }} - {{- if and .Values.redis.cache.enabled .Values.redis.cache.auth.existingSecret }} - - name: "CACHE_REDIS_PASSWORD" - valueFrom: - secretKeyRef: - name: {{ template "mastodon.redis.cache.secretName" . }} - key: redis-password - {{- end }} - {{- if and .Values.elasticsearch.existingSecret (or .Values.elasticsearch.enabled .Values.elasticsearch.hostname) }} - - name: "ES_PASS" - valueFrom: - secretKeyRef: - name: {{ .Values.elasticsearch.existingSecret }} - key: password - {{- end }} - - name: "PORT" - value: {{ .Values.mastodon.web.port | quote }} - {{- if (not .Values.mastodon.s3.enabled) }} - volumeMounts: - - name: assets - mountPath: /opt/mastodon/public/assets - - name: system - mountPath: /opt/mastodon/public/system - {{- end }} -{{- end }} diff --git a/values.yaml b/values.yaml index bcb6a44..93d4d9e 100644 --- a/values.yaml +++ b/values.yaml @@ -6,7 +6,7 @@ image: # built from the most recent commit # # tag: latest - tag: null + tag: "" # use `Always` when using `latest` tag pullPolicy: IfNotPresent @@ -29,8 +29,6 @@ mastodon: # work when using the included database (postgresql.enabled=true). dbMigrate: enabled: true - assetsPrecompile: - enabled: true # Upload website assets to S3 before deploying using rclone. # Whenever there is an update to Mastodon, sometimes there are assets files # that are renamed. As the pods are getting redeployed, and old/new pods are @@ -279,8 +277,10 @@ mastodon: existingSecret: streaming: image: - repository: - tag: + # streaming image split in Mastodon v4.3.0 + repository: ghcr.io/mastodon/mastodon-streaming + # other options: `latest` for the latest release or `edge` for most recent commit + tag: "" port: 4000 # -- this should be set manually since os.cpus() returns the number of CPUs on # the node running the pod, which is unrelated to the resources allocated to