Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Timeout Error) Chapter 12.2.1 Exposing service through ingress #23

Open
Bonjaski opened this issue Dec 13, 2022 · 0 comments
Open

(Timeout Error) Chapter 12.2.1 Exposing service through ingress #23

Bonjaski opened this issue Dec 13, 2022 · 0 comments

Comments

@Bonjaski
Copy link

Bonjaski commented Dec 13, 2022

Issues

  • kiada service cannot be accessed.

Description

(MacOS) Rancher Desktop v1.24.4+k3s1

I am working on chapter 12.2.1 verifying that dns cache resolves the domain to ingress IP and access to kiada service. It seems to be resolved successfully but unable to access with kiada service.

And kiada service seems to be successfully integrated with pods I have no idea what why I am facing the issues...

curl --resolve kiada.example.com:80:192.168.1.240 http://kiada.example.com -v

* Added kiada.example.com:80:192.168.1.240 to DNS cache
* Hostname kiada.example.com was found in DNS cache
*   Trying 192.168.1.240:80...
* connect to 192.168.1.240 port 80 failed: Operation timed out
* Failed to connect to kiada.example.com port 80 after 75002 ms: Operation timed out
* Closing connection 0
curl: (28) Failed to connect to kiada.example.com port 80 after 75002 ms: Operation timed out

Resource status information

❯ kubectl get all -o wide
NAME            READY   STATUS    RESTARTS       AGE   IP           NODE                            NOMINATED NODE   READINESS GATES
pod/kiada-001   2/2     Running   6 (125m ago)   9d    10.42.2.29   k3d-two-node-cluster-server-0   <none>           <none>
pod/quote-001   2/2     Running   4 (125m ago)   9d    10.42.2.27   k3d-two-node-cluster-server-0   <none>           <none>
pod/quote-003   2/2     Running   4 (125m ago)   9d    10.42.1.21   k3d-two-node-cluster-agent-1    <none>           <none>
pod/quiz        2/2     Running   4 (125m ago)   9d    10.42.0.21   k3d-two-node-cluster-agent-0    <none>           <none>
pod/kiada-003   2/2     Running   4 (125m ago)   9d    10.42.1.19   k3d-two-node-cluster-agent-1    <none>           <none>
pod/quote-002   2/2     Running   4 (125m ago)   9d    10.42.0.22   k3d-two-node-cluster-agent-0    <none>           <none>
pod/kiada-002   2/2     Running   4 (125m ago)   9d    10.42.0.19   k3d-two-node-cluster-agent-0    <none>           <none>

NAME                 TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE   SELECTOR
service/kubernetes   ClusterIP   10.43.0.1      <none>        443/TCP          14d   <none>
service/quiz         ClusterIP   10.43.248.43   <none>        80/TCP           9d    app=quiz
service/quote        ClusterIP   10.43.27.139   <none>        80/TCP           9d    app=quote
service/kiada        ClusterIP   10.43.94.220   <none>        80/TCP,443/TCP   65m   app=kiada
❯
❯ kubectl get all -n ingress-nginx
NAME                                            READY   STATUS      RESTARTS       AGE
pod/ingress-nginx-admission-create-mvrhr        0/1     Completed   0              8d
pod/ingress-nginx-admission-patch-xf7d2         0/1     Completed   2              8d
pod/ingress-nginx-controller-78786894bf-jdc27   1/1     Running     4 (125m ago)   8d

NAME                                         TYPE           CLUSTER-IP     EXTERNAL-IP     PORT(S)                      AGE
service/ingress-nginx-controller-admission   ClusterIP      10.43.171.97   <none>          443/TCP                      8d
service/ingress-nginx-controller             LoadBalancer   10.43.19.154   192.168.1.240   80:31970/TCP,443:31557/TCP   8d

NAME                                       READY   UP-TO-DATE   AVAILABLE   AGE
deployment.apps/ingress-nginx-controller   1/1     1            1           8d

NAME                                                  DESIRED   CURRENT   READY   AGE
replicaset.apps/ingress-nginx-controller-78786894bf   1         1         1       8d

NAME                                       COMPLETIONS   DURATION   AGE
job.batch/ingress-nginx-admission-create   1/1           10s        8d
job.batch/ingress-nginx-admission-patch    1/1           18s        8d

Ingress Information

