【发布时间】:2019-10-09 12:17:41
【问题描述】:
我想让我的 Nuxt.js with apollo-client 连接到我在 Kubernetes 上的内部 Apollo-Server。
我的带有 apollo-client 应用程序的 nuxtjs 通过 Traefik Ingress 公开,当我将我的 apollo-client URL 设置为 <service>.<namespace> 以指向我的内部 apollo-client 时,我收到以下错误消息在 Chrome 控制台上:
net::ERR_NAME_NOT_RESOLVED
我的 Apollo 服务器在端口 6666 上运行,但我的 服务在端口 443 上运行并针对端口 6666
阿波罗配置:
import { HttpLink } from 'apollo-link-http'
import { InMemoryCache } from 'apollo-cache-inmemory'
// Replace this with your project's endpoint
const GRAPHCMS_API = process.env.API
export default () => ({
link: new HttpLink({ uri: GRAPHCMS_API }),
cache: new InMemoryCache(),
defaultHttpLink: false
})
我的 API 变量:
API: "https://service.namespace.svc.cluster.local:443/gql",
【问题讨论】:
-
嗨,你能粘贴你的入口 yaml 吗?
标签: kubernetes apollo traefik apollo-client apollo-server