Add the kubernetes role.

This commit is contained in:
Tom Alexander
2022-12-01 23:38:21 -05:00
parent 3637dcdfcc
commit 80083ff0cc
18 changed files with 202 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
kubectl get secret -o json "${@}" | jq '.data[] |= @base64d | .data'

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec kubectl "$@"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec kubectl "$@" --all-namespaces

View File

@@ -0,0 +1,8 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
export KUBECTL_EXTERNAL_DIFF="colordiff -N -u"
exec kubectl diff "$@"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec kubectl delete --all "$@"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec kubectl logs --all-containers "$@"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec kubens "$@"

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
: ${cpu:="500m"}
: ${memory:="2Gi"}
overrides=""
if [ ! -z "${highmem:-}" ]; then
overrides=$(jq --compact-output '.' <<EOF
{
"spec": {
"tolerations": [
{
"key": "dedicated",
"operator": "Equal",
"value": "background-highmem",
"effect": "NoSchedule"
}
],
"nodeSelector": {"dedicated": "background-highmem"}
}
}
EOF
)
fi
exec kubectl run --rm -i -t --image alpine:3.13 --overrides="$overrides" --requests "cpu=$cpu,memory=$memory" --limits "cpu=$cpu,memory=$memory" --pod-running-timeout 10m "tom-$(uuidgen | cut -d '-' -f 1)" -- /bin/sh "$@"

View File

@@ -0,0 +1,7 @@
#!/usr/bin/env bash
#
set -euo pipefail
IFS=$'\n\t'
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
exec kubectx "$@"