Skip to content

Latest commit

 

History

History
70 lines (52 loc) · 2.12 KB

README.md

File metadata and controls

70 lines (52 loc) · 2.12 KB

nut-client extension

Installation

See Installing Extensions.

Usage

Configure the extension via ExtensionServiceConfig document. You must replace upsmonHost, upsmonUser and upsmonPasswd to match configuration on your nut server. See upsd.users man page for details.

On Talos, SHUTDOWNCMD must be /sbin/poweroff.

---
apiVersion: v1alpha1
kind: ExtensionServiceConfig
name: nut-client
configFiles:
  - content: |-
        MONITOR ${upsmonHost} 1 ${upsmonUser} ${upsmonPass} secondary
        SHUTDOWNCMD "/sbin/poweroff"
    mountPath: /usr/local/etc/nut/upsmon.conf

Then apply the patch to your node's MachineConfig:

$ talosctl patch mc -p @nut-config.yaml

You will then be able to verify that it is in place with the following command

$ talosctl get extensionserviceconfigs
NODE     NAMESPACE   TYPE                     ID           VERSION
mynode   runtime     ExtensionServiceConfig   nut-client   1

Testing

Confirm extension service is running:

$ talosctl service ext-nut-client
NODE     192.168.1.1
ID       ext-nut-client
STATE    Running
HEALTH   ?
EVENTS   [Running]: Started task ext-nut-client (PID 2263) for container ext-nut-client (59m59s ago)
         [Preparing]: Creating service runner (59m59s ago)
         [Preparing]: Running pre state (59m59s ago)
         [Waiting]: Waiting for service "cri" to be "up" (59m59s ago)
         [Waiting]: Waiting for service "cri" to be "up", network (1h0m0s ago)
         [Waiting]: Waiting for service "cri" to be registered, network (1h0m1s ago)
         [Waiting]: Waiting for service "containerd" to be "up", service "cri" to be registered, network (1h0m2s ago)
         [Waiting]: Waiting for service "containerd" to be "up", service "cri" to be "up", network (1h0m3s ago)

Trigger a “Full System Shutdown” on the NUT server:

$ upsmon -c fsd

CAUTION ⚠️ This will power off all connected systems.

All connected upsmon clients should perform a full shutdown and power off.