2023-11-13 10:59:32 +01:00
|
|
|
# docker aliases
|
|
|
|
alias ld = lazydocker
|
|
|
|
alias dc = docker-compose
|
|
|
|
alias dcb = docker-compose build
|
|
|
|
def dcp [] { docker-compose build; docker-compose push }
|
|
|
|
alias dcu = docker-compose up -d --build --remove-orphans
|
|
|
|
alias dcd = docker-compose down
|
|
|
|
def dcr [] { docker-compose down; docker-compose up -d --build --remove-orphans }
|
|
|
|
|
|
|
|
# kubernetes aliases
|
|
|
|
$env.KUBECONFIG = if ([$env.HOME, .kubes, current-cube] | path join | path exists) {
|
|
|
|
open ([$env.HOME, .kubes, current-cube] | path join)
|
|
|
|
} else {
|
|
|
|
""
|
|
|
|
}
|
|
|
|
|
|
|
|
def _kube_kubes [] {
|
|
|
|
_ls ~/.kubes | where type == dir | get name | path basename
|
|
|
|
}
|
|
|
|
|
2023-11-17 16:26:15 +01:00
|
|
|
def --env kube [name?: string@_kube_kubes] {
|
2023-11-13 10:59:32 +01:00
|
|
|
use assert
|
|
|
|
|
|
|
|
let kubes_path = [$env.HOME, .kubes] | path join
|
|
|
|
|
|
|
|
if $name == null {
|
|
|
|
rm ([$kubes_path, current-cube] | path join)
|
|
|
|
$env.KUBECONFIG = ""
|
|
|
|
return
|
|
|
|
}
|
|
|
|
|
|
|
|
let kube_config = [$kubes_path, $name, config] | path join
|
|
|
|
|
|
|
|
if not ($kube_config | path exists) {
|
|
|
|
error make {msg: ($kube_config + " does not exist")}
|
|
|
|
}
|
|
|
|
|
|
|
|
$kube_config | save -f ([$kubes_path, current-cube] | path join)
|
|
|
|
$env.KUBECONFIG = $kube_config
|
|
|
|
}
|
|
|
|
|
|
|
|
alias kns = k9s
|
|
|
|
|
2023-11-22 09:57:20 +01:00
|
|
|
# minikube: don't erase my kubeconfig
|
|
|
|
def "minikube start" [] {
|
|
|
|
$env.KUBECONFIG = ([$env.HOME, '.kubes', 'test', 'config'] | path join)
|
|
|
|
^minikube start
|
|
|
|
}
|
|
|
|
|
|
|
|
def "minikube stop" [] {
|
|
|
|
$env.KUBECONFIG = ([$env.HOME, '.kubes', 'test', 'config'] | path join)
|
|
|
|
^minikube stop
|
|
|
|
}
|
|
|
|
|
|
|
|
def "minikube delete" [] {
|
|
|
|
$env.KUBECONFIG = ([$env.HOME, '.kubes', 'test', 'config'] | path join)
|
|
|
|
^minikube delete
|
|
|
|
}
|