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

Ingress is not set up properly in k8s clusters #46

Closed
jsanda opened this issue Sep 11, 2019 · 4 comments
Closed

Ingress is not set up properly in k8s clusters #46

jsanda opened this issue Sep 11, 2019 · 4 comments
Labels
bug Something isn't working

Comments

@jsanda
Copy link

jsanda commented Sep 11, 2019

I am trying v1.4.0 on a GKE cluster. Here is my manifest which I copied from the examples:

apiVersion: integreatly.org/v1alpha1
kind: Grafana
metadata:
  name: example-grafana
spec:
  config:
    log:
      mode: "console"
      level: "warn"
    security:
      admin_user: "root"
      admin_password: "secret"
    auth:
      disable_login_form: False
      disable_signout_menu: True
    auth.basic:
      enabled: False
    auth.anonymous:
      enabled: True
  dashboardLabelSelector:
    - matchExpressions:
        - {key: app, operator: In, values: [grafana]}

The operator creates a ClusterIP service:

$ kubectl get svc
NAME              TYPE        CLUSTER-IP    EXTERNAL-IP   PORT(S)    AGE
grafana-service   ClusterIP   10.80.15.92   <none>        3000/TCP   114s

For non-OpenShift clusters, shouldn't a NodePort or LoadBalancer service be created?

Here is my ingress which never get assigned an address:

$ kubectl get ingress
NAME              HOSTS   ADDRESS   PORTS   AGE
grafana-ingress   *                 80      7m28s

I deleted the service and created the following NodePort service:

apiVersion: v1
kind: Service
metadata:
  labels:
    application-monitoring: "true"
  name: grafana-service
spec:
  ports:
  - name: grafana
    port: 3000
    protocol: TCP
    targetPort: 3000
  selector:
    app: grafana
  type: NodePort

Now my Ingress gets an IP address:

$ kubectl get ingress
NAME              HOSTS   ADDRESS         PORTS   AGE
grafana-ingress   *       34.101.217.55   80      10m

A NodePort service is fine for me as this is just for dev/testing, but it would probably be good to make it configurable.

@pb82
Copy link
Collaborator

pb82 commented Sep 11, 2019

Hi @jsanda, making the service type configurable sounds reasonable to me. It looks like only NodePort services are supported for Ingresses on GKE.

I'll mark this as a bug since it currently does not work out of the box on GKE. Vanilla Kubernetes and OpenShift should be fine though.

@pb82 pb82 added the bug Something isn't working label Sep 11, 2019
@jsanda
Copy link
Author

jsanda commented Sep 11, 2019

Maybe I should rename the issue to make it more clear. My understand, albeit somewhat limited, is that Ingress with vanilla Kubernetes requires NodePort or LoadBalancer. The k8s docs say:

An Ingress does not expose arbitrary ports or protocols. Exposing services other than HTTP and HTTPS to the internet typically uses a service of type Service.Type=NodePort or Service.Type=LoadBalancer.

This ticket however mentions that "on-prem" ingress controllers like the nginx controller should work with ClusterIP services. I will try to test with a kind cluster as well.

@pb82
Copy link
Collaborator

pb82 commented Sep 15, 2019

@jsanda Mind giving #48 a try?

@pb82
Copy link
Collaborator

pb82 commented Oct 14, 2019

Closing this as the service type is configurable in the v2.0.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants