K8s/Run: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 1: | Line 1: | ||
==Kubectl » Run== | ==Kubectl » Run== | ||
<syntaxhighlight lang="bash"> | |||
kubectl get ns|grep swiss-knife | |||
kubectl create ns swiss-knife | |||
</syntaxhighlight> | |||
===Kubectl » Run » PSQL=== | ===Kubectl » Run » PSQL=== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n | kubectl -n swiss-knife run -i --tty --rm psql --image=alpine --restart=Never -- sh | ||
echo -n password: ;read -s PGPASSWORD;export PGPASSWORD | echo -n password: ;read -s PGPASSWORD;export PGPASSWORD | ||
apk --update add postgresql-client inetutils-telnet | apk --update add postgresql-client inetutils-telnet | ||
psql -d postgres -U postgres -h postgresql.postgresql | psql -d postgres -U postgres -h postgresql.postgresql | ||
</syntaxhighlight> | |||
===Kubectl » Run » Infinity=== | |||
<syntaxhighlight lang="bash"> | |||
kubectl -n swiss-knife run swiss-knife --image=alpine -- sleep infinity | |||
kubectl -n swiss-knife exec -it swiss-knife -- sh | |||
apk --update add inetutils-telnet | |||
</syntaxhighlight> | </syntaxhighlight> | ||
===Kubectl » Run » Redis CLI=== | ===Kubectl » Run » Redis CLI=== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n | kubectl -n swiss-knife run -i --tty --rm redis-cli --image=alpine --restart=Never -- sh | ||
echo -n password: ;read -s REDISCLI_AUTH;export REDISCLI_AUTH;echo | echo -n password: ;read -s REDISCLI_AUTH;export REDISCLI_AUTH;echo | ||
apk --update add redis inetutils-telnet | apk --update add redis inetutils-telnet | ||
echo 'ping'|redis-cli -h redis-headless.redis | echo 'ping'|redis-cli -h redis-headless.redis | ||
</syntaxhighlight> | </syntaxhighlight> | ||
===Kubectl » Run » MinIO CLI=== | ===Kubectl » Run » MinIO CLI=== | ||
<syntaxhighlight lang="bash"> | <syntaxhighlight lang="bash"> | ||
kubectl -n | kubectl -n swiss-knife run -i --tty --rm minio-cli --image=alpine --restart=Never -- sh | ||
apk --update add minio-client inetutils-telnet | apk --update add minio-client inetutils-telnet | ||
Line 32: | Line 42: | ||
mcli ping --error-count 5 minio.minio | mcli ping --error-count 5 minio.minio | ||
mcli ping --count 5 minio.minio | mcli ping --count 5 minio.minio | ||
telnet minio.minio 9000 | telnet minio.minio 9000 | ||
telnet minio.minio 9001 | telnet minio.minio 9001 | ||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 21:06, 26 August 2024
Kubectl » Run
kubectl get ns|grep swiss-knife
kubectl create ns swiss-knife
Kubectl » Run » PSQL
kubectl -n swiss-knife run -i --tty --rm psql --image=alpine --restart=Never -- sh
echo -n password: ;read -s PGPASSWORD;export PGPASSWORD
apk --update add postgresql-client inetutils-telnet
psql -d postgres -U postgres -h postgresql.postgresql
Kubectl » Run » Infinity
kubectl -n swiss-knife run swiss-knife --image=alpine -- sleep infinity
kubectl -n swiss-knife exec -it swiss-knife -- sh
apk --update add inetutils-telnet
Kubectl » Run » Redis CLI
kubectl -n swiss-knife run -i --tty --rm redis-cli --image=alpine --restart=Never -- sh
echo -n password: ;read -s REDISCLI_AUTH;export REDISCLI_AUTH;echo
apk --update add redis inetutils-telnet
echo 'ping'|redis-cli -h redis-headless.redis
Kubectl » Run » MinIO CLI
kubectl -n swiss-knife run -i --tty --rm minio-cli --image=alpine --restart=Never -- sh
apk --update add minio-client inetutils-telnet
echo -n password: ;\
read -s MINIO_SERVER_ROOT_PASSWORD;\
export MINIO_SERVER_ROOT_PASSWORD;\
export MINIO_SERVER_ROOT_USER=admin;\
export MINIO_SERVER_HOST=minio.k8s.local;echo
mcli ping --error-count 5 minio.minio
mcli ping --count 5 minio.minio
telnet minio.minio 9000
telnet minio.minio 9001
Kubectl » Apply
References
| ||