diff --git a/cluster/apps/default/hajimari/helm-release.yaml b/cluster/apps/default/hajimari/helm-release.yaml index e757fb8e..a9d69531 100644 --- a/cluster/apps/default/hajimari/helm-release.yaml +++ b/cluster/apps/default/hajimari/helm-release.yaml @@ -111,6 +111,7 @@ spec: hajimari.io/enable: "true" hajimari.io/icon: "weather-sunset" traefik.ingress.kubernetes.io/router.entrypoints: "websecure" + traefik.ingress.kubernetes.io/router.middlewares: "networking-local-only-access@kubernetescrd" hosts: - host: "hajimari.${SECRET_DOMAIN}" paths: diff --git a/cluster/apps/networking/traefik/kustomization.yaml b/cluster/apps/networking/traefik/kustomization.yaml index 93d91fd2..077d2653 100644 --- a/cluster/apps/networking/traefik/kustomization.yaml +++ b/cluster/apps/networking/traefik/kustomization.yaml @@ -4,3 +4,4 @@ kind: Kustomization resources: - helm-release.yaml - dashboard + - middlewares diff --git a/cluster/apps/networking/traefik/middlewares/kustomization.yaml b/cluster/apps/networking/traefik/middlewares/kustomization.yaml new file mode 100644 index 00000000..9698e4d8 --- /dev/null +++ b/cluster/apps/networking/traefik/middlewares/kustomization.yaml @@ -0,0 +1,5 @@ +--- +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - local-only-access.yaml diff --git a/cluster/apps/networking/traefik/middlewares/local-only-access.yaml b/cluster/apps/networking/traefik/middlewares/local-only-access.yaml new file mode 100644 index 00000000..58d38611 --- /dev/null +++ b/cluster/apps/networking/traefik/middlewares/local-only-access.yaml @@ -0,0 +1,22 @@ +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: rfc1918-ips + namespace: networking +spec: + ipWhiteList: + sourceRange: + - 10.0.0.0/8 + - 172.16.0.0/12 + - 192.168.0.0/16 +--- +apiVersion: traefik.containo.us/v1alpha1 +kind: Middleware +metadata: + name: local-only-access + namespace: networking +spec: + chain: + middlewares: + - name: rfc1918-ips