1 changed file
.checkov.yaml + | ||
Add comment 27
Add comment 28 This is fastest way to get set up with local kubectl access in new Rancher environments
Add comment 29
Add comment 30 Minus Generates a .envrc in each directory to quickly auto-load using direnv if no .envrc exists in each directory
Add comment 30 Plus Generates a .envrc in each directory to quickly auto-load using direnv if no .envrc already exists
Add comment 31
Add comment 32 Plus Also generates a local kubeconfig.all in the top level directory with its own .envrc if you want to use that instead
Add comment 33 Plus
Add comment 32 34 Requires Rancher CLI to be set up and configured, as well as jq
Add comment 33 35
Add comment 34 36
Add comment 83 85 echo
Add comment 84 86 done
Add comment 85 87
Add comment 88 Plus timestamp "Finished downloading Rancher kubeconfigs"
Add comment 89 Plus
Add comment 90 Plus echo
Add comment 91 Plus timestamp "Merging configs into $PWD/kubeconfig.all"
Add comment 92 Plus # shellcheck disable=SC2012
Add comment 93 Plus # find . -maxdepth 2 -name kubeconfig
Add comment 94 Plus KUBECONFIG=$(ls "$PWD"/*/kubeconfig | tr '\n' ':')
Add comment 95 Plus export KUBECONFIG
Add comment 96 Plus kubectl config view --merge --flatten > kubeconfig.all
Add comment 86 97 echo
Add comment 87 Minus timestamp "Finished downloading Rancher kubeconfigs"
Add comment 98 Plus
Add comment 99 Plus if ! [ -f .envrc ]; then
Add comment 100 Plus timestamp "Generating $PWD/.envrc"
Add comment 101 Plus cat >> .envrc <<-EOF
Add comment 102 Plus export KUBECONFIG="\$PWD/kubeconfig.all"
Add comment 103 Plus EOF
Add comment 104 Plus direnv allow .envrc
Add comment 105 Plus echo
Add comment 106 Plus fi
Add comment 107 Plus
Add comment 108 Plus timestamp "Done"
Add comment 88 109