The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

Yoshiki Shibata (11) [Avatar] Offline
Question on page 136: <nodes> is not shown in the EXTERNAL-IP
On page 136:

$ kubectl get svc kubia-nodeport
kubia-nodeport <nodes> 80:30123/TCP 2m

But <nodes> is not shown. Instead, <none> is shown, but the system is working. Why?

$ kubectl get svc kubia-nodeport
NAME             TYPE       CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
kubia-nodeport   NodePort   <none>        80:30123/TCP   14m

334960 (3) [Avatar] Offline
Question on page 136: &lt;nodes&gt; is not shown in the EXTERNAL-IP
I have the same problem. I just see "none" and not "nodes" Also there was no warning of firewall rules.
tempusfugit (144) [Avatar] Offline
Question on page 136: &lt;nodes&gt; is not shown in the EXTERNAL-IP
It just seems to be something that minikube does right now. minikube also doesn't seem to list an "ExternalIP" for the node. But the demonstration still works.

File: kubia-svc-nodeport.yaml
apiVersion: v1
kind: Service
  name: kubia-nodeport
  type: NodePort
    - port: 80
      targetPort: 8080
      nodePort: 30123
    app: kubia

File: kubia-replicaset.yaml
apiVersion: apps/v1
kind: ReplicaSet
  name: kubia
  replicas: 3
      app: kubia
        app: kubia
      - name: kubia
        image: kubia:v1
  • macOS High Sierra Version 10.13.5 (17F77)
  • Docker Version 18.06.1-ce-mac73 (26764) "Stable"

  • Session:
    $ open --background -a Docker
    $ minikube start --vm-driver=hyperkit
      Starting local Kubernetes v1.10.0 cluster...
      Starting VM...
      Getting VM IP address...
      Moving files into cluster...
      Setting up certs...
      Connecting to cluster...
      Setting up kubeconfig...
      Starting cluster components...
      Kubectl is now configured to use the cluster.
      Loading cached images from config file.
    $ eval $(minikube docker-env)
    $ minikube version
      minikube version: v0.28.2
    $ kubectl version
      Client Version: version.Info{Major:"1", Minor:"11", GitVersion:"v1.11.2", GitCommit:"bb9ffb1654d4a729bb4cec18ff088eacc153c239", GitTreeState:"clean", BuildDate:"2018-08-08T16:31:10Z", GoVersion:"go1.10.3", Compiler:"gc", Platform:"darwin/amd64"}
      Server Version: version.Info{Major:"1", Minor:"10", GitVersion:"v1.10.0", GitCommit:"fc32d2f3698e36b93322a3465f63a14e9f0eaead", GitTreeState:"clean", BuildDate:"2018-03-26T16:44:10Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
    $ kubectl api-resources
      NAME                              SHORTNAMES   APIGROUP                       NAMESPACED   KIND
      bindings                                                                      true         Binding
      componentstatuses                 cs                                          false        ComponentStatus
      configmaps                        cm                                          true         ConfigMap
      endpoints                         ep                                          true         Endpoints
      events                            ev                                          true         Event
      limitranges                       limits                                      true         LimitRange
      namespaces                        ns                                          false        Namespace
      nodes                             no                                          false        Node
      persistentvolumeclaims            pvc                                         true         PersistentVolumeClaim
      persistentvolumes                 pv                                          false        PersistentVolume
      pods                              po                                          true         Pod
      podtemplates                                                                  true         PodTemplate
      replicationcontrollers            rc                                          true         ReplicationController
      resourcequotas                    quota                                       true         ResourceQuota
      secrets                                                                       true         Secret
      serviceaccounts                   sa                                          true         ServiceAccount
      services                          svc                                         true         Service
      mutatingwebhookconfigurations           false        MutatingWebhookConfiguration
      validatingwebhookconfigurations         false        ValidatingWebhookConfiguration
      customresourcedefinitions         crd,crds           false        CustomResourceDefinition
      apiservices                                   false        APIService
      controllerrevisions                            apps                           true         ControllerRevision
      daemonsets                        ds           apps                           true         DaemonSet
      deployments                       deploy       apps                           true         Deployment
      replicasets                       rs           apps                           true         ReplicaSet
      statefulsets                      sts          apps                           true         StatefulSet
      tokenreviews                                   false        TokenReview
      localsubjectaccessreviews                       true         LocalSubjectAccessReview
      selfsubjectaccessreviews                        false        SelfSubjectAccessReview
      selfsubjectrulesreviews                         false        SelfSubjectRulesReview
      subjectaccessreviews                            false        SubjectAccessReview
      horizontalpodautoscalers          hpa          autoscaling                    true         HorizontalPodAutoscaler
      cronjobs                          cj           batch                          true         CronJob
      jobs                                           batch                          true         Job
      certificatesigningrequests        csr            false        CertificateSigningRequest
      events                            ev                   true         Event
      daemonsets                        ds           extensions                     true         DaemonSet
      deployments                       deploy       extensions                     true         Deployment
      ingresses                         ing          extensions                     true         Ingress
      networkpolicies                   netpol       extensions                     true         NetworkPolicy
      podsecuritypolicies               psp          extensions                     false        PodSecurityPolicy
      replicasets                       rs           extensions                     true         ReplicaSet
      networkpolicies                   netpol              true         NetworkPolicy
      poddisruptionbudgets              pdb          policy                         true         PodDisruptionBudget
      podsecuritypolicies               psp          policy                         false        PodSecurityPolicy
      clusterrolebindings                        false        ClusterRoleBinding
      clusterroles                               false        ClusterRole
      rolebindings                               true         RoleBinding
      roles                                      true         Role
      storageclasses                    sc                  false        StorageClass
      volumeattachments                                     false        VolumeAttachment
    $ kubectl create -f kubia-replicaset.yaml
      replicaset.apps/kubia created
    $ kubectl get rs
      kubia     3         3         3         9s
    $ kubectl describe rs
      Name:         kubia
      Namespace:    default
      Selector:     app=kubia
      Labels:       app=kubia
      Annotations:  <none>
      Replicas:     3 current / 3 desired
      Pods Status:  3 Running / 0 Waiting / 0 Succeeded / 0 Failed
      Pod Template:
        Labels:  app=kubia
          Image:        kubia:v1
          Port:         <none>
          Host Port:    <none>
          Environment:  <none>
          Mounts:       <none>
        Volumes:        <none>
        Type    Reason            Age   From                   Message
        ----    ------            ----  ----                   -------
        Normal  SuccessfulCreate  19s   replicaset-controller  Created pod: kubia-6w8bb
        Normal  SuccessfulCreate  19s   replicaset-controller  Created pod: kubia-rl9hh
        Normal  SuccessfulCreate  19s   replicaset-controller  Created pod: kubia-clthl
    $ kubectl create -f kubia-svc-nodeport.yaml
      service/kubia-nodeport created
    $ kubectl describe svc kubia-nodeport
      Name:                     kubia-nodeport
      Namespace:                default
      Labels:                   <none>
      Annotations:              <none>
      Selector:                 app=kubia
      Type:                     NodePort
      Port:                     <unset>  80/TCP
      TargetPort:               8080/TCP
      NodePort:                 <unset>  30123/TCP
      Endpoints:      ,,
      Session Affinity:         None
      External Traffic Policy:  Cluster
      Events:                   <none>
    $ kubectl get svc
      NAME             TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE
      kubernetes       ClusterIP       <none>        443/TCP        12m
      kubia-nodeport   NodePort   <none>        80:30123/TCP   48s
    $ kubectl get po --selector="app=kubia" --output=wide
      NAME          READY     STATUS    RESTARTS   AGE       IP           NODE
      kubia-6w8bb   1/1       Running   0          2m   minikube
      kubia-clthl   1/1       Running   0          2m   minikube
      kubia-rl9hh   1/1       Running   0          2m   minikube
    $ kubectl get no -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP")].address}'
    $ kubectl get no -o jsonpath='{.items[*].status.addresses[?(@.type=="InternalIP")].address}'
    $ kubectl cluster-info
      Kubernetes master is running at
      KubeDNS is running at
      To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
    $ minikube ip
    $ export KUBIA_URL=$(minikube service kubia-nodeport --url)
    $ echo $KUBIA_URL
    $ curl $KUBIA_URL
      You've hit kubia-clthl
    $ curl $KUBIA_URL
      You've hit kubia-6w8bb
    $ curl $KUBIA_URL
      You've hit kubia-rl9hh
    $ kubectl delete svc kubia-nodeport
      service "kubia-nodeport" deleted
    $ kubectl delete rs --all
      replicaset.extensions "kubia" deleted
    $ kubectl delete all --all
      pod "kubia-6w8bb" deleted
      pod "kubia-clthl" deleted
      pod "kubia-rl9hh" deleted
      service "kubernetes" deleted
    $ eval $(minikube docker-env --unset)
    $ minikube stop
      Stopping local Kubernetes cluster...
      Machine stopped.
    $ osascript -e 'quit app "Docker"'

    Kubernetes: Use a Service to Access an Application in a Cluster