incubator-devlake icon indicating copy to clipboard operation
incubator-devlake copied to clipboard

[Question][HELM Chart] Not able to deploy via Traefik in Kubernetes

Open ChintanPania opened this issue 2 years ago • 6 comments

Question

Is there any specific configurations to be done when deploying the HELM using Traefik Ingress class in Kubernetes ?

Screenshots

If applicable, add screenshots to help explain.

Additional context

I use v0.19.0-beta6

I get 504 Gateway Timeout with the below configuration, UI Pod is running fine and I get HTML document when I exec curl inside the pod, there seems to be an issue between Ingress and Service.

Could someone please assist here ?

Below is my ingress configuration,

ingress:
  enabled: true
  enableHttps: false
  # Set to false if you want to use a different ingress controller
  useDefaultNginx: false
  # ingress class name, example: alb for AWS load balancer controller
  className: 
    # domain name for hosting devlake, must be set if ingress is enabled
  hostname: mydomain.com
  # annotations required for your ingress controller; see the examples below
  # for nginx, use the first two lines of annotations
  # for alb (w/ external-dns), use the last 5 (6) lines of annotations
  annotations:
    kubernetes.io/ingress.class: traefik
    traefik.ingress.kubernetes.io/router.tls: "true"
    # {}
    # kubernetes.io/ingress.class: nginx
    # kubernetes.io/tls-acme: "true"
    #
    # alb.ingress.kubernetes.io/actions.ssl-redirect: '{"Type": "redirect", "RedirectConfig": { "Protocol": "HTTPS", "Port": "443", "StatusCode": "HTTP_301"}}'
    # alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:xxx:certificate/xxx-xxx-xxx
    # alb.ingress.kubernetes.io/listen-ports: '[{"HTTPS":443}, {"HTTP":80}]'
    # alb.ingress.kubernetes.io/scheme: internet-facing
    # alb.ingress.kubernetes.io/target-type: ip
    # external-dns.alpha.kubernetes.io/hostname: www.example.com

  # url prefix, not works right now, keep "/"
  prefix: /
  # if using https provides the certificates secret name
  tlsSecretName: ""
  # ingress http port
  httpPort: 80
  # ingress https port
  httpsPort: 443

ChintanPania avatar Nov 28 '23 07:11 ChintanPania

hi @ChintanPania, what error is it?

ZhangNing10 avatar Nov 29 '23 02:11 ZhangNing10

@ZhangNing10 504 Gateway Timeout Error (seems to come from Service), the request goes to Ingress (Traefik) but service does not forward to the Pod.

ChintanPania avatar Nov 29 '23 07:11 ChintanPania

@ChintanPania do you use 443 port or 80 port to access? and is traefik behind some load balancer? can i have a look at your traefik values?

ZhangNing10 avatar Nov 29 '23 08:11 ZhangNing10

@ZhangNing10, we have a load balancer, and below is the service info of the traefik

kind: Service
apiVersion: v1
metadata:
  name: traefikv2
  namespace: ingress
  uid: a615a59e-a883-4c99-8510-5455b8254604
  resourceVersion: '34898376'
  creationTimestamp: '2023-05-22T04:55:12Z'
  labels:
    app.kubernetes.io/instance: traefikv2
    app.kubernetes.io/managed-by: Helm
    app.kubernetes.io/name: traefikv2
    helm.sh/chart: traefikv2-10.3.6
  annotations:
    loadbalancer.openstack.org/load-balancer-address: xx.xxx.xxx.xxx
    loadbalancer.openstack.org/load-balancer-id: 5b4de1fd-5d96-4483-8514-bf08a94fc979
    meta.helm.sh/release-name: traefikv2
    meta.helm.sh/release-namespace: ingress
  finalizers:
    - service.kubernetes.io/load-balancer-cleanup
  managedFields:
    - manager: helm
      operation: Update
      apiVersion: v1
      time: '2023-05-22T04:55:11Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            .: {}
            f:meta.helm.sh/release-name: {}
            f:meta.helm.sh/release-namespace: {}
          f:labels:
            .: {}
            f:app.kubernetes.io/instance: {}
            f:app.kubernetes.io/managed-by: {}
            f:app.kubernetes.io/name: {}
            f:helm.sh/chart: {}
        f:spec:
          f:allocateLoadBalancerNodePorts: {}
          f:externalTrafficPolicy: {}
          f:internalTrafficPolicy: {}
          f:ports:
            .: {}
            k:{"port":80,"protocol":"TCP"}:
              .: {}
              f:name: {}
              f:port: {}
              f:protocol: {}
              f:targetPort: {}
            k:{"port":443,"protocol":"TCP"}:
              .: {}
              f:name: {}
              f:port: {}
              f:protocol: {}
              f:targetPort: {}
          f:selector: {}
          f:sessionAffinity: {}
          f:type: {}
    - manager: openstack-cloud-controller-manager
      operation: Update
      apiVersion: v1
      time: '2023-05-22T04:55:45Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:finalizers:
            .: {}
            v:"service.kubernetes.io/load-balancer-cleanup": {}
        f:status:
          f:loadBalancer:
            f:ingress: {}
      subresource: status
    - manager: openstack-cloud-controller-manager
      operation: Update
      apiVersion: v1
      time: '2023-09-15T09:51:58Z'
      fieldsType: FieldsV1
      fieldsV1:
        f:metadata:
          f:annotations:
            f:loadbalancer.openstack.org/load-balancer-address: {}
            f:loadbalancer.openstack.org/load-balancer-id: {}
spec:
  ports:
    - name: web
      protocol: TCP
      port: 80
      targetPort: web
      nodePort: 33080
    - name: websecure
      protocol: TCP
      port: 443
      targetPort: websecure
      nodePort: 35998
  selector:
    app.kubernetes.io/instance: traefikv2
    app.kubernetes.io/name: traefikv2
  clusterIP: xxx.xxx.xx.xxx
  clusterIPs:
    - xxx.xxx.xx.xxx
  type: LoadBalancer
  sessionAffinity: None
  externalTrafficPolicy: Cluster
  ipFamilies:
    - IPv4
  ipFamilyPolicy: SingleStack
  allocateLoadBalancerNodePorts: true
  internalTrafficPolicy: Cluster
status:
  loadBalancer:
    ingress:
      - ip: xx.xxx.xxx.xxx

ChintanPania avatar Nov 29 '23 09:11 ChintanPania

@ChintanPania so you use 443 to access devlake, and the listener 443 of aws lb has a target group to websecure node port 35998? if so, could you use the web port as 443 to have a try?

ZhangNing10 avatar Dec 04 '23 08:12 ZhangNing10

@ZhangNing10 I was able to load the devlake-config-ui by adding some network policy.

But somehow the UI is not able to connect to /api/ping and /api/userinfo endpoints, I get 404 in the browser and below is the snapshot for the same.

image

image

When I get into the Pod and do a curl with http://localhost:4000/api/userinfo, I do get a 200 with a JSON response. could you please suggest what is the issue here ?

ChintanPania avatar Jan 30 '24 10:01 ChintanPania

This issue has been automatically marked as stale because it has been inactive for 60 days. It will be closed in next 7 days if no further activity occurs.

github-actions[bot] avatar Mar 31 '24 00:03 github-actions[bot]

This issue has been closed because it has been inactive for a long time. You can reopen it if you encounter the similar problem in the future.

github-actions[bot] avatar Apr 07 '24 00:04 github-actions[bot]