실습
Introduction
helm install eg oci://docker.io/envoyproxy/gateway-helm \ --version v1.0.1 \ --namespace envoy-gateway-system \ --create-namespacekubectl get all -n envoy-gateway-systemkubectl get cm -n envoy-gateway-system envoy-gateway-config -o yamlkubectl get gatewayclass -Acat <<EOF | kubectl apply -f - apiVersion: gateway.envoyproxy.io/v1alpha1 kind: EnvoyProxy metadata: name: custom-proxy-config namespace: envoy-gateway-system spec: provider: type: Kubernetes kubernetes: envoyService: annotations: service.beta.kubernetes.io/aws-load-balancer-type: external service.beta.kubernetes.io/aws-load-balancer-nlb-target-type: ip service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing EOFcat <<EOF | kubectl apply -f - apiVersion: gateway.networking.k8s.io/v1 kind: GatewayClass metadata: name: eg spec: controllerName: gateway.envoyproxy.io/gatewayclass-controller parametersRef: group: gateway.envoyproxy.io kind: EnvoyProxy namespace: envoy-gateway-system name: custom-proxy-config EOFcat <<EOF | kubectl apply -f - apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: eg spec: gatewayClassName: eg listeners: - name: http protocol: HTTP port: 80 EOFkubectl get gateway egkubectl get all -n envoy-gateway-systemcurl $(kubectl get gateway eg -o=jsonpath='{.status.addresses[0].value}') -v{ kubectl create deployment nginx --image=nginx --port=80 kubectl expose deploy nginx }cat <<EOF | kubectl apply -f - apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: nginx spec: parentRefs: - name: eg rules: - backendRefs: - name: nginx port: 80 EOFkubectl describe httproute nginxcurl $(kubectl get gateway eg -o=jsonpath='{.status.addresses[0].value}')cat <<EOF | kubectl apply -f - apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute metadata: name: nginx spec: parentRefs: - name: eg hostnames: - nginx.example.com rules: - backendRefs: - name: nginx port: 80 EOFcurl $(kubectl get gateway eg -o=jsonpath='{.status.addresses[0].value}') -vcurl -H "Host: nginx.example.com" \ $(kubectl get gateway eg -o=jsonpath='{.status.addresses[0].value}'){ kubectl delete httproute nginx kubectl delete svc nginx kubectl delete deploy nginx kubectl delete gateway eg kubectl delete gatewayclass eg kubectl delete envoyproxy custom-proxy-config -n envoy-gateway-system }kubectl get all -n envoy-gateway-system
Last updated