Kubernetes からセルフホスト型ソリューションへの移行

こんにちは皆様、

しばらくの間、非公式のBitnamiイメージを使用してKubernetesクラスターでDiscourseを実行しています。Bitnamiがイメージを廃止し、有料化するため、サーバーをAWS上のセルフホストソリューションに移行したいと考えています。

コミュニティの皆様にご協力いただけると幸いです。いくつか質問があります。

  • すでにインストール用に外部Postgres DBを使用しており、これはそのまま維持します。しかし、UIや環境変数を使用していくつかの設定を更新しましたが、BitnamiのインストールスクリプトはDiscourseにマッピングします。例えば、DISCOURSE_S3_BACKUP_BUCKETS3_BACKUP_BUCKETにマッピングされます。
    • 必要なyamlファイルでDiscourseの設定を行うだけで十分ですか、それとも引き続きenv varsを使用すべきですか?
    • UIからバックアップを実行した場合、実際に何を復元しますか?データベースは更新されますか?
    • クリーンインストールでまったく新しいデータベースを作成してからバックアップ/復元を実行する方が良いですか?
    • 新しいインストールがDiscourseの後のバージョンである場合、復元を試みると問題が発生しますか?
  • 標準のインストールガイドではDockerを使用していますが、標準のインストールはDockerを備えた単一のVMのように見えますが、本番環境でコンテナをどのように監視しますか?
  • 移行と注意点に関する詳細なドキュメントはありますか?

移行が進むにつれてさらに質問が出てくると思いますが、どのようなアドバイスや支援でもいただけると大変感謝いたします。

よろしくお願いします。

If it wasn’t already your plan, I’d move to a new database (on the same server) for the migration so you don’t break your existing site.

I can’t tell quite what you think Bitnami is doing, but the thing you want in your ENV is DISCOURSE_S3_BACKUP_BUCKET. See Configure an S3 compatible object storage provider for uploads for how to properly set those S3 variables in your app.yml.

If by “better” you mean “will this mean that I won’t break our existing site and leave it in a state where it will never work again?”, the answer is yes. :wink:

Set them in the YML

Yes it will update the database. I would recommend that you Restore a backup from the command line

That’s what you want. The place you restore from has to be the same or newer than the backup version. It’ll migrate the database after it’s restored.

This might be all you need to know and we’re happy to help here for free. If you’d like hands-on your-setup-specific attention, you can contact me or ask for help in Marketplace.

Also, another option would be to build images and launch those in k8s. I’ve done that a few times and used github to build the images.

If it wasn’t already your plan, I’d move to a new database (on the same server) for the migration so you don’t break your existing site.

I can’t tell quite what you think Bitnami is doing, but the thing you want in your ENV is DISCOURSE_S3_BACKUP_BUCKET. See Configure an S3 compatible object storage provider for uploads for how to properly set those S3 variables in your app.yml.

If by “better” you mean “will this mean that I won’t break our existing site and leave it in a state where it will never work again?”, the answer is yes. :wink:

Set them in the YML

Yes it will update the database. I would recommend that you Restore a backup from the command line

That’s what you want. The place you restore from has to be the same or newer than the backup version. It’ll migrate the database after it’s restored.

This might be all you need to know and we’re happy to help here for free. If you’d like hands-on your-setup-specific attention, you can contact me or ask for help in Marketplace.

Also, another option would be to build images and launch those in k8s. I’ve done that a few times and used github to build the images.

私の経験も同様です。長年にわたり、非常に奇妙な小さな障害を数多く見てきました。そのため、常に完全なバックアップを維持しており、最初からやり直してサイトを復元できるようにしています。問題をその場で修正することに頼ると、最終的にはうまくいかなくなります。

あなたと同じように、Bitnamiが無料のイメージとチャートの提供を停止したとき、私は窮地に立たされました。多くのデプロイメントを適応させ、移行しなければなりませんでした。そのうちの1つが私のDiscourseデプロイメントでした。もし役に立つなら、私が非常に短時間で作成した代替Helmチャートへのリンクをここに示します(つまり、機能しますが、理想的な設計からは程遠いです)。これは、「公式のインストール方法」を使用しようとする試みです。なぜなら、これほど長い年月が経過しても「コミュニティ標準」のHelmチャートが登場するのを見ていないからです。(Bitnamiのチャートが事実上の標準だったのでしょう。なぜなら、この突然の変更を予測していた人はほとんどいなかったからです。)いずれにしても、私が1つの研究コミュニティで実行しているこの新しいチャートは、基本的に2つのコンテナを持つポッドです。公式のDocker-in-Dockerコンテナと、python:3に基づいたカスタムコンテナで、Dockerをインストールしてから公式のDiscourseインストールを使用します。すべてのコンポーネント(Discourseサーバー、Redis、PostgreSQL)が、ランチャースクリプトによってビルドされたローカルイメージのブラックボックス内で実行されるため、スケーラビリティや高可用性のサポートはありません。docker saveを使用してビルドされたイメージを永続ボリュームに保存し、local_discourse/app:latestが見つからない場合にそれをロードすることで、ポッドが別のノードで再起動する(例:OSアップデートやノードクラッシュのためにノードをドレインする場合)ことによるダウンタイムを削減することには成功しました。

しかし、あなたの質問に答えるために、この新しいデプロイメントで何かを監視する方法はわかりません。私は「本番環境」で実行していますが、私のコミュニティは十分に小さく、使用量も中程度なので、フォーラムが一時的にオフラインになっても大した問題ではありません。それでも、自己ホスティングを断念し、CommuniteqDiscourse.orgのようなサービスに移行することに非常に近いです。

「いいね!」 2