• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

stillinbeta/gke-mastodon

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

stillinbeta/gke-mastodon

开源软件地址(OpenSource Url):

https://github.com/stillinbeta/gke-mastodon

开源编程语言(OpenSource Language):

HCL 100.0%

开源软件介绍(OpenSource Introduction):

Mastodon on GKE

This will set up Mastodon on GKE. It uses Contour as a load balancer / frontend, and Cloud SQL Postgres for a database.

Dependencies

The following prerequesties are necessary to set up Mastodon

Google Cloud APIs

You need the following Google Cloud APIs enabled:

Google Cloud credentials

Create a new service account for Terraform. Give it the Project Owner role. Check "furnish a new private key," and select json. Save the resulting file as "account.json" in the gke-mastodon directory.

Google Kubernetes Engine

The template does not set up the cluster itself, as there's too many options to template. Create a cluster by the name mastodon-prod, or provide an alternate cluster name as a terraform variable.

You will need to set up local credentials as well.

gcloud auth application-default login
gcloud container clusters get-credentials mastodon-prod

Terraform

First, Install Terraform

To get started with Terraform:

terraform init

You will need to provide several variables. These can be either provided as arguments (-var) or as a terraform.tfvars, in the form of:

letsencrypt_email = "<email>"
project_name = "<project>"
domain = "<domain>"

Contour

To install contour, you'll need an admin clusterrolebind

kubectl create clusterrolebinding cluster-admin-binding --clusterrole cluster-admin --user <your google email address>

Then install Contour itself:

kubectl apply -f vendor/contour.yaml

You'll need the IP address Contour assigned to its load balancer.

kubectl get -n heptio-contour service contour -o wide

The IP address you want is listed under external ip.

Set it as contour_ip in the terraform variables.

cert-manager

kubectl apply -f vendor/certmanager.yaml

SMTP

An attempt was made to automate this with terraform, but a bug stymied that attempt. Instead, set up an account (Mastodon recommends Mailgun or SparkPost). and set the smtp_server, smtp_login, and smtp_password terraform variables.

Set Up

Terraform

terraform plan -out terraform.plan

If all goes well, Terraform will tell you a bunch of resources that will be created.

To actually create them, run:

terraform apply terraform.plan

This may take a while, especially creating the database instance.

Google Cloud DNS

After the zone is created (after running Terraform), you'll need to point your name servers at it. You can do retrieve them with:

gcloud dns managed-zones describe mastodon

Kubernetes

Next, install Mastodon into the cluster:

kubectl apply -f mastodon.yaml

And set up the router. This file should've been created by Terraform.

kubectl apply -f serve.yaml

Run the database migrations

Before Mastodon is up and running, you'll need to apply some database migrations.

First, get the IP address of a mastodon node:

kubectl get pods -n mastodon

look for something like web-686d9b865b-kzqpw. The numbers will be different, but that's okay.

Run the migrations:

kubectl exec -n mastodon web-686d9b865b-kzqpw bundle exec rake db:migrate:setup

That may take a few minutes, but once it's done:

Conclusion

At this point you should be good to go! Take a look at the Mastodon administration guide for more ideas on how to proceed!




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
kedamaDQ/backup-mastodon: Periodical backup scripts for mastodon servers.发布时间:2022-08-18
下一篇:
bake/mastodon-go: A Go library for Mastodon发布时间:2022-08-18
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap