Skip to content

Instantly share code, notes, and snippets.

@pmoncadaisla
Created July 13, 2022 15:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pmoncadaisla/134504fce460a7455116779a210cc531 to your computer and use it in GitHub Desktop.
Save pmoncadaisla/134504fce460a7455116779a210cc531 to your computer and use it in GitHub Desktop.
Resource files for gateway on different namespace
kind: Gateway
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: external-http
namespace: default
spec:
gatewayClassName: gke-l7-gxlb
listeners:
- name: https
protocol: HTTPS
port: 443
allowedRoutes:
namespaces:
from: Selector
selector:
matchLabels:
shared-gateway-access: "true"
tls:
mode: Terminate
options:
networking.gke.io/pre-shared-certs: k8s2-cr-5j7hw88f-g4c3ztkg4vzi81l3-03bb42860f269591
kind: HTTPRoute
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: other-namespace
namespace: app
spec:
parentRefs:
- name: external-http
namespace: default
hostnames:
- "othernamespace.lab-01.k8s.masmovil.com"
rules:
- matches:
- path:
type: PathPrefix
value: /
backendRefs:
- name: istio-ingressgateway
namespace: istio-system
port: 80
kind: ReferencePolicy
apiVersion: gateway.networking.k8s.io/v1alpha2
metadata:
name: grant-app-namespace
namespace: istio-system
spec:
to:
- kind: Service
group: ""
from:
- group: gateway.networking.k8s.io
kind: HTTPRoute
namespace: app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment