From 024136dc7c47ce4e5c5c592b7f7411c6c46e9b49 Mon Sep 17 00:00:00 2001 From: Carlos Salas Date: Thu, 31 Aug 2023 14:22:59 +0200 Subject: [PATCH] docs: add running out of cluster adr Signed-off-by: Carlos Salas --- ...-running-out-of-rancher-manager-cluster.md | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 docs/adr/0004-running-out-of-rancher-manager-cluster.md diff --git a/docs/adr/0004-running-out-of-rancher-manager-cluster.md b/docs/adr/0004-running-out-of-rancher-manager-cluster.md new file mode 100644 index 00000000..1352abca --- /dev/null +++ b/docs/adr/0004-running-out-of-rancher-manager-cluster.md @@ -0,0 +1,48 @@ + + +**Table of Contents** *generated with [DocToc](https://github.com/thlorenz/doctoc)* + +- [4. Running out of Rancher Manager cluster](#4-running-out-of-rancher-manager-cluster) + - [Context](#context) + - [Decision](#decision) + - [Consequences](#consequences) + + + +# 4. Running out of Rancher Manager cluster + +* Status: proposed +* Date: 2023-08-31 +* Authors: @salasberryfin +* Deciders: @richardcase @alexander-demicev @furkatgofurov7 @Danil-Grigorev @mjura + +## Context + +As an operator, I want the choice to deploy Rancher Turtles in the same or a +different cluster to Rancher Manager, so that I have a choice in my deployment +topology. + +## Decision + +`CAPIImportReconciler` will contain two differentiated clients: +- `Client`: in-cluster client for the controller and the CAPI resources. +- `RancherClient`: for the Rancher Manager cluster. + +A flag `rancher-kubeconfig` with a path to a kubeconfig file is used to select +the type of installation: +- If no value is passed, Rancher Turtles is set to the same cluster +installation: `Client` and `RancherClient` are the same instance of the client. +- If a valid path to a kubeconfig file is passed, `RancherClient` is set to +client created from the kubeconfig. + +From an end-user perspective: + +* No parameter is required if Rancher Manager and Rancher Turtles run in the +same cluster. +* User will provide a path to a valid kubeconfig file that is available in the +pod if installing Rancher Turtles outside of Rancher Manager cluster. + +## Consequences + +- The path to the kubeconfig must be mounted in the pod to be accessible. This +pattern is aligned with what is used in [controller-runtime](https://github.com/kubernetes-sigs/controller-runtime/blob/964a416cf5acf5a67bdc5904897006447ac11509/pkg/client/config/config.go#L60).