In this guide, we are going to install an Octelium Cluster on top of an already running Kubernetes cluster via the octops init
command for production-grade and scalable deployments. It is highly recommended that you read the pre-installation considerations here before installing your first production Cluster.
If you want to install a single-node Cluster on top of a cloud or on-prem VPS/VM for personal, development, or undemanding production use cases, you might want to check out the quick installation guide instead, here.
Prepare Kubernetes Cluster
Prepare the Kubernetes cluster nodes. In this guide, we assume that we're going to use only 2 Kubernetes nodes. One for data-plane, named data-plane-1
, and the other for control-plane, named control-plane-1
. Note that you can obtain the Kubernetes node information via the command kubectl get nodes
.
- Label the data-plane node to be used as a data-plane node by Octelium as follows:
kubectl label nodes data-plane-1 octelium.com/node-mode-dataplane=
- Label the control-plane node to be used as a control-plane node by Octelium as follows:
kubectl label nodes control-plane-1 octelium.com/node-mode-controlplane=
- Taint the data-plane node with the key
octelium.com/gateway-init
and the effectNO_SCHEDULE
to prevent the node from hosting Services until the GatewayAgent is deployed as follows:
kubectl taint nodes data-plane-1 octelium.com/gateway-init=true:NoSchedule
- If the data-plane node (i.e.
data-plane-1
in our case) is behind NAT, you might want to inform the Cluster of the node's public IP address (read more here) as follows:
kubectl annotate node data-plane-1 octelium.com/public-ip=1.2.3.4
-
Install a CNI plugin if your Kubernetes cluster does not already have one. You can, for example, install Cilium as illustrated here. Another popular option is Calico which you can install as illustrated here.
-
Install Multus CNI. If your Kubernetes cluster uses containerd as the container runtime (which is the default option in many Kubernetes deployments) you need to install Multus as follows:
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset.yml
However, if your Kubernetes cluster uses CRI-O instead of containerd, then you need to install Multus as follows:
kubectl apply -f https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-crio.yml
Prepare a Bootstrap Config File
Prepare a Bootstrap config file. A minimal production Bootstrap config file can contain only the storage information of your PostgreSQL and Redis stores. Here is an example:
1spec:2primaryStorage:3postgresql:4username: postgres5password: password6host: pg.provider.example.com7port: 54328database: octelium9isTLS: true10secondaryStorage:11redis:12username: redis-user13password: password14host: 1.2.3.415port: 637916database: 017isTLS: true
Installation
We can now install the Cluster via the command octops init
as follows:
octops init <DOMAIN> --bootstrap /PATH/TO/BOOTSTRAP_CONFIG.yaml
You can install the Octelium CLIs which include octops
if you have not done that already as shown here.
Note that by default, octops init
command uses the kubeconfig that is located at $HOME/.kube/config
. You can override that location via the --kubeconfig
flag as follows:
octops init <DOMAIN> --kubeconfig /path/to/kubeconfig --bootstrap /PATH/TO/BOOTSTRAP_CONFIG.yaml
You can also set the kubeconfig context via the --kubecontext
flag. By default, octops init
installs the latest
Octelium Cluster version. If you want to override that behavior and install a certain version, you can do so via the --version
flag as follows:
octops init <DOMAIN> --bootstrap /PATH/TO/BOOTSTRAP_CONFIG.yaml --version 1.2.3
If you're installing the Cluster on top of a single node VM, as opposed to a managed Kubernetes cluster with a managed load balancer, whose public IP address is used as an external IP for the Cluster's Ingress, you can simply inform octops init
command of the public IP address of the node via the OCTELIUM_REGION_EXTERNAL_IP
environment variable. Here is an example:
OCTELIUM_REGION_EXTERNAL_IP=1.2.3.4 octops init <DOMAIN> --kubeconfig /path/to/kubeconfig --bootstrap /PATH/TO/BOOTSTRAP_CONFIG.yaml
This operation usually takes a few minutes to complete depending on the performance and specs of the underlying infrastructure of the Kubernetes cluster nodes. This command installs all the Octelium dependencies, components, resources, etc... using the in-Cluster installer component called Genesis and then waits for the Octelium Cluster to become ready for use.
Setting Public DNS
By the end of the installation, you must set the public DNS for the Cluster domain to enable it to receive requests from Users publicly over the internet. You can read more about how to obtain the public IP address used to set the public DNS entry of the Cluster domain here.
Setting Cluster TLS Certificate
By the end of the installation, you must also set the TLS certificate for the Cluster domain to enable it to receive requests from Users publicly over the internet. You can read more about how to obtain the public IP address used to set the public DNS entry of the Cluster domain here.
What Now?
Now our Cluster has been successfully installed and is now running. You can learn more about how to manage and use the Cluster in the following guides: