93 lines
2.5 KiB
Plaintext
93 lines
2.5 KiB
Plaintext
# docker aliases
|
|
|
|
# lazydocker
|
|
alias ld = lazydocker
|
|
|
|
# docker-compose
|
|
alias dc = docker-compose
|
|
|
|
# docker-compose build
|
|
alias dcb = docker-compose build
|
|
|
|
# docker-compose build and push
|
|
def dcp [] { docker-compose build; docker-compose push }
|
|
|
|
# docker-compose up with build and remove-orphans
|
|
alias dcu = docker-compose up -d --build --remove-orphans
|
|
|
|
# docker-compose down
|
|
alias dcd = docker-compose down
|
|
|
|
# docker-compose down and up
|
|
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
|
|
}
|
|
|
|
# easily switch kube config
|
|
def --env kube [name?: string@_kube_kubes] {
|
|
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
|
|
}
|
|
|
|
# k9s
|
|
alias kns = k9s -n all
|
|
|
|
# shortcut for lazydocker on pi
|
|
alias pi = ssh pi -t "cd docker && /home/pi/.local/bin/lazydocker"
|
|
|
|
# shortcut for lazydocker on phoenix's prod
|
|
alias phoenix = ssh phoenix -t "cd prod && /home/polymny/.local/bin/lazydocker"
|
|
|
|
# shortcut for lazydocker on phoenix's infra
|
|
alias infra = ssh phoenix -t "cd infra && /home/polymny/.local/bin/lazydocker"
|
|
|
|
# shortcut for lazydocker on rhea's prod
|
|
alias rhea = ssh rhea -t "cd prod && /home/polymny/.local/bin/lazydocker"
|
|
|
|
# shortcut for kns zeus's kubernetes cluster
|
|
alias zeus = k9s -n all --kubeconfig ($env.HOME + '/.kubes/zeus/config')
|
|
|
|
# shortcut for kns safir's kubernetes cluster
|
|
alias safir = k9s -n all --kubeconfig ($env.HOME + '/.kubes/safir/config')
|
|
|
|
# start minikube with test kube
|
|
def "minikube start" [] {
|
|
$env.KUBECONFIG = ([$env.HOME, '.kubes', 'test', 'config'] | path join)
|
|
^minikube start
|
|
}
|
|
|
|
# stop minikube with test kube
|
|
def "minikube stop" [] {
|
|
$env.KUBECONFIG = ([$env.HOME, '.kubes', 'test', 'config'] | path join)
|
|
^minikube stop
|
|
}
|
|
|
|
# delete minikube with test kube
|
|
def "minikube delete" [] {
|
|
$env.KUBECONFIG = ([$env.HOME, '.kubes', 'test', 'config'] | path join)
|
|
^minikube delete
|
|
}
|