# How to install Reactor for Linstor-controller-HA in a k8s environment?

**URL:** <https://forums.linbit.com/t/how-to-install-reactor-for-linstor-controller-ha-in-a-k8s-environment/468>\
**Category:** LINSTOR\
**Tags:** kubernetes, drbd\
**Created:** [December 1, 2024, 11:59pm UTC](https://forums.linbit.com/t/how-to-install-reactor-for-linstor-controller-ha-in-a-k8s-environment/468 "2024-12-01T23:59:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jkim](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jkim](https://forums.linbit.com/u/jkim)\
**Post date:** [December 1, 2024, 11:59pm UTC](https://forums.linbit.com/t/how-to-install-reactor-for-linstor-controller-ha-in-a-k8s-environment/468/1 "2024-12-01T23:59:34Z")

</div>

> **[LINSTOR 1.0 en](https://linbit.com/drbd-user-guide/linstor-guide-1_0-en/#s-linstor_ha)**
>
> The LINSTOR User’s Guide 2024-11-14 18:53:02 UTC Please Read This First This guide is intended to serve users of the software-defined storage (SDS) solution LINSTOR® as a definitive reference guide and handbook. This guide assumes, throughout, that...

This link explains how to install Reactor for linstor HA in a general environment, not k8s.

I am looking for a way to Linstor controller HA in a k8s environment.  
Is there a way to install Reactor in a k8s container environment?

---

<div class="post-metadata">

**Author:** ![wanzenbug](https://yyz1.discourse-cdn.com/flex003/user_avatar/forums.linbit.com/wanzenbug/32/39_2.png) [@wanzenbug](https://forums.linbit.com/u/wanzenbug)\
**Post date:** [December 2, 2024, 12:59pm UTC](https://forums.linbit.com/t/how-to-install-reactor-for-linstor-controller-ha-in-a-k8s-environment/468/2 "2024-12-02T12:59:23Z")

</div>

Generally, you don’t need to. In a Kubernetes environment using either Piraeus or LINBIT SDS Operator, the LINSTOR Controller is configured to use the Kubernetes API as a database.

So as long as your Kubernetes Control Plane is available, which should generally be the case in any production cluster, the LINSTOR Controller can run. If the node running the controller goes offline, we have tuned the default tolerances for the Kubernetes deployment so that the controller is quickly restarted.

---

<div class="post-metadata">

**Author:** ![jkim](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@jkim](https://forums.linbit.com/u/jkim)\
**Post date:** [December 10, 2024, 6:52am UTC](https://forums.linbit.com/t/how-to-install-reactor-for-linstor-controller-ha-in-a-k8s-environment/468/3 "2024-12-10T06:52:34Z")

</div>

1. What does “database” mean in “… use the Kubernetes API as a **database** ”?

2. Can I understand it as follows?  
In non-k8s, controller HA implementation uses reactor and in k8s, HA effect is achieved by deploying pods in kind:deployment method.

3. In K8s, if the DB used by the controller is stored on a satellite, when the controller pod fails over (i.e. deploy) due to a node failure, the controller must be assigned to the node with the replicated secondary volume. Who does this assignment?  
In other words, in non-k8s, the reactor finds the primary, but in k8s, who does this work? Should I use stork or node affinity?

---

<div class="post-metadata">

**Author:** ![wanzenbug](https://yyz1.discourse-cdn.com/flex003/user_avatar/forums.linbit.com/wanzenbug/32/39_2.png) [@wanzenbug](https://forums.linbit.com/u/wanzenbug)\
**Post date:** [December 10, 2024, 3:38pm UTC](https://forums.linbit.com/t/how-to-install-reactor-for-linstor-controller-ha-in-a-k8s-environment/468/4 "2024-12-10T15:38:15Z")

</div>

> 1. What does “database” mean in “… use the Kubernetes API as a **database** ”?

LINSTOR stores it’s own state in some Custom Resources. So assuming your Kubernetes Control Plane is HA, LINSTOR is HA as well

> 1. Can I understand it as follows?  
> In non-k8s, controller HA implementation uses reactor and in k8s, HA effect is achieved by deploying pods in kind:deployment method.

Yes

> 1. In K8s, if the DB used by the controller is stored on a satellite, when the controller pod fails over (i.e. deploy) due to a node failure, the controller must be assigned to the node with the replicated secondary volume. Who does this assignment?  
> In other words, in non-k8s, the reactor finds the primary, but in k8s, who does this work? Should I use stork or node affinity?

No. There is no replicated secondary volume. All the LINSTOR state is part of the Kubernetes API server. This API server is usually backed by etcd, which itself does replication on usually 3 (or more) nodes.

When a node goes down, Kubernetes will mark the node as unreachable after a short timeout (usually 30s). Because our LINSTOR Controller deployment has a negative `toleration` for the “unreachable” node taint, a replacement Pod is quickly rescheduled.
