Deploy Rocket chat server using Kubernetes

Prerequisites

Kubernetes cluster

  • Creating a cluster manually (advanced)
  • Using AWS, Google Cloud, or Digitalocean ready-to-use cluster
  • Using Kubeadm (best one for small projects)
  • Minikube or MicroKube (not for production)

Kubectl

Deploy

Deploy database

$ mkdir k8s and cd k8s
$ touch mongo.yaml
$ kubectl apply -f mongo.yaml
$ kubectl get all
$ minikube dashboard
$ kubectl exec -it rocketmongo-0 mongo
rs.initiate()
{
"info2" : "no configuration specified. Using a default configuration for the set",
"me" : "rocketmongo-0:27017",
"ok" : 1,
"operationTime" : Timestamp(1609450853, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1609450853, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
> var config = rs.conf()
> config.members[0].host="rocketmongo-0.rocketmongo:27017"
> rs.reconfig(config)
{
"ok" : 1,
"operationTime" : Timestamp(1609451525, 1),
"$clusterTime" : {
"clusterTime" : Timestamp(1609451525, 1),
"signature" : {
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
"keyId" : NumberLong(0)
}
}
}
> rs.add("rocketmongo-1.rocketmongo:27017")
> rs.add("rocketmongo-2.rocketmongo:27017")
> rs.status()

Deploy Rocket chat

$ touch rocketchat.yaml
$ kubectl apply -f rocketchat.yaml
$ kubectl get all
$ minikube service rocketchat-server

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store