From b0c7d40e557163ae5e0d5e06da1c6d4e0d8389f7 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 18 Oct 2022 23:44:29 -0400 Subject: [PATCH 1/2] Update KUBERNETES.md --- DOC/KUBERNETES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOC/KUBERNETES.md b/DOC/KUBERNETES.md index 077a3caf..405f79ea 100644 --- a/DOC/KUBERNETES.md +++ b/DOC/KUBERNETES.md @@ -3,7 +3,7 @@ This document provides an example of how to run rqlite as a Kubernetes [Stateful ## Creating a cluster ### Create Services -The first thing to do is to create some [Kubernetes _Services_](https://kubernetes.io/docs/concepts/services-networking/service). The first service, `rqlite-svc-internal`, is [_Headless_](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) and allows the nodes to cluster automatically. The second service is for clients which needs to talk to the cluster, and will get a Cluster IP address which those clients can use to talk to the rqlite syste. +The first thing to do is to create two [Kubernetes _Services_](https://kubernetes.io/docs/concepts/services-networking/service). The first service, `rqlite-svc-internal`, is [_Headless_](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) and allows the nodes to cluster automatically. The second service is for clients which needs to talk to the cluster, and will get a Cluster IP address which those clients can use to talk to the rqlite syste. A key difference between `rqlite-svc-internal` and `rqlite-svc` is that the second will only contain Pods that are ready to serve traffic. This makes it most suitable for use by end-users of rqlite. From 631647033c4ee27715eb9b3c6298c4222a0e2346 Mon Sep 17 00:00:00 2001 From: Philip O'Toole Date: Tue, 18 Oct 2022 23:48:23 -0400 Subject: [PATCH 2/2] Update KUBERNETES.md --- DOC/KUBERNETES.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/DOC/KUBERNETES.md b/DOC/KUBERNETES.md index 405f79ea..ae98da54 100644 --- a/DOC/KUBERNETES.md +++ b/DOC/KUBERNETES.md @@ -3,7 +3,7 @@ This document provides an example of how to run rqlite as a Kubernetes [Stateful ## Creating a cluster ### Create Services -The first thing to do is to create two [Kubernetes _Services_](https://kubernetes.io/docs/concepts/services-networking/service). The first service, `rqlite-svc-internal`, is [_Headless_](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) and allows the nodes to cluster automatically. The second service is for clients which needs to talk to the cluster, and will get a Cluster IP address which those clients can use to talk to the rqlite syste. +The first thing to do is to create two [Kubernetes _Services_](https://kubernetes.io/docs/concepts/services-networking/service). The first service, `rqlite-svc-internal`, is [_Headless_](https://kubernetes.io/docs/concepts/services-networking/service/#headless-services) and allows the nodes to find each other and cluster automatically. It shouldn't be used by rqlite clients. It is the second service, `rqlite-svc`, which is for clients to talk to the cluster -- this service will get a Cluster IP address which those clients can connect to. A key difference between `rqlite-svc-internal` and `rqlite-svc` is that the second will only contain Pods that are ready to serve traffic. This makes it most suitable for use by end-users of rqlite. @@ -34,7 +34,7 @@ spec: port: 4001 targetPort: 4001 ``` -Apply the configuration above to your Kubernetes deployment. It will create a DNS entries for `rqlite-svc` and `rqlite-svc-internal`, which will resolve to the IP addresses of any Pods with the tag `rqlite`. +Apply the configuration above to your Kubernetes deployment. ```bash kubectl apply -f headless-service.yaml @@ -94,7 +94,7 @@ kubectl apply -f stateful-set.yaml ``` where the file `stateful-set.yaml` contains the configuration shown above. -Note the `args` passed to rqlite. The arguments tell rqlite to use `dns` discovery mode, and to resolve the DNS name `rqlite-svc` to find the IP addresses of other nodes in the cluster. Furthermore it tells rqlite to wait until three nodes are available (counting itself as one of those nodes) before attempting to form a cluster. +Note the `args` passed to rqlite. The arguments tell rqlite to use `dns` discovery mode, and to resolve the DNS name `rqlite-svc-internal` to find the IP addresses of other nodes in the cluster. Furthermore it tells rqlite to wait until three nodes are available (counting itself as one of those nodes) before attempting to form a cluster. ## Scaling the cluster You can grow the cluster at anytime, simply by increasing the replica count. Shrinking the cluster, however, will require some manual intervention. As well reducing the `replicas` value, you also need to [explicitly remove](https://github.com/rqlite/rqlite/blob/master/DOC/CLUSTER_MGMT.md#removing-or-replacing-a-node) the deprovisioned nodes, or the Leader will continually attempt to contact those nodes.