зеркало из https://github.com/Azure/aztack.git
(terraform): add helper scripts
This commit is contained in:
Родитель
6cb3cf902b
Коммит
960dfb8c36
|
@ -0,0 +1,17 @@
|
|||
## display this help text
|
||||
help:
|
||||
$(info Available targets)
|
||||
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
|
||||
nb = sub( /^## /, "", helpMsg ); \
|
||||
if(nb == 0) { \
|
||||
helpMsg = $$0; \
|
||||
nb = sub( /^[^:]*:.* ## /, "", helpMsg ); \
|
||||
} \
|
||||
if (nb) \
|
||||
print $$1 "\t" helpMsg; \
|
||||
} \
|
||||
{ helpMsg = $$0 }' \
|
||||
$(MAKEFILE_LIST) | column -ts $$'\t' | \
|
||||
grep --color '^[^ ]*'
|
||||
|
||||
.PHONY: help
|
|
@ -0,0 +1,13 @@
|
|||
addons:
|
||||
kubectl get pods --namespace=kube-system
|
||||
|
||||
dns:
|
||||
kubectl exec busybox -- nslookup kubernetes
|
||||
|
||||
nodes:
|
||||
kubectl get nodes
|
||||
|
||||
pods:
|
||||
@kubectl get pods --all-namespaces -o wide
|
||||
|
||||
.PHONY: addons dns nodes pods
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/bash -e
|
||||
|
||||
BASTION_IP=`terraform output bastion-ip`
|
||||
|
||||
COMMAND=$1
|
||||
|
||||
function finish {
|
||||
[ -z ${SSH_AGENT_PID} ] || kill ${SSH_AGENT_PID}
|
||||
}
|
||||
|
||||
eval `ssh-agent -s`
|
||||
trap finish EXIT
|
||||
|
||||
ssh-add ${AZURE_VM_KEY_PATH}
|
||||
ssh -tA ubuntu@${BASTION_IP} ${COMMAND}
|
Загрузка…
Ссылка в новой задаче