diff --git a/kubernetes/personal/openclaw/kustomization.yaml b/kubernetes/personal/openclaw/kustomization.yaml index e9257fe..9987a15 100644 --- a/kubernetes/personal/openclaw/kustomization.yaml +++ b/kubernetes/personal/openclaw/kustomization.yaml @@ -4,3 +4,4 @@ namespace: openclaw resources: - openclaw-instance.yaml - openclaw-secrets.yaml + - networkpolicy.yaml diff --git a/kubernetes/personal/openclaw/networkpolicy.yaml b/kubernetes/personal/openclaw/networkpolicy.yaml new file mode 100644 index 0000000..1381dfb --- /dev/null +++ b/kubernetes/personal/openclaw/networkpolicy.yaml @@ -0,0 +1,28 @@ +# Supplementary NetworkPolicy: the operator's managed default-deny policy +# (netpol "openclaw") only allows same-namespace ingress, which blocks +# Traefik from reaching the gateway proxy -> 504 through the Ingress. +# +# The CR field spec.networkPolicy.allowedIngressNamespaces would be the +# native fix, but it is not in the CRD bundled with chart 0.39.0 yet +# (silently pruned). Revisit after upgrading the operator. +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: + name: openclaw-traefik-ingress + namespace: openclaw +spec: + podSelector: + matchLabels: + app.kubernetes.io/instance: openclaw + app.kubernetes.io/name: openclaw + policyTypes: + - Ingress + ingress: + - from: + - namespaceSelector: + matchLabels: + kubernetes.io/metadata.name: traefik + ports: + # Gateway proxy container port (Service 18789 -> targetPort 18790) + - port: 18790 + protocol: TCP diff --git a/kubernetes/personal/openclaw/openclaw-instance.yaml b/kubernetes/personal/openclaw/openclaw-instance.yaml index a7fc28b..facac0f 100644 --- a/kubernetes/personal/openclaw/openclaw-instance.yaml +++ b/kubernetes/personal/openclaw/openclaw-instance.yaml @@ -26,11 +26,6 @@ spec: forceHTTPS: false annotations: external-dns.alpha.kubernetes.io/enabled: "true" - # Operator's default-deny NetworkPolicy only allows same-namespace ingress; - # allow Traefik so the Ingress route can reach the gateway proxy. - networkPolicy: - allowedIngressNamespaces: - - traefik resources: requests: cpu: 250m