blob: ec59228b3273f3805ab197ae58e3f4282af60629 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
{ pkgs, ... }:
{
home.packages = with pkgs; [
kind # k8s in docker
kubebuilder # generate controller
kubectl
kubernetes-helm # deploy applications
kubie # kubeconfig browser https://github.com/sbstp/kubie
kubelogin-oidc # OIDC plugin
];
programs.k9s = {
enable = true;
settings = {
k9s = {
refreshRate = 1;
};
};
plugin = {
plugins = {
log-bat = {
shortCut = "Shift-L";
description = "Logs (bat)";
scopes = [ "po" ];
command = "bash";
background = false;
args = [
"-c"
"\"$@\" | bat"
"dummy-arg"
"kubectl"
"logs"
"$NAME"
"-n"
"$NAMESPACE"
"--context"
"$CONTEXT"
"--kubeconfig"
"$KUBECONFIG"
];
};
log-bat-container = {
shortCut = "Shift-L";
description = "Logs (bat)";
scopes = [ "containers" ];
command = "bash";
background = false;
args = [
"-c"
"\"$@\" | bat"
"dummy-arg"
"kubectl"
"logs"
"-c"
"$NAME"
"$POD"
"-n"
"$NAMESPACE"
"--context"
"$CONTEXT"
"--kubeconfig"
"$KUBECONFIG"
];
};
};
};
};
home.file.kubie = {
target = ".kube/kubie.yaml";
text = ''
shell: fish
configs:
include:
- ~/.kube/rksconfig
prompt:
fish_use_rprompt: false
'';
};
programs.fish = {
shellAbbrs = {
k = "kubectl";
kctx = "kubie ctx";
klogs = "kubectl logs";
};
shellAliases = {
ukctx = "${pkgs.gh}/bin/gh api --hostname github.rbx.com repos/Roblox/cell-lifecycle/contents/rks/kubeconfig --jq '.content' | base64 -d > ~/.kube/rksconfig";
};
};
}
|