Add kubernetes client.
This commit is contained in:
parent
f843b7924f
commit
611904761e
@ -40,6 +40,7 @@
|
||||
./roles/ssh
|
||||
./roles/python
|
||||
./roles/docker
|
||||
./roles/kubernetes
|
||||
];
|
||||
|
||||
nix.settings.experimental-features = [
|
||||
|
43
nix/configuration/roles/kubernetes/default.nix
Normal file
43
nix/configuration/roles/kubernetes/default.nix
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
config,
|
||||
lib,
|
||||
pkgs,
|
||||
...
|
||||
}:
|
||||
|
||||
let
|
||||
alias_kx = pkgs.writeShellScriptBin "kx" ''
|
||||
exec ${pkgs.kubeswitch}/bin/switcher "''${@}"
|
||||
'';
|
||||
alias_ks = pkgs.writeShellScriptBin "ks" ''
|
||||
exec ${pkgs.kubeswitch}/bin/switcher namespace "''${@}"
|
||||
'';
|
||||
alias_k = pkgs.writeShellScriptBin "k" ''
|
||||
exec ${pkgs.kubectl}/bin/kubectl "''${@}"
|
||||
'';
|
||||
alias_ka = pkgs.writeShellScriptBin "ka" ''
|
||||
exec ${pkgs.kubectl}/bin/kubectl "''${@}" --all-namespaces
|
||||
'';
|
||||
alias_kdel = pkgs.writeShellScriptBin "kdel" ''
|
||||
exec ${pkgs.kubectl}/bin/kubectl delete --all "''${@}"
|
||||
'';
|
||||
alias_kd = pkgs.writeShellScriptBin "kd" ''
|
||||
export KUBECTL_EXTERNAL_DIFF="${pkgs.colordiff}/bin/colordiff -N -u"
|
||||
exec ${pkgs.kubectl}/bin/kubectl diff "''${@}"
|
||||
'';
|
||||
in
|
||||
{
|
||||
imports = [ ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
kubectl
|
||||
kubeswitch
|
||||
stern
|
||||
alias_kx
|
||||
alias_ks
|
||||
alias_k
|
||||
alias_ka
|
||||
alias_kdel
|
||||
alias_kd
|
||||
];
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user