Does anyone know how to expose fleet in kubernetes...
# fleet
i
Does anyone know how to expose fleet in kubernetes through an ingress controller and not with a loadbalancer type service as explained in the fleet documentation?
r
The Fleet Helm chart includes ingress support if that will meet your needs. https://fleetdm.com/docs/deploy/deploy-fleet-on-kubernetes#deploying-fleet-with-helm has some general info and the default values.yaml does have the ingress section, but it will need to be customized to match your ingress controller.
i
Thankyou @Robert Fairburn
Is there a way to do it with a normal deployment and not helm? This is my ip cluster type service apiVersion: v1 type: Service metadata: name: fleet-service namespace: fleet tags: app: fleet-service specification type: ClusterIP ports: - name: fleet port 443 targetPort: 443 protocol: TCP selector: app: fleet-webserver and this is my ingress apiVersion: networking.k8s.io/v1 type: Ingress metadata: name: fleet namespace: fleet annotations: cert-manager.io/cluster-issuer: "letsencrypt-prod" # kubernetes.io/ingress.class: nginx nginx.ingress.kubernetes.io/proxy-body-size: 10m spec: ingressClassName: nginx rules: - host: fleetdm.test.com http: path: - path: / pathType: ImplementationSpecific backend: service: name: fleet-service port number: 443 tls: - hosts: - fleetdm.test.com secretName: fleet-tls-secret
with this configuration if I enter the address https://fleetdm.test.com the web gives me a 400 error.
r
Hmm a 400 bad request. If you try and use
kubectl logs
on your Fleet container(s), do you see anything making it clear to there? Since it's not a 5XX, there is a chance that we are making it to the backend, but there is some kind of other issue. A 400 typically indicates a
bad request
on the client side, so if we can figure out whether it is Fleet or your ingress generating the 400, I think that gives the best place to start. Potentially
kubectl logs
for the matching request entry on the nginx (or whatever other ingress you may be using) container that handled the request could be revealing too.