kudurru on Kubernetes with kustomize

config/ is a kubebuilder-style kustomize tree (docs/architecture.md §5.7). Its bases are rendered from the Helm chart (make deploy-assets), so both install paths deploy the same objects; the deploy tests build every overlay and validate it with kubeconform.

PathContent
config/crdthe CRDs (make manifests)
config/rbacServiceAccount, least-privilege ClusterRole/Role, aggregated roles
config/managerDeployment, the node and settings ConfigMaps, dns/api/headless Services, PDB
config/namespacekudurru-system with the Restricted Pod Security labels
config/defaultall of the above: kustomize build config/default is the release's install.yaml
config/samplesexample DNSZone, DNSRecordSet, BlockList, ClientGroup, Policy
config/overlays/metallbMetalLB address and pool annotations on the dns Service
config/overlays/kube-vipkube-vip address annotation and load balancer class
config/overlays/cloud-lb-mixedcloud LoadBalancer annotations (AWS NLB with IP targets)
config/overlays/hostnetwork-daemonsetDaemonSet on the host network, privileged namespace
config/overlays/standalonesqlite store, StatefulSet(1) with a PVC, no CRDs or RBAC
config/overlays/with-edgednsdist edge Deployment in front, kudurru on :5353 with PROXYv2

Install

The manifests mount Secrets you create first (kustomize has no random generator):

kubectl apply -f config/namespace/namespace.yaml
kubectl -n kudurru-system create secret generic kudurru-encryption-key \
  --from-literal=key="$(openssl rand -base64 32)"
kubectl -n kudurru-system create secret generic kudurru-admin --type=kubernetes.io/basic-auth \
  --from-literal=username=admin --from-literal=password="$(openssl rand -base64 18)"
# with-edge only:
kubectl -n kudurru-system create secret generic kudurru-proxy-protocol \
  --from-literal=proxy-protocol-secret="$(openssl rand -hex 32)"

kubectl apply --server-side -k config/default          # or config/overlays/<name>
kubectl apply -k config/samples                        # optional examples

Or straight from a release: kubectl apply --server-side -f https://github.com/robertherbaugh/kudurru/releases/download/v0.1.0/install.yaml.

Customising

Write your own overlay on top of config/default (or any overlay) and patch what you need, for example the upstreams in the node ConfigMap or the replica count:

apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
  - github.com/robertherbaugh/kudurru/config/overlays/metallb?ref=v0.1.0
patches:
  - target: { kind: Deployment, name: kudurru }
    patch: |-
      - op: replace
        path: /spec/replicas
        value: 3

Changing the node ConfigMap through kustomize does not update the checksum/node-config annotation the Helm chart maintains; restart the pods (kubectl -n kudurru-system rollout restart deployment/kudurru) after changing it.

Source: docs/deploy/kustomize.md