Add the kubernetes role.
This commit is contained in:
30
ansible/roles/kubernetes/files/kshell
Normal file
30
ansible/roles/kubernetes/files/kshell
Normal 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 "$@"
|
||||
Reference in New Issue
Block a user