redhat-scholars / kubernetes-tutorial

Kubernetes Tutorial for https://dn.dev/master
https://redhat-scholars.github.io/kubernetes-tutorial/
Apache License 2.0
362 stars 193 forks source link

error in the service page about service name and service port. #39

Closed survivant closed 2 years ago

survivant commented 3 years ago

in the page : https://github.com/redhat-scholars/kubernetes-tutorial/edit/master/documentation/modules/ROOT/pages/service.adoc image

The name of the service should be : the-service (from the metadata) and not myapp

if I do : kubectl get svc -o wide I'll obtain this

vagrant@k8s-master ~ $ kubectl get svc -o wide
NAME                                                   TYPE           CLUSTER-IP       EXTERNAL-IP      PORT(S)                         AGE    SELECTOR
the-service                                            LoadBalancer   10.102.11.99     192.168.50.201   80:31203/TCP                    4s     app=quarkus-demo
vagrant@k8s-master ~ $

PS. Look at the port also, it's 80:(generated nodeport). in your example, it's 8080. PS2. I'm running on-premise with MetalLB.

vagrant@k8s-master ~ $ kubectl version
Client Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.2", GitCommit:"f5743093fd1c663cb0cbc89748f730662345d44d", GitTreeState:"clean", BuildDate:"2020-09-16T13:41:02Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"19", GitVersion:"v1.19.2", GitCommit:"f5743093fd1c663cb0cbc89748f730662345d44d", GitTreeState:"clean", BuildDate:"2020-09-16T13:32:58Z", GoVersion:"go1.15", Compiler:"gc", Platform:"linux/amd64"}
vagrant@k8s-master ~ $
vagrant@k8s-master ~ $ kubectl describe svc the-service
Name:                     the-service
Namespace:                default
Labels:                   <none>
Annotations:              <none>
Selector:                 app=quarkus-demo
Type:                     LoadBalancer
IP:                       10.102.11.99
LoadBalancer Ingress:     192.168.50.201
Port:                     <unset>  80/TCP
TargetPort:               8080/TCP
NodePort:                 <unset>  31203/TCP
Endpoints:                10.244.126.35:8080,10.244.194.122:8080,10.244.235.239:8080
Session Affinity:         None
External Traffic Policy:  Cluster
Events:
  Type    Reason        Age   From                Message
  ----    ------        ----  ----                -------
  Normal  IPAllocated   8m4s  metallb-controller  Assigned IP "192.168.50.201"
  Normal  nodeAssigned  8m4s  metallb-speaker     announcing from node "k8s-worker2"
vagrant@k8s-master ~ $