fabric8io / kubeflix

Kubernetes integration with Netflix OSS
266 stars 69 forks source link

Namespace issue using zuul-proxy as a basis for a zuul proxy in kubernetes #93

Closed ahillman3 closed 8 years ago

ahillman3 commented 8 years ago

I have taken your example zuul-proxy, and modified it for my own use. I'm having issues getting the namespace to be set when looking up endpoints exposed through zuul. I can see the services being mapped to ZuulController. When I try to hit those mapped URL paths, I see an error in the logs: KubernetesServerList : Did not find any endpoints in ribbon in namespace [null] for name [xxxx] and portName [xxxx] The name and portName are correct based on the URL being used, and the configuration. What am I missing to get the namespace set?

iocanel commented 8 years ago

@ahillman3: Older version of kubernetes didn't provide a direct way of letting the pod know of its namespace, so we've been extensively using a trick "pass the namespace as environment variable". We do that by creating an env variable which point to the "metadata.namespace" field of the pod.

spec:
  containers:
  - env:
    - name: KUBERNETES_NAMESPACE
      valueFrom:
        fieldRef:
          apiVersion: v1
          fieldPath: metadata.namespace

I think that if you use this, things will work fine. In future version of kubernetes the kubernetes-client will autodetect the namespace.

ahillman3 commented 8 years ago

I'll try that. Thanks.

iocanel commented 8 years ago

@ahillman3: Great! Please let me know how it goes! I am also interested in hearing anything you can share about your use case etc...

ahillman3 commented 8 years ago

That appears to have fixed the namespace issue. The next issue, is either a RibbonRoutingFilter error with a Forwarding Error, caused by a timeout. (http->http) Or caused by "SSLException: Unrecognized SSL message, plaintext connection?" (https->https) I have switched the LoadBalancers in AWS to be both http or both https, with the above results. Ultimately I'd like everything to be https. Is forwarding with https involved supported? Any idea how these should be set up? Thanks.

iocanel commented 8 years ago

Since the namespace issue has been resolved I created new issue fro the SSL sutff at #94. @ahillman3: can you please provide some more details (full stack traces etc) at #94?