gimlet-io / capacitor

A general purpose UI for FluxCD.
Apache License 2.0
476 stars 13 forks source link

feat. add compatibility with ALB as ingress for EKS #63

Closed zensqlmonitor closed 3 months ago

zensqlmonitor commented 4 months ago

Hi,

first congratulation for this nice project, that looks fantastic. Any plan to support AWS ALB as ingress ?

Logs UI is not working and I have continuously this error message :

Could not process redux event: {"type":"@@redux/INIT4.0.e.f.1.k"} streamingBackend.js:39 WebSocket connection to 'ws://alb-flux-capacitor-123456789.eu-west-1.elb.amazonaws.com/ws/' failed: e.onClose @ streamingBackend.js:39 streamingBackend.js:38 disconnected: 1006.

Thanks.

T0jgli commented 4 months ago

I got the same error using behind a loadbalancer service in k3s.

Could not process redux event: {"type":"@@redux/INITw.p.p.g.d"}
TypeError: Cannot read properties of undefined (reading '0')
laszlocph commented 3 months ago

The Could not process redux event: {"type":"@@redux/INIT4.0.e.f.1.k"} bit is unrelated, and now handled in: https://github.com/gimlet-io/capacitor/commit/f8d80e55ce6da451b0564fb412b4c667dac048e0#diff-d4bb4bfdb21e67b8faaa157014670a86992d26f3757f734918a12ccf4676a7cbR77

Let me spin up an ALB. Maybe websockets need some love there.

marcincuber commented 3 months ago

I have it working fine behind ALB:

---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  namespace: flux-system
  name: capacitor
  annotations:
    alb.ingress.kubernetes.io/scheme: internal
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/ssl-redirect: "443"
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}, {"HTTPS": 443}]'
    alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:eu-west-2:ACCOUNT_ID:certificate/dfeb4699-f8f1-4cc5-1234
    external-dns.alpha.kubernetes.io/hostname: flux.example.com
spec:
  ingressClassName: alb
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: capacitor
                port:
                  number: 9000
T0jgli commented 3 months ago

Mine is working now with the latest release

zensqlmonitor commented 3 months ago

I confirm the redux event disappeared with the latest release v0.3.2. But still receive continuously the following error: WebSocket connection to 'ws://alb-flux-capacitor-123456789.eu-west-1.elb.amazonaws.com/ws/' failed: e.onClose @ streamingBackend.js:39 streamingBackend.js:38 disconnected: 1006.

For pods, describe command is properly working but logs are not streamed.

@marcincuber thanks. I have the same ingress definition.

zensqlmonitor commented 3 months ago

@laszlocph I tested several ALB configuration s without any success. The issue with ws remains and the logs are not streamed.

laszlocph commented 3 months ago

Tried now with this ingress yaml and it works for me.

But I do see that EKS/ALB has many options I am not saying that it works on all settings. Any hunch what is different in your setup?

kind: Ingress
metadata:
  namespace: flux-system
  name: capacitor
  annotations:
    alb.ingress.kubernetes.io/scheme: internet-facing
    alb.ingress.kubernetes.io/target-type: ip
    alb.ingress.kubernetes.io/listen-ports: '[{"HTTP": 80}]'
spec:
  ingressClassName: alb
  rules:
    - http:
        paths:
          - path: /
            pathType: Prefix
            backend:
              service:
                name: capacitor
                port:
                  number: 9000
image
zensqlmonitor commented 3 months ago

Thanks for this, works on Edge at home while not working in my company. I have the same configuration but with a WAF associated. Many thanks !