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

How to use voyager instead of kubernetes nginx ingress controller #742

Closed
like-inspur opened this issue Dec 5, 2017 · 6 comments
Closed

Comments

@like-inspur
Copy link

like-inspur commented Dec 5, 2017

I install voyager on baremetal kubernetes according to with-rbac,yam, like this:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: voyager
  name: voyager-operator
  namespace: kube-system
spec:
  replicas: 1
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  labels:
    app: voyager
  name: voyager-operator
  namespace: kube-system
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: voyager
      annotations:
        scheduler.alpha.kubernetes.io/critical-pod: ''
    spec:
      hostNetwork: true
      serviceAccountName: voyager-operator
      containers:
      - name: voyager
        args:
        - run
        - --v=3
        - --rbac
        - --analytics=false
        - --alsologtostderr=true
        - --ingress-class=voyager
        - --master=http://127.0.0.1:8080
        image: appscode/voyager:5.0.0-rc.6
        imagePullPolicy: IfNotPresent
        ports:
        - containerPort: 56790
          name: ops
          protocol: TCP
        - containerPort: 56791
          name: acme
          protocol: TCP
      nodeSelector:
        manager: iop_true
      tolerations:
      - key: CriticalAddonsOnly
        operator: Exists

Then I create a voyager ingress , but after I config /etc/hosts, I can't access service according host/path

apiVersion: voyager.appscode.com/v1beta1
kind: Ingress
metadata:
  name: test
  namespace: kube-system
  annotations:
    kubernetes.io/ingress.class: voyager
spec:
  rules:
  - host: appscode.example.com
    http:
      paths:
      - path: '/test'
        backend:
          serviceName: elasticsearch
          servicePort: '9200'

curl appscode.example.com/test
curl: (7) Failed connect to appscode.example.com:80; Connection refused

So how to use voyager as ingress controller, and where to find haproxy.cfg in voyager pod

@like-inspur
Copy link
Author

like-inspur commented Dec 5, 2017

I corect ingress.yaml that use hostport like this:

apiVersion: voyager.appscode.com/v1beta1
kind: Ingress
metadata:
  name: test
  namespace: kube-system
  annotations:
    kubernetes.io/ingress.class: voyager
    ingress.appscode.com/type: HostPort
    ingress.appscode.com/node-selector: '{"manager" : "iop_true"}'
spec:
  rules:
  - host: appscode.example.com
    http:
      paths:
      - path: '/test'
        backend:
          serviceName: elasticsearch
          servicePort: '9200'

I found voyager-test pod and service create successfully, but access service still failed, error is like this:

{"error":{"root_cause":[{"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"test","index_uuid":"_na_","index":"test"}],"type":"index_not_found_exception","reason":"no such index","resource.type":"index_or_alias","resource.id":"test","index_uuid":"_na_","index":"test"},"status":404}```

@sadlil
Copy link
Contributor

sadlil commented Dec 5, 2017

Are you using ElesticSearch as the backend? From the error it looks like the loadbalancer is working. The json error response you pasted is coming from elastic search. It is lokking for a index in ES nammed test and hence No Index found exception.

@like-inspur
Copy link
Author

Then how can I access elasticsearch service like use kubernetes ingress (hostname/path) ? @sadlil

@tamalsaha
Copy link
Contributor

HI @like-inspur, sorry for slow response. I am travelling for Kubecon. I am going to reply as soon as I get some time to look into this.

In the mean time, do you know that Voyager does not merge all Ingress into one before exposing via HAProxy? This is usually the big surprise for users who come to Voyager from nginx controller. See here: kubernetes/ingress-nginx#1539

@like-inspur
Copy link
Author

like-inspur commented Dec 7, 2017

Oh , I see. Then host and path under rules defined in ingress.voyager.appscode.com means client host and path, not the server host and path like ingress defined in kubernetes? I can access service like this:
apiVersion: voyager.appscode.com/v1beta1
kind: Ingress
metadata:
name: kibana
namespace: kube-system
annotations:
kubernetes.io/ingress.class: voyager
ingress.appscode.com/type: NodePort
ingress.appscode.com/node-selector: '{"manager" : "iop_true"}'
spec:
backend:
serviceName: kibana
servicePort: '5601'

So what is the meaning of rules that contronll host and path, is it needs to be with ingress? @tamalsaha

@tamalsaha
Copy link
Contributor

@like-inspur , if you are still looking for answers, please take a look at https://appscode.com/products/voyager/6.0.0-rc.0/concepts/ingress-types/nodeport/

The above example uses the default backend. But if you want to configure TLS or take advantage of other features, you will have to use host/path rules section.

Please reopen if you still have more questions.

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

3 participants