forked from Azure-Samples/openhack-containers
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathhelpful-commands.azcli
44 lines (31 loc) · 1.18 KB
/
helpful-commands.azcli
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Create curl pod
kubectl run --rm --generator=run-pod/v1 curl --image=radial/busyboxplus:curl -i --tty
# Use curl if created
kubectl exec -it curl sh
# Health check
curl -i -X GET 'http://poi.api-dev.svc.cluster.local:80/api/poi/healthcheck'
# Use log
kubectl logs <name>
# Change kubectl context
az aks get-credentials --resource-group teamResources --name team1-cluster2 --admin
# pass --overwrite-existing to overwrite existing context
# Get resource ID of cluster
az aks show --name team1-cluster2 --resource-group teamResources --query id -o tsv
# Get namespaces
kubectl get namespaces
# Get roles
kubectl get roles --namespace web-dev
kubectl get roles --all-namespaces
# Get role bindings
kubectl get rolebinding --all-namespaces
# Do I have rights to do things 😂
kubectl auth can-i create deployments --namespace web-dev
# Get secrets for a namespace
kubectl get secrets -n api-dev
# Get NGINX ingress controller
kubectl --namespace ingress-basic get services -o wide -w nginx-ingress-ingress-nginx-controller
# Legit dashboard 👌
kubectl port-forward service/linkerd-web -n linkerd 8084:8084
kubectl get -n api-dev deploy -o yaml \
| linkerd inject - \
| kubectl apply -f -