❯ kubectl describe ingress
Name:             kiada-example-com
Labels:           <none>
Namespace:        default
Address:          192.168.1.240
Ingress Class:    nginx
Default backend:  <default>
Rules:
  Host               Path  Backends
  ----               ----  --------
  kiada.example.com
                     /   kiada:80 (10.42.0.19:8080,10.42.1.19:8080,10.42.2.29:8080)
Annotations:         ingressclass.kubernetes.io/is-default-class: true
                     nginx.ingress.kubernetes.io/rewrite-target: /
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  Sync    22m (x2 over 22m)  nginx-ingress-controller  Scheduled for sync

Service Information

❯ k describe svc kiada
Name:              kiada
Namespace:         default
Labels:            <none>
Annotations:       <none>
Selector:          app=kiada
Type:              ClusterIP
IP Family Policy:  SingleStack
IP Families:       IPv4
IP:                10.43.94.220
IPs:               10.43.94.220
Port:              http  80/TCP
TargetPort:        8080/TCP
Endpoints:         10.42.0.19:8080,10.42.1.19:8080,10.42.2.29:8080
Port:              https  443/TCP
TargetPort:        8443/TCP
Endpoints:         10.42.0.19:8443,10.42.1.19:8443,10.42.2.29:8443
Session Affinity:  None
Events:            <none>

Ingress-controller Pod Information

❯ kubectl describe pod -n ingress-nginx ingress-nginx-controller-78786894bf-jdc27
Name:             ingress-nginx-controller-78786894bf-jdc27
Namespace:        ingress-nginx
Priority:         0
Service Account:  ingress-nginx
Node:             k3d-two-node-cluster-server-0/172.19.0.4
Start Time:       Mon, 05 Dec 2022 02:29:30 +0900
Labels:           app.kubernetes.io/component=controller
                  app.kubernetes.io/instance=ingress-nginx
                  app.kubernetes.io/name=ingress-nginx
                  pod-template-hash=78786894bf
Annotations:      <none>
Status:           Running
IP:               10.42.2.31
IPs:
  IP:           10.42.2.31
