Difference between revisions of "Kubectl get services"

From wikieduonline
Jump to navigation Jump to search
Line 9: Line 9:
  
 
  kubectl -n [[nginx-ingress]] get sv
 
  kubectl -n [[nginx-ingress]] get sv
  NAME            TYPE          CLUSTER-IP      EXTERNAL-IP                                         PORT(S)                            AGE
+
  NAME            TYPE          CLUSTER-IP      EXTERNAL-IP                                   PORT(S)                            AGE
 
  [[nginx-ingress]]  [[LoadBalancer]]  10.100.100.2  xxxx70yyyy.[[us-west-1]].elb.amazonaws.com    80:31982/TCP,443:30529/TCP            8d
 
  [[nginx-ingress]]  [[LoadBalancer]]  10.100.100.2  xxxx70yyyy.[[us-west-1]].elb.amazonaws.com    80:31982/TCP,443:30529/TCP            8d
  

Revision as of 20:58, 11 July 2022

kubectl get svc
kubectl get svc -o json
kubectl get services
NAME                                    TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)             AGE
YOUR_SERVICE_NAME                  ClusterIP   None             <none>                1130/TCP             29h
consul-dns                         ClusterIP   10.172.23.56 <none>                53/TCP,53UDP    29h   
kubectl -n nginx-ingress get sv
NAME            TYPE           CLUSTER-IP      EXTERNAL-IP                                   PORT(S)                            AGE
nginx-ingress   LoadBalancer   10.100.100.2   xxxx70yyyy.us-west-1.elb.amazonaws.com    80:31982/TCP,443:30529/TCP            8d

Ports:

kubectl get svc --all-namespaces -o json | jq '.items[] | {name:.metadata.name, p:.spec.ports[] } | select( .p.nodePort != null ) | "\(.name): localhost:\(.p.nodePort) -> \(.p.port) -> \(.p.targetPort)"'                                                                                                                                                                                                                                                                                         

Minikube

kubectl get services
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   13m
kubectl get svc
NAME                              TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
grafana                           ClusterIP   172.20.138.151   <none>        80/TCP    7m48s
kubernetes                        ClusterIP   172.20.0.1       <none>        443/TCP   3d1h
metrics-server                    ClusterIP   172.20.240.68    <none>        443/TCP   2m35s
my-release-kubernetes-dashboard   ClusterIP   172.20.100.126   <none>        443/TCP   22m
kubectl get services
NAME                                            TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
hello-minikube                                  NodePort       10.110.228.90   <none>        8080:32648/TCP               24h
kubernetes                                      ClusterIP      10.96.0.1       <none>        443/TCP                      25h
my-release-ingress-nginx-controller             LoadBalancer   10.106.155.20   <pending>     80:30629/TCP,443:31785/TCP   3m31s
my-release-ingress-nginx-controller-admission   ClusterIP      10.104.50.169   <none>        443/TCP                      3m31s


After Installing Istio

kubectl get services
NAME                                            TYPE           CLUSTER-IP      EXTERNAL-IP   PORT(S)                      AGE
details                                         ClusterIP      10.100.169.1    <none>        9080/TCP                     3m55s
hello-minikube                                  NodePort       10.110.228.90   <none>        8080:32648/TCP               11d
kubernetes                                      ClusterIP      10.96.0.1       <none>        443/TCP                      11d
my-release-ingress-nginx-controller             LoadBalancer   10.106.155.20   <pending>     80:30629/TCP,443:31785/TCP   10d
my-release-ingress-nginx-controller-admission   ClusterIP      10.104.50.169   <none>        443/TCP                      10d
productpage                                     ClusterIP      10.97.161.61    <none>        9080/TCP                     3m54s
ratings                                         ClusterIP      10.106.29.228   <none>        9080/TCP                     3m55s
reviews                                         ClusterIP      10.96.216.51    <none>        9080/TCP                     3m55s

EKS

kubectl get services
NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes   ClusterIP   172.20.0.1   <none>        443/TCP   14m

EKS after installing grafana:

kubectl get services
NAME         TYPE        CLUSTER-IP       EXTERNAL-IP   PORT(S)   AGE
grafana      ClusterIP   10.100.182.232   <none>        80/TCP    4m59s
kubernetes   ClusterIP   10.100.0.1       <none>        443/TCP   14h

EKS + metrics-server + kubernetes-dashboard

kubectl get services
NAME                              TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)   AGE
kubernetes                        ClusterIP   172.20.0.1      <none>        443/TCP   44h
metrics-server                    ClusterIP   172.20.94.132   <none>        443/TCP   26h
my-release-kubernetes-dashboard   ClusterIP   172.20.8.159    <none>        443/TCP   26h

Related terms

See also

Advertising: