30 lines
1.1 KiB
Nix
30 lines
1.1 KiB
Nix
{ pkgs, pkgs-k8s, ... }:
|
|
|
|
let
|
|
mkApp = {};
|
|
ETCD_ENDPOINTS = "https://[fd00:23:42:1000::1]:2379,https://[fd00:23:42:1000::2]:2379,https://[fd00:23:42:1000::3]:2379";
|
|
ETCD_ROOT_CRT = "/run/agenix/etcd-root-crt";
|
|
ETCD_CLIENT_CRT = "/run/agenix/etcd-client-crt";
|
|
ETCD_CLIENT_KEY = "/run/agenix/etcd-client-key";
|
|
in
|
|
{
|
|
etcd-endpoint-health = {
|
|
type = "app";
|
|
program = "${pkgs.writeShellScript "etcd-health-check" ''
|
|
ssh fd00:23:42:1000::1 'etcdctl --endpoints=${ETCD_ENDPOINTS} --cacert=${ETCD_ROOT_CRT} --cert=${ETCD_CLIENT_CRT} --key=${ETCD_CLIENT_KEY} endpoint health'
|
|
''}";
|
|
};
|
|
etcd-members = {
|
|
type = "app";
|
|
program = "${pkgs.writeShellScript "etcd-members" ''
|
|
ssh fd00:23:42:1000::1 'etcdctl --endpoints=${ETCD_ENDPOINTS} --cacert=${ETCD_ROOT_CRT} --cert=${ETCD_CLIENT_CRT} --key=${ETCD_CLIENT_KEY} member list'
|
|
''}";
|
|
};
|
|
etcd-endpoint-status = {
|
|
type = "app";
|
|
program = "${pkgs.writeShellScript "etcd-status" ''
|
|
ssh fd00:23:42:1000::1 'etcdctl --endpoints=${ETCD_ENDPOINTS} --cacert=${ETCD_ROOT_CRT} --cert=${ETCD_CLIENT_CRT} --key=${ETCD_CLIENT_KEY} endpoint status --write-out=table'
|
|
''}";
|
|
};
|
|
}
|
|
|