Note to quickly deploy Envoy Gateway for experiment on a Mac using Colima (or a Linux)
# clean up colima install BEWARE!! older version of colima sometimes are failing
rm -rf ~/.colima ~/.lima
# start colima with kubernetes option and disable Traefik
colima start --kubernetes --kubernetes-disable=traefik --arch aarch64 --vm-type=vz --vz-rosetta --cpu 2 --memory 4
# install using yaml
kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/v0.6.0-rc.1/install.yaml -n envoy-gateway-system
# or install using helm
helm install eg oci://docker.io/envoyproxy/gateway-helm --version v0.6.0-rc.1 -n envoy-gateway-system --create-namespace
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: eg
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
---
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: eg
spec:
gatewayClassName: eg
listeners:
- name: http
protocol: HTTP
port: 80
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: backend
---
apiVersion: v1
kind: Service
metadata:
name: backend
labels:
app: backend
service: backend
spec:
ports:
- name: http
port: 3000
targetPort: 3000
selector:
app: backend
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
spec:
replicas: 1
selector:
matchLabels:
app: backend
version: v1
template:
metadata:
labels:
app: backend
version: v1
spec:
serviceAccountName: backend
containers:
- image: gcr.io/k8s-staging-ingressconformance/echoserver:v20221109-7ee2f3e
imagePullPolicy: IfNotPresent
name: backend
ports:
- containerPort: 3000
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: backend
spec:
parentRefs:
- name: eg
hostnames:
- "www.example.com"
rules:
- backendRefs:
- group: ""
kind: Service
name: backend
port: 3000
weight: 1
matches:
- path:
type: PathPrefix
value: /
kubectl apply -f https://github.com/envoyproxy/gateway/releases/download/v0.6.0-rc.1/quickstart.yaml -n default
# service lb is opening 80 by default
curl --verbose --header "Host: www.example.com" http://localhost/get