mirror of
https://github.com/TECHNOFAB11/kubenix.git
synced 2025-12-12 16:10:05 +01:00
init cli docs
This commit is contained in:
parent
89e1e70bf0
commit
9f0ae6e362
2 changed files with 39 additions and 10 deletions
|
|
@ -4,11 +4,11 @@
|
|||
coreutils,
|
||||
nix,
|
||||
jq,
|
||||
kubectl,
|
||||
}: let
|
||||
name = "kubenix";
|
||||
in
|
||||
lib.recursiveUpdate
|
||||
(writeShellScriptBin name ''
|
||||
lib.recursiveUpdate (writeShellScriptBin name ''
|
||||
set -Eeuo pipefail
|
||||
|
||||
NAME=${name}
|
||||
|
|
@ -18,16 +18,23 @@ in
|
|||
|
||||
commands:
|
||||
apply - create resources in target cluster
|
||||
diff - show a diff between rendered and live resources
|
||||
render - print resource manifests to stdout
|
||||
"
|
||||
}
|
||||
|
||||
MANIFEST="$(${nix}/bin/nix eval '.#k8s.config.kubernetes.result' --raw)"
|
||||
|
||||
function apply() {
|
||||
echo not impremented
|
||||
${kubectl}/bin/kubectl apply -f $MANIFEST
|
||||
}
|
||||
|
||||
function render() {
|
||||
${nix}/bin/nix eval '.#kubernetes' # | ${jq}/bin/jq 'fromjson'
|
||||
cat $MANIFEST | ${jq}/bin/jq
|
||||
}
|
||||
|
||||
function diff() {
|
||||
${kubectl}/bin/kubectl diff -f $MANIFEST
|
||||
}
|
||||
|
||||
while test $# -gt 0; do
|
||||
|
|
@ -36,6 +43,10 @@ in
|
|||
shift
|
||||
apply
|
||||
;;
|
||||
diff)
|
||||
shift
|
||||
diff
|
||||
;;
|
||||
render)
|
||||
shift
|
||||
render
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue