From 6ed0515539b950b66380c5b394751eef7d6abba3 Mon Sep 17 00:00:00 2001 From: Louie S Date: Tue, 16 Jan 2024 14:40:06 -0500 Subject: Watched through ch. 17 --- kubernetes_cheat_sheet.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/kubernetes_cheat_sheet.md b/kubernetes_cheat_sheet.md index 9244fc2..65b738a 100644 --- a/kubernetes_cheat_sheet.md +++ b/kubernetes_cheat_sheet.md @@ -119,6 +119,32 @@ |`kubectl rollout undo [deploymentname]`|Rollback a deployment | |`kubectl rollout undo [deploymentname] --to-revision=[revision#]`|Rollback to a revision number| +### ClusterIP + +| | | +|--------------------------------------|-----------------------------| +|`kubectl expose po [podName] --port=80 --target-port=8080 --name=frontend|Create a service to expose a pod| +|`kubectl expose deploy [deployName] --port=80 --target-port=8080`|Create a service to expose a deployment| +|`kubectl apply -f [definition.yaml]` |Deploy the service | +|`kubectl get svc` |Get the services list | +|`kubectl get svc -o wide` |Get extra info | +|`kubectl describe svc [serviceName]` |Describe the service | +|`kubectl delete -f [definition.yaml]` |Delete the service | +|`kubectl delete svc [serviceName]` |Delete the service using it's name| + +### NodePort + +| | | +|--------------------------------------|-----------------------------| +|`kubectl expose po [podName] --port=80 --target-port=8080 --type=NodePort`|Create a service to expose a pod| +|`kubectl expose deploy [deployName] --port=80 --target-port=8080 --type=NodePort --name=frontend`|Create a service to expose a deployment| +|`kubectl apply -f [definition.yaml]` |Deploy the service | +|`kubectl get svc` |Get the services list | +|`kubectl get svc -o wide` |Get extra info | +|`kubectl describe svc [serviceName]` |Describe the service | +|`kubectl delete -f [definition.yaml]` |Delete the service | +|`kubectl delete svc [serviceName]` |Delete the service using it's name| + ### Misc. | | | -- cgit