Discourse: move from Bitnami chart to launcher-built image

The Bitnami chart and images stop at 3.5.0. Run Discourse 2026.10.0 from
an image built with the official launcher, on PostgreSQL 18, reusing the
existing uploads volume, Redis and secrets.

Update the Dex sign-in step for the new image paths, drop the removed
LDAP setting, and keep chat off now that it is bundled in core. The image
adds a real-IP rule so visitors are not all rate limited as the ingress.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-08 15:32:46 -05:00
co-authored by Claude Opus 5.5
parent 507b2225b1
commit e91586b968
5 changed files with 266 additions and 83 deletions
+47 -81
View File
@@ -1,90 +1,57 @@
---
# tasks file for discourse
#
# Discourse runs from an image built with the official launcher; the Bitnami
# chart stops at 3.5.0. To upgrade, change params.version in
# files/discourse/web_only.yml, then from a discourse_docker checkout:
# cp <role>/files/discourse/web_only.yml containers/web_only.yml
# launcher build --set base_image=<base_image from templates/web.template.yml>-web-only \
# --tag gitea.eom.dev/devops/discourse-web:<version> web_only --output=type=docker
# Push it, update the image tag in files/discourse/discourse-web.yaml, and re-run.
#
# Pushing through the gitea ingress needs proxy-body-size raised and
# proxy-request-buffering "off" for the push, then restored. With buffering on,
# ingress-nginx writes layers to its node's small disk; on 2026-11-08 that caused
# DiskPressure, evicted the MetalLB speaker, and took the public sites down.
#
# Redis, the secrets, the uploads PVC, the Service and the Ingress still come from
# the original Helm release, which must stay installed but is no longer upgraded.
- name: Deploy PostgreSQL 18 for Discourse
kubernetes.core.k8s:
state: present
src: "{{ role_path }}/files/discourse/postgres18.yaml"
- name: Deploy Discourse
kubernetes.core.helm:
name: discourse
chart_ref: bitnami/discourse
release_namespace: discourse
create_namespace: true
values:
auth:
email: discourse@eom.dev
username: discourse_admin
password: "{{ discourse_admin_password }}"
host: "https://discourse.eom.dev"
siteName: 'Discourse'
smtp:
enabled: true
host: "postfix.eom.dev"
port: "587"
protocol: "tls"
user: "discourse"
password: "{{ discourse_admin_password }}"
image:
debug: false
repository: bitnamilegacy/discourse
tag: 3.4.7-debian-12-r0
service:
externalTrafficPolicy: Local
discourse:
skipInstall: false
plugins:
- https://github.com/discourse/discourse-adplugin
- https://github.com/discourse/discourse-subscriptions
- https://github.com/discourse/discourse-activity-pub
- https://github.com/discourse/discourse-openid-connect
# discourse-ldap-auth removed: its login cannot be disabled by setting,
# and sign-in goes through Dex (discourse-openid-connect) only.
- https://github.com/discourse/discourse-math
- https://github.com/discourse/discourse-post-voting
- https://github.com/discourse/discourse-prometheus
- https://github.com/discourse/discourse-reactions
command:
- /bin/bash
args:
- -c
- |
rm -r /opt/bitnami/discourse/plugins/chat
chown -R discourse:root /opt/bitnami/discourse/plugins
/opt/bitnami/scripts/discourse/entrypoint.sh /opt/bitnami/scripts/discourse/run.sh
persistPlugins: false
compatiblePlugins: true
resourcesPreset: none
persistence:
size: 2Ti
ingress:
enabled: true
ingressClassName: "nginx"
hostname: discourse.eom.dev
annotations:
cert-manager.io/cluster-issuer: ca-issuer
nginx.ingress.kubernetes.io/proxy-set-header: "X-Forwarded-Proto $scheme"
tls: true
postgresql:
enabled: true
image:
repository: bitnamilegacy/postgresql
auth:
enablePostgresUser: true
postgresPassword: "{{ discourse_admin_password }}"
password: "{{ discourse_admin_password }}"
primary:
persistence:
size: 2Ti
redis:
enabled: true
image:
repository: bitnamilegacy/redis
auth:
password: "{{ discourse_admin_password }}"
kubernetes.core.k8s:
state: present
src: "{{ role_path }}/files/discourse/discourse-web.yaml"
wait: true
wait_condition:
type: Available
status: "True"
wait_timeout: 1800
- name: Point the Discourse Service at the launcher-built pods
kubernetes.core.k8s:
state: present
merge_type: merge
definition:
apiVersion: v1
kind: Service
metadata:
name: discourse
namespace: discourse
spec:
selector:
app.kubernetes.io/name: discourse-web
app.kubernetes.io/instance: null
- name: Find the Discourse pod
kubernetes.core.k8s_info:
kind: Pod
namespace: discourse
label_selectors:
- app.kubernetes.io/instance=discourse
- app.kubernetes.io/name=discourse
- app.kubernetes.io/name=discourse-web
field_selectors:
- status.phase=Running
register: discourse_pods
@@ -103,8 +70,7 @@
pod: "{{ discourse_pods.resources[0].metadata.name }}"
container: discourse
command: >-
bash -c 'cd /opt/bitnami/discourse && PATH=/opt/bitnami/ruby/bin:$PATH
RAILS_ENV=production bundle exec ruby -e
"require \"/opt/bitnami/discourse/config/environment\"; load \"/tmp/discourse-sso.rb\""'
bash -c 'cd /var/www/discourse && su discourse -c
"RAILS_ENV=production bundle exec rails runner /tmp/discourse-sso.rb"'
register: discourse_sso
changed_when: false