diff options
author | Louie S <louie@example.com> | 2024-01-16 14:40:06 -0500 |
---|---|---|
committer | Louie S <louie@example.com> | 2024-01-16 14:40:06 -0500 |
commit | 6ed0515539b950b66380c5b394751eef7d6abba3 (patch) | |
tree | 82ba194558b76f3ad69634d85887777612ac99a1 /kubernetes_cheat_sheet.md | |
parent | 90c617932b64202544c968808386b405582b7698 (diff) |
Diffstat (limited to 'kubernetes_cheat_sheet.md')
-rw-r--r-- | kubernetes_cheat_sheet.md | 26 |
1 files changed, 26 insertions, 0 deletions
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. | | | |