fabric8io / kubeflix

Kubernetes integration with Netflix OSS
266 stars 69 forks source link

turbine: how to make clusters work #182

Closed caarlos0 closed 7 years ago

caarlos0 commented 7 years ago

I've tried to make the ?cluster=blah work, but it won't. I'm pretty sure I'm missing something, but I'm not really sure what.

So far, I'm creating everything with this yaml:

---
apiVersion: "v1"
kind: "ServiceAccount"
metadata:
  name: "turbine"
---
apiVersion: "extensions/v1beta1"
kind: "Deployment"
metadata:
  labels:
    project: "turbine-server"
    provider: "fabric8"
    version: "1.0.28"
    group: "io.fabric8.kubeflix"
  name: "turbine-server"
spec:
  replicas: 1
  selector:
    matchLabels:
      project: "turbine-server"
      provider: "fabric8"
      group: "io.fabric8.kubeflix"
  template:
    metadata:
      labels:
        project: "turbine-server"
        provider: "fabric8"
        version: "1.0.28"
        group: "io.fabric8.kubeflix"
    spec:
      containers:
      - env:
        - name: "KUBERNETES_NAMESPACE"
          valueFrom:
            fieldRef:
              fieldPath: "metadata.namespace"
        image: "fabric8/turbine-server:1.0.28"
        name: "turbine-server"
        ports:
        - containerPort: 8080
          name: "http"
        - containerPort: 8778
          name: "jolokia"
      serviceAccountName: "turbine"
---
apiVersion: "v1"
kind: "Service"
metadata:
  annotations:
    servicepath: "/turbine.stream"
  labels:
    project: "turbine-server"
    provider: "fabric8"
    version: "1.0.28"
    group: "io.fabric8.kubeflix"
  name: "turbine-server"
spec:
  ports:
  - port: 80
    protocol: "TCP"
    targetPort: 8080
  selector:
    project: "turbine-server"
    provider: "fabric8"
    group: "io.fabric8.kubeflix"
  type: "LoadBalancer"

I also enabled some services by annotating them:

apiVersion: v1
kind: Service
metadata:
  labels:
    hystrix.enabled: "true"
    hystrix.cluster: "svc1"

I'm not sure where I should put them, though. Should it be in the service or in the deployment?

Anyways, by doing this, I can access the turbine-server ELB addr + /turbine.stream, but, if a append a ?cluster=svc1 in the URL, I get a 404.

Seems like I'm missing some turbine configs, but I'm not sure how to do it and there is no example in the docs...

Thanks!

iocanel commented 7 years ago

In the readme (in the root of the kubeflix project) there is a section that explains how you can configure the turbine server using a ConfigMap. It also explains that if you want to configure additional clusters you will have to add them to the turbine configuration with something like: turbine.aggregator.cluster.svc1=<namespace>.<service>.

caarlos0 commented 7 years ago

hi @iocanel , thanks for the quick response..

I failed to understand that part of the readme for some reason, I thought I needed to setup the config map somewhere, but it just magically works, nice :)

It's working now, thank you very much!