我需要在 azure k8s 上配置 Ingress Nginx,我的问题是是否可以在一个命名空间等中配置 Ingress。ingress-nginx 和其他命名空间中的一些服务,例如。资源?我的文件看起来像这样:
# ingress-nginx.yaml
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-ingress-controller
namespace: ingress-nginx
spec:
replicas: 3
selector:
matchLabels:
app: ingress-nginx
template:
metadata:
labels:
app: ingress-nginx
annotations:
prometheus.io/port: '10254'
prometheus.io/scrape: 'true'
spec:
containers:
- name: nginx-ingress-controller
image: quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.12.0
args:
- /nginx-ingress-controller
- --default-backend-service=$(POD_NAMESPACE)/default-http-backend
- --configmap=$(POD_NAMESPACE)/nginx-configuration
- --tcp-services-configmap=$(POD_NAMESPACE)/tcp-services
- --udp-services-configmap=$(POD_NAMESPACE)/udp-services
- --annotations-prefix=nginx.ingress.kubernetes.io
- --publish-service=$(POD_NAMESPACE)/ingress-nginx
env:
- name: POD_NAME
valueFrom:
fieldRef:
fieldPath: metadata.name
- name: POD_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
ports:
- name: http
containerPort: 80
- …Run Code Online (Sandbox Code Playgroud) 有人可以提供使用 Apollo Client 3.0 字段策略实现分页的示例吗?我一直在遵循文档中的示例来实现无限滚动,但在我的控制台中我收到以下警告:
fetchMore 的 updateQuery 回调已弃用,并将在 Apollo Client 的下一个主要版本中删除。
请将 updateQuery 函数转换为具有适当读取和合并函数的字段策略,或使用/改编 @apollo/client/utilities 中的辅助函数(例如 concatPagination、offsetLimitPagination 或 relayStylePagination)。
字段策略系统比手写的 updateQuery 函数更有效地处理分页,并且您只需要定义一次策略,而不是每次调用 fetchMore 时。
所以我尝试用新的 Apollo 方法来实现分页
列表组件.ts
// getOffers() 在 OnInit() 中运行
getOffers(): void {
this.searchService.search
.pipe(
tap(() => {
this.spinnerService.showLoader();
}),
switchMap((term) => {
this.lookupTerm = term;
return this.offersGQL.watch({
phrase: term,
offset: this.pageOffset,
limit: this.pageSize
}, { fetchPolicy: 'network-only' })
.valueChanges
.pipe(
retry(40),
map((result) => result.data),
tap(() => {
this.spinnerService.hideLoader();
})
)
}
)
)
.subscribe((result) => …Run Code Online (Sandbox Code Playgroud)