Controlled By:  ReplicaSet/ingress-nginx-controller-78786894bf
Containers:
  controller:
    Container ID:  containerd://c1f885b0b123c8c121adb64251f13d176a36c4b379a01a891746b7c57eda7412
    Image:         k8s.gcr.io/ingress-nginx/controller:v1.1.2@sha256:28b11ce69e57843de44e3db6413e98d09de0f6688e33d4bd384002a44f78405c
    Image ID:      k8s.gcr.io/ingress-nginx/controller@sha256:28b11ce69e57843de44e3db6413e98d09de0f6688e33d4bd384002a44f78405c
    Ports:         80/TCP, 443/TCP, 8443/TCP
    Host Ports:    0/TCP, 0/TCP, 0/TCP
    Args:
      /nginx-ingress-controller
      --publish-service=$(POD_NAMESPACE)/ingress-nginx-controller
      --election-id=ingress-controller-leader
      --controller-class=k8s.io/ingress-nginx
      --ingress-class=nginx
      --configmap=$(POD_NAMESPACE)/ingress-nginx-controller
      --validating-webhook=:8443
      --validating-webhook-certificate=/usr/local/certificates/cert
      --validating-webhook-key=/usr/local/certificates/key
    State:          Running
      Started:      Wed, 14 Dec 2022 00:05:12 +0900
    Last State:     Terminated
      Reason:       Unknown
      Exit Code:    255
      Started:      Wed, 14 Dec 2022 00:04:13 +0900
      Finished:     Wed, 14 Dec 2022 00:05:05 +0900
    Ready:          True
    Restart Count:  4
    Requests:
      cpu:      100m
      memory:   90Mi
    Liveness:   http-get http://:10254/healthz delay=10s timeout=1s period=10s #success=1 #failure=5
    Readiness:  http-get http://:10254/healthz delay=10s timeout=1s period=10s #success=1 #failure=3
    Environment:
      POD_NAME:       ingress-nginx-controller-78786894bf-jdc27 (v1:metadata.name)
      POD_NAMESPACE:  ingress-nginx (v1:metadata.namespace)
      LD_PRELOAD:     /usr/local/lib/libmimalloc.so
    Mounts:
      /usr/local/certificates/ from webhook-cert (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-4w774 (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  webhook-cert:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  ingress-nginx-admission
    Optional:    false
  kube-api-access-4w774:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   Burstable
Node-Selectors:              kubernetes.io/os=linux
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:
  Type    Reason  Age                From                      Message
  ----    ------  ----               ----                      -------
  Normal  RELOAD  24m (x7 over 97m)  nginx-ingress-controller  NGINX reload triggered due to a change in configuration

kiada Pod Information

❯ kubectl describe pod kiada-001
Name:             kiada-001
Namespace:        default
Priority:         0
Service Account:  default
Node:             k3d-two-node-cluster-server-0/172.19.0.4
Start Time:       Mon, 05 Dec 2022 00:28:14 +0900
Labels:           app=kiada
                  rel=stable
Annotations:      <none>
Status:           Running
IP:               10.42.2.29
IPs:
  IP:  10.42.2.29
Containers:
  kiada:
    Container ID:   containerd://040ce5f63e52e6a6def423940f43a30d0d21d395cb3402fe12992d012b502025
    Image:          luksa/kiada:0.5
    Image ID:       docker.io/luksa/kiada@sha256:0516c2e9d838d6491048b2de23293384c2670f6a1252b9e8d42a69bad2c610f6
    Port:           8080/TCP
    Host Port:      0/TCP
    State:          Running
      Started:      Wed, 14 Dec 2022 00:05:13 +0900
    Last State:     Terminated
      Reason:       Unknown
      Exit Code:    255
      Started:      Tue, 13 Dec 2022 23:05:26 +0900
      Finished:     Wed, 14 Dec 2022 00:05:05 +0900
    Ready:          True
    Restart Count:  3
    Readiness:      http-get http://:8080/healthz/ready delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:
      QUOTE_URL:  http://quote/quote
      QUIZ_URL:   http://quiz
      POD_NAME:   kiada-001 (v1:metadata.name)
      POD_IP:      (v1:status.podIP)
      NODE_NAME:   (v1:spec.nodeName)
      NODE_IP:     (v1:status.hostIP)
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-5vldh (ro)
  envoy:
    Container ID:   containerd://c538b62c3186ffd6571ef05de7f77fcbd5e7d25e736bdc7b0ec775a42d98099b
    Image:          envoyproxy/envoy:v1.14.1
    Image ID:       docker.io/envoyproxy/envoy@sha256:ccaf9e0135bf498fb8396ad49defd7f8567bf706411d9a707efb3978fb842c89
    Ports:          8443/TCP, 9901/TCP
    Host Ports:     0/TCP, 0/TCP
    State:          Running
      Started:      Wed, 14 Dec 2022 00:05:13 +0900
    Last State:     Terminated
      Reason:       Unknown
      Exit Code:    255
      Started:      Tue, 13 Dec 2022 23:05:27 +0900
      Finished:     Wed, 14 Dec 2022 00:05:05 +0900
    Ready:          True
    Restart Count:  3
    Readiness:      http-get http://:admin/ready delay=0s timeout=1s period=10s #success=1 #failure=3
    Environment:    <none>
    Mounts:
      /etc/envoy from etc-envoy (ro)
      /var/run/secrets/kubernetes.io/serviceaccount from kube-api-access-5vldh (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             True
  ContainersReady   True
  PodScheduled      True
Volumes:
  etc-envoy:
    Type:                Projected (a volume that contains injected data from multiple sources)
    ConfigMapName:       kiada-envoy-config
    ConfigMapOptional:   <nil>
    SecretName:          kiada-tls
    SecretOptionalName:  <nil>
  kube-api-access-5vldh:
    Type:                    Projected (a volume that contains injected data from multiple sources)
    TokenExpirationSeconds:  3607
    ConfigMapName:           kube-root-ca.crt
    ConfigMapOptional:       <nil>
    DownwardAPI:             true
QoS Class:                   BestEffort
Node-Selectors:              <none>
Tolerations:                 node.kubernetes.io/not-ready:NoExecute op=Exists for 300s
                             node.kubernetes.io/unreachable:NoExecute op=Exists for 300s
Events:                      <none>
@Bonjaski Bonjaski changed the title Chapter 12.2.1 Exposing service through ingress Chapter 12.2.1 Exposing service through ingress (Timeout Error) Dec 13, 2022
@Bonjaski Bonjaski changed the title Chapter 12.2.1 Exposing service through ingress (Timeout Error) (Timeout Error) Chapter 12.2.1 Exposing service through ingress Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant