istio - gateway api


Install the required CRDS

kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v0.6.1" | kubectl apply -f - 


To setup Gateway API, use the following command :-

istioctl install --set profile=minimal -y


Ensure your namespace is injectable 

kubectl label namespace default istio-injection=enabled

Run your httpbin from samples folder

kubectl apply -f samples/httpbin/httpbin.yaml


Setup your HttpRoute and Gateway for your host


Run the following command to create gateway






Run the following command to create httproutes


httproute start
httproute end



Next using curl to hit the page 

curl -s -I -HHost:httpbin.example.com "http://localhost/status/200"

Let's say we're setting for only a single hostname, then may be best the use the following yaml (removing the host name. 


apiVersion: gateway.networking.k8s.io/v1beta1
kind: Gateway
metadata:
  name: gateway
  namespace: istio-system
spec:
  gatewayClassName: istio
  listeners:
  - name: httproute
    port: 80
    protocol: HTTP
    allowedRoutes:
      namespaces:
        from: All


apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: httpbin
spec:
  parentRefs:
  - name: httpbin-gateway
  #hostnames: ["httpbin.example.com"]
  rules:
  # - matches:
  #   - path:
  #       type: PathPrefix
  #       value: /status
  #   - path:
  #       type: PathPrefix
  #       value: /delay
    - backendRefs:
      - name: httpbin
        port: 8000




Comments

Popular posts from this blog

The specified initialization vector (IV) does not match the block size for this algorithm