dudo / turing-pi

Continuous Deployment for local ARM64 based Kubernetes cluster
10 stars 0 forks source link

Flux webhook Receiver #7

Closed dudo closed 1 year ago

dudo commented 1 year ago

Set up https://fluxcd.io/flux/guides/webhook-receivers/

Their example uses Ingress. Let's use Gateway API. Something like

---
apiVersion: networking.x-k8s.io/v1alpha1
kind: GatewayClass
metadata:
  name: example-gatewayclass
spec:
  controller: <ingress-controller-name>

---
apiVersion: networking.x-k8s.io/v1alpha1
kind: Gateway
metadata:
  name: example-gateway
  namespace: flux-system
spec:
  gatewayClassName: example-gatewayclass
  listeners:
  - protocol: HTTP
    port: 80
    routes:
      kind: HTTPRoute
      selector:
        matchLabels:
          gateway: example-gateway
      namespaces:
        from: "Same"

---
apiVersion: networking.x-k8s.io/v1alpha1
kind: HTTPRoute
metadata:
  name: webhook-receiver-route
  namespace: flux-system
  labels:
    gateway: example-gateway
spec:
  hostnames:
  - flux-webhook.example.com
  rules:
  - matches:
    - path:
        type: Prefix
        value: /
    forwardTo:
    - serviceName: webhook-receiver
      port: 80

Since this is a home server... couple things need to happen first. Here's a decent article capturing the high level requirements. I don't think we need tailscale or duckdns, though (and might not even need metallb, since were using Gateway API?). Let's plan on using https://dudo.dev to route to the cluster.

dudo commented 1 year ago

Went with a cloudflare tunnel instead. Much easier!