kubernetes - 从我的前端 React 应用程序访问我在启用了 istio 的集群中部署的 python graphql 应用程序
问题描述
我有一个示例反应应用程序,它查询 Graphql Python 应用程序以在屏幕上打印硬编码的员工姓名列表。我已经将这两个应用程序部署在一个集群和一个启用了 istio 的命名空间上。
目前,我正在通过我的 React 应用程序中的外部负载均衡器访问 graphql python 应用程序。像这样 -
const cache = new InMemoryCache();
const link = new HttpLink({
uri: "http://**<<<External-ELB>>**:5555/graphql"
})
//appolo client setup
const client = new ApolloClient({
cache,
link
})
class App extends Component{
render(){
return(
<ApolloProvider client={client}>
<div className="main">
<h1> Employee Data List</h1>
<Routes />
</div>
</ApolloProvider>
);
}
}
我已经尝试为我的应用程序创建一个虚拟服务并添加istio-ingress-gateway ELB 代替External-ELB,这工作正常,但我仍然可以通过浏览器访问我的 graphql 应用程序,这是我想避免的。
有没有办法用 Istio 特使代理来处理这个问题?
我只想用 Istio-Ingress-ELB 公开我的前端并在不公开的情况下访问我的后端应用程序。现在,如何访问我的 python 应用程序而不将其公开为负载均衡器?
提前致谢。
解决方案
推荐阅读
- javascript - API 和接口(对象类型)如何可供 JavaScript 使用?
- javascript - 将参数传递到 URL
- java - Java:ImageIcon - 图像文件更新,但 Java 框架中的图像图标没有
- android - 步进器内的日期选择器
- laravel - 通过回答安全问题手动重置密码而不发送电子邮件 - Laravel/auth
- r - 如何在ggplot lineplot中为具有相似颜色的多个子类着色?
- date - Applescript:通过添加具有奇怪行为的天数来增加月份
- c# - 使用 SQL Server CE 数据库部署 .exe 时遇到问题
- json - 如何在命令行上打印 JSON,但允许无效的 JSON 对象通过?
- python - python:在熊猫数据框中排列