From 984a59a8f027d9df1b67212bf78be7e33a4442c9 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Sat, 8 Jul 2023 18:59:58 +0200 Subject: [PATCH] kube/svc --- rtfd/public/kubernetes/index.rst | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/rtfd/public/kubernetes/index.rst b/rtfd/public/kubernetes/index.rst index ff1556c..14c2765 100644 --- a/rtfd/public/kubernetes/index.rst +++ b/rtfd/public/kubernetes/index.rst @@ -113,3 +113,54 @@ Scale scale deploy my-deployment \ --replicas 3 \ -n my-namespace + +Services +======== + +* ClusterIP (internal) +* ExternalName (internal alias for external DNS) +* LoadBalancer (external dedicated IP) [if available] +* NodePort (exposed via node) + +Read +---- + +.. code:: shell + + kubectl \ + get services \ + -n my-namespace + +.. code:: shell + + kubectl \ + get service my-service \ + -n my-namespace + +Write +----- + +.. code:: shell + + kubectl \ + expose deployment my-deployment \ + --type LoadBalancer \ + --name my-load-balancer \ + --target-port 8080 \ + -n my-namespace + +.. code:: shell + + kubectl \ + delete service my-service \ + -n my-namespace + +.. code:: shell + + kubectl \ + edit service my-service \ + -n my-namespace + +.. warning:: + + ClusterIP is immutable!