ywxzm03 opened a new pull request, #149:
URL: https://github.com/apache/dubbo-go-pixiu-samples/pull/149
**What this PR does**:
This PR fixes the reproducibility issue caused by the floating `master`
image tag in the `gateway` sample, as well as the missing authorization for the
cross-namespace backend reference:
- Updates the helloworld backend image in
`gateway/helloworld/deployment.yaml` from the floating tag
`dubbogopixiu/helloworld-go-server:master` to a fixed image digest, so the
sample result is no longer affected by `master` tag drift.
- Adds a `ReferenceGrant` in `gateway/helloworld/deployment.yaml` to allow
the `HTTPRoute` in the `default` namespace to reference the `dubbo-go-server`
Service in the `helloworld` namespace, completing the authorization required by
Gateway API for cross-namespace `backendRef`.
- Keeps the sample reference graph closed:
- `HTTPRoute` -> `Gateway default/pixiu`
- `HTTPRoute` -> `Service helloworld/dubbo-go-server`
- `ReferenceGrant` -> authorizes the cross-namespace Service reference
above
- `PixiuClusterPolicy` / `PixiuFilterPolicy` -> `Gateway default/pixiu`
- `PixiuFilterPolicy` -> `helloworld-dubbo-go-server` cluster
- Verified locally with minikube that the sample resources can be accepted
by Kubernetes, the Pixiu controller can create the data plane Pod, and requests
can be forwarded through Pixiu to the helloworld backend.
```bash
# Verification commands
kubectl apply --server-side -f
https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.5.0/standard-install.yaml
kubectl apply -k
'https://github.com/apache/dubbo-go-pixiu/controllers/config/crd?ref=develop'
kubectl apply -f gateway/k8s/pixiu-gateway.yaml
kubectl apply -f gateway/helloworld/deployment.yaml
kubectl apply -f gateway/http/http.yaml
kubectl get pods -A
kubectl get httproute -n default
kubectl get referencegrant -n helloworld
# Request verification
kubectl port-forward -n default pod/<pixiu-pod-name> 8888:8888
curl -v \
-H 'Content-Type: application/json' \
--data '{"name":"Dubbo"}' \
http://127.0.0.1:8888/greet.GreetService/Greet
# Response
{"greeting":"Dubbo"}
```
Fixes #146
**Does this PR introduce a user-facing change?**
```release-note
NONE
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]