diff --git a/k8s/30-netowrk-policy.yaml b/k8s/30-netowrk-policy.yaml index 4f63cfa..09ca212 100644 --- a/k8s/30-netowrk-policy.yaml +++ b/k8s/30-netowrk-policy.yaml @@ -14,10 +14,7 @@ spec: - from: - podSelector: matchLabels: - app.kubernetes.io/component: controller - namespaceSelector: - matchLabels: - app.kubernetes.io/name: ingress-nginx + gateway.envoyproxy.io/owning-gateway-name: public ports: - protocol: TCP port: 80 diff --git a/k8s/80-gateway.yaml b/k8s/80-gateway.yaml new file mode 100644 index 0000000..8c621fb --- /dev/null +++ b/k8s/80-gateway.yaml @@ -0,0 +1,18 @@ +--- +apiVersion: gateway.networking.k8s.io/v1 +kind: HTTPRoute +metadata: + name: ifconfig-wildcard + namespace: ifconfig +spec: + parentRefs: + - name: public + kind: Gateway + namespace: ingress-gateway + sectionName: wildcard-ingress + hostnames: + - ifconfig.k8s.pmarques.info + rules: + - backendRefs: + - name: ifconfig + port: 80 diff --git a/k8s/90-ingress.yaml b/k8s/90-ingress.yaml deleted file mode 100644 index 57a7e79..0000000 --- a/k8s/90-ingress.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: networking.k8s.io/v1 -kind: Ingress -metadata: - name: ifconfig - namespace: ifconfig - annotations: - nginx.ingress.kubernetes.io/rewrite-target: /$1 - # nginx.ingress.kubernetes.io/backend-protocol: "HTTPS" -spec: - ingressClassName: nginx - rules: - - http: - paths: - - pathType: ImplementationSpecific - path: /ifconfig/(.*) - backend: - service: - name: ifconfig - port: - number: 80 diff --git a/k8s/kustomization.yaml b/k8s/kustomization.yaml index 3e9c5f4..b3d7edd 100644 --- a/k8s/kustomization.yaml +++ b/k8s/kustomization.yaml @@ -4,5 +4,5 @@ resources: - 10-service.yaml - 20-hpa.yaml - 30-netowrk-policy.yaml -- 90-ingress.yaml +- 80-gateway.yaml