Confused if Service is working

227 views
Skip to first unread message

Timothy Sutton

unread,
Jun 13, 2022, 5:27:06 PM6/13/22
to Knative Users
I have set up knative operator, and services following the instructions here https://knative.dev/docs/install/operator/knative-with-operators/#configure-dns. I am using kourier, and deployed the hello world go test service. I am getting a response that doesnt jive with the expected results of the curl command. I just get back an empty html response.  I did deploy the magic DNS stuff as well.  Below is kind of the state of everything in my cluster.  



kn service list
NAME                  URL                                                          LATEST                      AGE    CONDITIONS   READY   REASON
hello                 http://hello.default.192.168.79.100.sslip.io                 hello-00001                 17s    3 OK / 3     True


k get services
NAME                  TYPE           CLUSTER-IP      EXTERNAL-IP                                          PORT(S)                                              AGE
kubernetes            ClusterIP      10.43.0.1       <none>                                               443/TCP                                              3h18m
operator-webhook      ClusterIP      10.43.151.142   <none>                                               9090/TCP,8008/TCP,443/TCP                            170m
docker-registry       NodePort       10.43.172.19    <none>                                               5000:30059/TCP                                       15m
hello-00001-private   ClusterIP      10.43.26.12     <none>                                               80/TCP,443/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   9m42s
hello-00001           ClusterIP      10.43.214.200   <none>                                               80/TCP,443/TCP                                       9m42s
hello                 ExternalName   <none>          kourier-internal.knative-serving.svc.cluster.local   80/TCP                                               9m39s

 kubectl --namespace knative-serving get service
NAME                         TYPE           CLUSTER-IP      EXTERNAL-IP                                                   PORT(S)                                   AGE
autoscaler-bucket-00-of-01   ClusterIP      10.43.80.149    <none>                                                        8080/TCP                                  170m
activator-service            ClusterIP      10.43.211.17    <none>                                                        9090/TCP,8008/TCP,80/TCP,81/TCP,443/TCP   170m
autoscaler                   ClusterIP      10.43.67.164    <none>                                                        9090/TCP,8008/TCP,8080/TCP                170m
controller                   ClusterIP      10.43.1.182     <none>                                                        9090/TCP,8008/TCP                         170m
domainmapping-webhook        ClusterIP      10.43.245.20    <none>                                                        9090/TCP,8008/TCP,443/TCP                 170m
webhook                      ClusterIP      10.43.43.232    <none>                                                        9090/TCP,8008/TCP,443/TCP                 170m
autoscaler-hpa               ClusterIP      10.43.201.157   <none>                                                        9090/TCP,8008/TCP                         170m
net-kourier-controller       ClusterIP      10.43.51.42     <none>                                                        18000/TCP                                 160m
kourier                      LoadBalancer   10.43.2.79      192.168.79.100,192.168.79.101,192.168.79.102,192.168.79.103   80:31899/TCP,443:31766/TCP                160m
kourier-internal             ClusterIP      10.43.240.24    <none>                                                        80/TCP,443/TCP                            160m
default-domain-service       ClusterIP      10.43.198.58    <none>                                                        80/TCP                                    82m





This is where I think things aren't configured, expect simple Hello statement back but as you see getting something different and no hello even wrapped in the html. If I try wget I get 503 error. 
 curl http://hello.default.192.168.79.100.sslip.io
<!DOCTYPE html>
<html>
        <head>
        </head>
        <body>
                <iframe src="/fortiadc_error_page/index.html" frameborder="0" width="100%" scrolling="no" onload="function resizeIframe(obj) {
            obj.style.height = obj.contentWindow.document.body.scrollHeight + 10 + 'px';
          };resizeIframe(this)"></iframe>
        </body>
</html>

Mauricio Salatino

unread,
Jun 13, 2022, 5:34:46 PM6/13/22
to Timothy Sutton, Knative Users
Timothy, what flavour of Kubernetes are you using? Is that KinD? 


