jansu-dev / discourse-on-k8s

It's a tool to build discourse on k8s(adapted to apple silicon system or arm chip)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

discourse-on-k8s

It's a tool to build discourse on k8s(adapted to apple silicon system or arm chip)

Why I do this

  1. First, I'm a rookie who's learning k8s and discourse without familiar with ruby. Because both are very popular on current tech-world, and some good products are using them, like tidb-operator or AskTUG.
  2. Second, I‘ve build my blog website focusing on which tech learning, and wanna find out a way to communicate with others people.
  3. Third, my website was running on my macbook-pro-m1, It's also a big challange to make discourse run on Apple Silicon system.

So, I made this tool or repo based on reasons above, furthermore, I know how difficult and wasting-time it does, I wanna simplify it for everyone.

Until now, The architect of my blog is the pic below. As we can see, Running discourse on macbook-M1-chip which is hardly ever been used and, now, I've finished the one.

blog-arch

Quickstart

Actually, I wanna use golang to write a yaml-generater for discourse-on-k8s, So, later I'll update it.

Details-demo

  1. You should install k8s and docker-desktop, firstly, on your mac, and some steps from ChatGPT may help you. More details on the docker website.

  2. Before finish this project, you may wanna build or learn how it implmented. You can do thing below to look more details:

    git clone https://github.com/jansu-dev/discourse-on-k8s.git
    cd discourse-on-k8s/demo
    
    kubectl apply -f volumns.yaml
    kubectl apply -f redis.yaml
    
    # please replace XXX into you own values
    kubectl create secret generic secret --from-literal=dbUsername=XXX --from-literal=dbPassword='XXX' --from-literal=smtpUsername=XXX --from-literal=smtpPassword=XXX --dry-run=client -o yaml > discourse-secret.yaml
    
    kubectl apply -f discourse-secret.yaml
    kubectl apply -f postgres.yaml
    kubectl apply -f discourse.yaml
    
    
    kubectl port-forward psql 5433:5432
    pg_restore -U discourse -d discourse -p 5433 -h localhost discourse.dump -W
    
    sudo kubectl port-forward svc/web-server 80:80

Thanks

  1. Thanks for discourse community and discourse blog, I got the feeling running discourse-on-m1 is possible, and though, a rookie can learn discourse with abundant experiences as fast and easy as eating food.
  2. Thanks for oursky/discourse-k8s, this repo let me know how to implement moving docker into k8s step by step, really appreciate this sharing.
  3. Thanks really for others who already gave many suggestions and experiences, I couldn't finish it without your help.
  4. Thanks for ChatGPT, without you, I couldn't know every implment details to a rookie.

About

It's a tool to build discourse on k8s(adapted to apple silicon system or arm chip)

License:MIT License