Skip to content

PiKVM Setup

Mike Chester edited this page Apr 30, 2023 · 3 revisions

PiKVM Setup

  1. Update passwords. doc

  2. Setup CertBot

  3. Create /etc/kvmd/override.yaml

kvmd:
    gpio:
        drivers:
            tes:
                type: tesmart
                host: 192.168.1.10
                port: 5000
        scheme:
            server0_led:
                driver: tes
                pin: 0
                mode: input
            server0_switch:
                driver: tes
                pin: 0
                mode: output
                switch: false
            server1_led:
                driver: tes
                pin: 1
                mode: input
            server1_switch:
                driver: tes
                pin: 1
                mode: output
                switch: false
            server2_led:
                driver: tes
                pin: 2
                mode: input
            server2_switch:
                driver: tes
                pin: 2
                mode: output
                switch: false
            server3_led:
                driver: tes
                pin: 3
                mode: input
            server3_switch:
                driver: tes
                pin: 3
                mode: output
                switch: false
            server4_led:
                driver: tes
                pin: 4
                mode: input
            server4_switch:
                driver: tes
                pin: 4
                mode: output
                switch: false
            server5_led:
                driver: tes
                pin: 5
                mode: input
            server5_switch:
                driver: tes
                pin: 5
                mode: output
                switch: false
            server6_led:
                driver: tes
                pin: 6
                mode: input
            server6_switch:
                driver: tes
                pin: 6
                mode: output
                switch: false
            server7_led:
                driver: tes
                pin: 7
                mode: input
            server7_switch:
                driver: tes
                pin: 7
                mode: output
                switch: false
        view:
            table:
                - ["TESMART Switch"]
                - []
                - ["#k8s-0", server0_led, server0_switch|Switch]
                - ["#k8s-1", server1_led, server1_switch|Switch]
                - ["#k8s-2", server2_led, server2_switch|Switch]
                - ["#k8s-3", server3_led, server3_switch|Switch]
  1. Apply custom EDID to /etc/kvmd/tc358743-edid.hex. doc
00FFFFFFFFFFFF005262888800888888
1C150103800000780AEE91A3544C9926
0F505425400001000100010001000100
010001010101D32C80A070381A403020
350040442100001E7E1D00A050001940
3020370080001000001E000000FC0050
492D4B564D20566964656F0A000000FD
00323D0F2E0F000000000000000001C4
02030400DE0D20A03058122030203400
F0B400000018E01500A0400016303020
3400000000000018B41400A050D01120
3020350080D810000018AB22A0A05084
1A3030203600B00E1100001800000000
00000000000000000000000000000000
00000000000000000000000000000000
00000000000000000000000000000045
  1. Install promtail

Override systemd service

mkdir -p /etc/systemd/system/promtail.service.d/
cat >/etc/systemd/system/promtail.service.d/override.conf <<EOL
[Service]
Type=simple
ExecStart=
ExecStart=/usr/bin/promtail -config.file /etc/loki/promtail.yaml
EOL

Replace /etc/loki/promtail.yaml

server:
  log_level: info
  disable: true

client:
  url: "https://loki.${SECRET_CLUSTER_DOMAIN}/loki/api/v1/push"

positions:
  filename: /tmp/positions.yaml

scrape_configs:
  - job_name: journal
    journal:
      path: /run/log/journal
      max_age: 12h
      labels:
        job: systemd-journal
    relabel_configs:
      - source_labels: ["__journal__systemd_unit"]
        target_label: unit
      - source_labels: ["__journal__hostname"]
        target_label: hostname

Start the service

systemctl daemon-reload
systemctl start promtail.service
  1. Install Node Exporter
pacman -S prometheus-node-exporter
systemctl enable --now prometheus-node-exporter
Clone this wiki locally