--
You received this message because you are subscribed to the Google Groups "Knative Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to knative-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/knative-users/e5d1c3d6-aef0-488e-9e7d-e93b854a02e9n%40googlegroups.com.
--
 - Blog: http://salaboy.com
 - Twitter: http://twitter.com/salaboy
 
 - Mauricio "Salaboy" Salatino -

Timothy Sutton

unread,
Jun 14, 2022, 8:15:17 AM6/14/22
to Knative Users
Sorry, I meant to mention this. It is K3S

Timothy Sutton

unread,
Jun 14, 2022, 11:22:47 AM6/14/22
to Knative Users
As a follow up I have made a little progress but still confused, about where I am misconfigured. 

I was deploying the service as such  kn service create hello --image gcr.io/knative-samples/helloworld-go --port 8080 --env TARGET=World

I then tried again deploying with  kn service create hello --image gcr.io/knative-samples/helloworld-go --port 80 --env TARGET=World

I was able to query the private service, and get expected response. 



 curl http://hello.default.192.168.79.100.sslip.io
<!DOCTYPE html>
<html>
        <head>
        </head>
        <body>
                <iframe src="/fortiadc_error_page/index.html" frameborder="0" width="100%" scrolling="no" onload="function resizeIframe(obj) {
            obj.style.height = obj.contentWindow.document.body.scrollHeight + 10 + 'px';
          };resizeIframe(this)"></iframe>
        </body>
</html>[vagrant@master ~]$ k get service

NAME                  TYPE           CLUSTER-IP      EXTERNAL-IP                                          PORT(S)                                              AGE
kubernetes            ClusterIP      10.43.0.1       <none>                                               443/TCP                                              21h
operator-webhook      ClusterIP      10.43.151.142   <none>                                               9090/TCP,8008/TCP,443/TCP                            20h
docker-registry       NodePort       10.43.172.19    <none>                                               5000:30059/TCP                                       18h
hello-00001-private   ClusterIP      10.43.35.87     <none>                                               80/TCP,443/TCP,9090/TCP,9091/TCP,8022/TCP,8012/TCP   14s
hello-00001           ClusterIP      10.43.84.250    <none>                                               80/TCP,443/TCP                                       14s
hello                 ExternalName   <none>          kourier-internal.knative-serving.svc.cluster.local   80/TCP                                               13s
[vagrant@master ~]$ curl 10.43.35.87
Hello World!

Evan Anderson

unread,
Jun 14, 2022, 3:55:43 PM6/14/22
to Timothy Sutton, Knative Users
Your initial `curl` command suggests that you're hittinga Fortinet web firewall at that IP address, rather than Kourier in your cluster. If you're running locally (particularly on Mac/Windows), this may be because your load balancer IPs aren't actually routable from your desktop shell.

I'd start by trying to get a load balancer service working before getting Knative working (since it's the same network path, but less of it). This blog post might help (untested): https://blog.kubernauts.io/k3s-with-k3d-and-metallb-on-mac-923a3255c36e

From: knativ...@googlegroups.com <knativ...@googlegroups.com> on behalf of Timothy Sutton <timothy...@saabusa.com>
Sent: Tuesday, June 14, 2022 8:22:47 AM
To: Knative Users <knativ...@googlegroups.com>
Subject: [Suspected Spam] Re: Confused if Service is working
 

⚠ External Email



⚠ External Email: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender.

Timothy Sutton

unread,
Jun 15, 2022, 8:42:37 AM6/15/22
to Knative Users

So this is definitely some sort of DNS issue.  After closer inspection with curl -v,  my machine was resolving DNS name to something outside my local network. I edited my /etc/hosts to force resolution of  hello.default.192.168.79.100.sslip.io  to the ip address 192.168.79.100 (address of my load balancer), and all worked correctly. 
Reply all
Reply to author
Forward
0 new messages