<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>流量管理 on Apache Dubbo</title><link>https://deploy-preview-3199--dubbo.netlify.app/zh-cn/overview/reference/pixiu/tasks/traffic/</link><description>Recent content in 流量管理 on Apache Dubbo</description><generator>Hugo</generator><language>zh-cn</language><atom:link href="https://deploy-preview-3199--dubbo.netlify.app/zh-cn/overview/reference/pixiu/tasks/traffic/index.xml" rel="self" type="application/rss+xml"/><item><title>HTTP</title><link>https://deploy-preview-3199--dubbo.netlify.app/zh-cn/overview/reference/pixiu/tasks/traffic/httpproxy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://deploy-preview-3199--dubbo.netlify.app/zh-cn/overview/reference/pixiu/tasks/traffic/httpproxy/</guid><description>&lt;p>本示例演示了如何使用 Pixiu Gateway 作为 HTTP 代理网关，接收外部的 HTTP 请求并转发到后端的 Dubbo-go RPC 服务。示例基于 &lt;code>dubbo-go-samples/helloworld&lt;/code> 中的 RPC 服务。&lt;/p>
&lt;h2 id="先决条件">先决条件&lt;/h2>
&lt;ul>
&lt;li>已安装 &lt;a href="https://deploy-preview-3199--dubbo.netlify.app/zh-cn/overview/reference/pixiu/install/">Pixiu Gateway&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="创建-rpc-服务">创建 RPC 服务&lt;/h2>
&lt;h3 id="创建服务">创建服务&lt;/h3>
&lt;p>首先创建 helloworld 服务：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl apply -f https://raw.githubusercontent.com/apache/dubbo-go-pixiu-samples/main/gateway/helloworld/deployment.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="验证服务">验证服务&lt;/h3>
&lt;p>检查服务是否正常运行：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl get pods -n helloworld
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kubectl get svc -n helloworld
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="创建-http-代理">创建 HTTP 代理&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl apply -f https://raw.githubusercontent.com/apache/dubbo-go-pixiu-samples/main/gateway/http/http.yaml
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="验证-http-代理">验证 HTTP 代理&lt;/h3>
&lt;p>检查所有资源的状态：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>kubectl get httproute -n default
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kubectl get pixiuclusterpolicy -n default
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kubectl get pixiufilterpolicy -n default
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>kubectl get gateway -n default
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="验证">验证&lt;/h2>
&lt;h3 id="获取网关地址">获取网关地址&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>NAME TYPE CLUSTER-IP EXTERNAL-IP PORT&lt;span style="color:#719e07">(&lt;/span>S&lt;span style="color:#719e07">)&lt;/span> AGE
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pixiu-3465d618 LoadBalancer 10.108.197.9 &amp;lt;pending&amp;gt; 80:32547/TCP 86m
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>pixiu-gateway ClusterIP 10.105.156.54 &amp;lt;none&amp;gt; 8080/TCP,8081/TCP 86m
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="发送-http-请求">发送 HTTP 请求&lt;/h3>
&lt;p>使用 curl 发送 HTTP 请求到 RPC 服务：&lt;/p></description></item></channel></rss>