TykTechnologies / tyk-operator

Tyk Operator for Kubernetes
https://tyk.io
Mozilla Public License 2.0
197 stars 38 forks source link

404 not found #351

Closed FredyR4zox closed 3 years ago

FredyR4zox commented 3 years ago

Hi,

I've been trying to getting tyk gateway to work but i haven't been successful. At first, i tried using the API Definitions templates with the Ingress but it worked for some seconds and then puff, it stopped working without me changing anything. Only sending more requests. Not even restarting the pods corrected it. I have tried with TLS and without TLS, only using API Definitions without the Ingress (templating). and still nothing. Sometimes it works but then stops working (rarely works). The errors are mostly 404 Not found errors but sometimes they don't even reach the gateway. I have the log_level at debug but it isn't helpful.

Does anyone know what is going on with this?

Here goes my files and some screenshots of the API Definitions and such.

Thank you.

image

image

image

image

When I set the protocol to https in the API Definition, an error occurs. It says "implement me". It comes from here: https://github.com/TykTechnologies/tyk-operator/blob/master/pkg/client/gateway/client.go line 61

asoorm commented 3 years ago

Hello and thank you for your query @FredyR4zox .

It looks like you are using Tyk Operator with an Open Source Gateway installation. Tyk Operator only operates on a single Gateway, not a cluster of Gateways - it looks like the reason it kind of worked, then stopped, is because the K8s service is RR load balancing to 2 nodes which don't work, and 1 node which does. This is a licensing limitation.

https://github.com/TykTechnologies/tyk-operator/blob/master/docs/installation/installation.md#tyk-licensing

Would you like me to put you in-touch with an Account Exec / Solution Architect to set you up with a PoC / Trial License?

FredyR4zox commented 3 years ago

Hi @asoorm,

Ah, makes sense :/ I will use only one gateway then. Right now I don't need the full gateway. But can I serve services from different namespaces? I can have 10 services from the default namespace and other 10 from other namespace? And what about the https thing ("implement me")? Can I provide my certificate to the gateway so that i don't use a self signed cert?

Thank you for your answer.

asoorm commented 3 years ago

But can I serve services from different namespaces? I can have 10 services from the default namespace and other 10 from other namespace?

Absolutely - yes you can

apiVersion: tyk.tyk.io/v1alpha1
kind: ApiDefinition
metadata:
  name: httpbin
spec:
  name: httpbin
  use_keyless: true
  protocol: http
  active: true
  proxy:
    target_url: http://httpbin.foo.svc:8000           # targeting httpbin service in the foo namespace
    listen_path: /httpbin
    strip_listen_path: true

Can I provide my certificate to the gateway so that i don't use a self signed cert?

https://tyk.io/docs/basic-config-and-security/security/tls-and-ssl/#tykconf

You can load your TLS certificate into Tyk by mounting it as a volume & referencing it in the tyk.conf, or via env var.