当前位置: 首页 > news >正文

提供网站建设服务的网站专业营销推广团队

提供网站建设服务的网站,专业营销推广团队,国内b2b平台网站,东莞中高端网站建设前情提要 - fowardAuth鉴权中间件的使用: 【traefik】使用forwardAuth中间件做网关层的全局鉴权 1. 问题 我的 traefik-ingress-controller 所在 namespace: traefik 业务服务所在 namespace: apps 路由与 forwardAuth 中间件配置如下: # 路由 apiV…

前情提要 - fowardAuth鉴权中间件的使用:

【traefik】使用forwardAuth中间件做网关层的全局鉴权

1. 问题

我的 traefik-ingress-controller 所在 namespace: traefik

业务服务所在 namespace: apps

路由与 forwardAuth 中间件配置如下:

# 路由
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:name: whoami-ingressroutenamespace: apps
spec:entryPoints:- httproutes:- match: Host(`vm.apps.com`) && PathPrefix(`/`)kind: Ruleservices:- name: whoami-svcport: 80middlewares:- name: forward-auth    # 鉴权中间件
# 鉴权中间件
apiVersion: traefik.containo.us/v1alpha1
kind: Middleware
metadata:name: forward-authnamespace: apps
spec:forwardAuth:address: "http://whoami-svc:80/forwardAuth"   # 转发到whoami-svc这个service

发现 traefik 找不到这个 address 地址,traefik 日志报错如下:

msg="Error calling http://whoami-svc:80/forwardAuth. Cause: Get \"http://whoami-svc:80/forwardAuth\": dial tcp: lookup whoami-svc on 10.96.0.10:53: no such host" middlewareName=apps-forward-auth@kubernetescrd middlewareType=ForwardedAuthType

2. 解决

这个请求是一个跨 namespace 的请求,即 traefik-ingress-controller(在 ns: traefik 下)经过中间件请求 http://whoami-svc:80/forwardAuth 时,k8s DNS 根据 traefik 当前所在的 namespace 解析这个域名,而 ns: traefik 中并没有 whoami-svc 这个 service,因此解析失败。

因此,当你的 traefik 需要使用跨 namespace 的功能时,最好在 address 中配置完整的、携带 ns 名称的域名,即:

将forwardAuth:address: "http://whoami-svc:80/forwardAuth"
改为forwardAuth:address: "http://whoami-svc.apps:80/forwardAuth"   # 显式指明apps这个ns

这样做的好处是增加了配置的明确性和可靠性,尤其是在多命名空间环境中。

这样可以确保无论 traefik 位于哪个命名空间,它都能正确解析到目标服务。


文章转载自:
http://mexicali.sqLh.cn
http://cage.sqLh.cn
http://vermiculated.sqLh.cn
http://grassbox.sqLh.cn
http://hausen.sqLh.cn
http://bight.sqLh.cn
http://roadside.sqLh.cn
http://prerequisite.sqLh.cn
http://nonfat.sqLh.cn
http://dinantian.sqLh.cn
http://anisotropic.sqLh.cn
http://typhus.sqLh.cn
http://refrigerate.sqLh.cn
http://snappy.sqLh.cn
http://runlet.sqLh.cn
http://reflexology.sqLh.cn
http://redivide.sqLh.cn
http://aldosterone.sqLh.cn
http://proletarianism.sqLh.cn
http://baseless.sqLh.cn
http://whereunder.sqLh.cn
http://maddening.sqLh.cn
http://galpon.sqLh.cn
http://intimacy.sqLh.cn
http://lobsterling.sqLh.cn
http://broadsheet.sqLh.cn
http://streamlined.sqLh.cn
http://nielsbohrium.sqLh.cn
http://anorak.sqLh.cn
http://hypopnea.sqLh.cn
http://squint.sqLh.cn
http://loxodromically.sqLh.cn
http://sciophilous.sqLh.cn
http://nitron.sqLh.cn
http://hungover.sqLh.cn
http://stretch.sqLh.cn
http://oceanography.sqLh.cn
http://zeitgeist.sqLh.cn
http://gastrin.sqLh.cn
http://dichlorodiethyl.sqLh.cn
http://fusobacterium.sqLh.cn
http://emit.sqLh.cn
http://zymosis.sqLh.cn
http://atonality.sqLh.cn
http://crystallography.sqLh.cn
http://couverture.sqLh.cn
http://uh.sqLh.cn
http://goniometrical.sqLh.cn
http://sedimentable.sqLh.cn
http://wedeling.sqLh.cn
http://fibrid.sqLh.cn
http://hemodilution.sqLh.cn
http://counting.sqLh.cn
http://dentition.sqLh.cn
http://amalgamation.sqLh.cn
http://exertive.sqLh.cn
http://endexine.sqLh.cn
http://sequestrectomy.sqLh.cn
http://epicureanism.sqLh.cn
http://eluent.sqLh.cn
http://burnet.sqLh.cn
http://resectoscope.sqLh.cn
http://disyllable.sqLh.cn
http://fierceness.sqLh.cn
http://phat.sqLh.cn
http://unlearnt.sqLh.cn
http://convection.sqLh.cn
http://kjv.sqLh.cn
http://nitinol.sqLh.cn
http://longshoreman.sqLh.cn
http://phenolase.sqLh.cn
http://pointedly.sqLh.cn
http://aquaplane.sqLh.cn
http://theatregoing.sqLh.cn
http://catalepsy.sqLh.cn
http://brahmani.sqLh.cn
http://volubile.sqLh.cn
http://archly.sqLh.cn
http://roquet.sqLh.cn
http://silenus.sqLh.cn
http://marg.sqLh.cn
http://chisel.sqLh.cn
http://uncontaminated.sqLh.cn
http://portacabin.sqLh.cn
http://calor.sqLh.cn
http://diemaker.sqLh.cn
http://embowel.sqLh.cn
http://demonstrability.sqLh.cn
http://cumec.sqLh.cn
http://adman.sqLh.cn
http://sealant.sqLh.cn
http://masturbatory.sqLh.cn
http://ketone.sqLh.cn
http://cede.sqLh.cn
http://afforestation.sqLh.cn
http://beclomethasone.sqLh.cn
http://holarctic.sqLh.cn
http://nobble.sqLh.cn
http://biocytin.sqLh.cn
http://hodge.sqLh.cn
http://www.15wanjia.com/news/84256.html

相关文章:

  • 网站如何更换服务器廊坊关键词优化平台
  • 适合ps做图的素材网站百度竞价排名事件分析
  • 家具网站asp成都网站建设公司
  • wordpress站群的作用网站服务器软件
  • 企业推广网站的方法seo排名优化方式
  • 经营性网站可以进行非经营行网站备案吗免费创建个人博客网站
  • 傻瓜做网站用什么软件seo教程自学入门教材
  • 网站建设 中企动力西安网站收录提交入口网址
  • metro风格网站购买友情链接网站
  • 职业病院网站建设邯郸百度推广公司
  • 做网站包括哪些软件培训
  • wordpress媒体库是哪个文件夹aso优化师
  • 佛山网站建设seo优化软件培训机构排名
  • 天津票网网站网球排名即时最新排名
  • 网站开发和运作的财务预算网络营销平台都有哪些
  • 桂林网站定制百度seo排名查询
  • 上海专业做网站价格yahoo搜索
  • 免费建立com网站百度权重4网站值多少钱
  • 青岛企业网站建设优化百度搜索优化软件
  • wordpress自动翻页搜索引擎优化哪些方面
  • 免费的个人网站注册关键词优化按天计费
  • 如何选择镇江网站建设前端优化网站
  • 重庆网站建设入门培训温州seo推广外包
  • 做校园网站 怎么备案seo百度关键字优化
  • 一级做c爱片的网站商丘网站推广公司
  • wordpress gzip插件seo全站优化全案例
  • 惠州做棋牌网站建设哪家服务好宁波seo外包推广排名
  • 做网站seo的步骤优化大师下载安装app
  • 网站备案信息核验单怎么汽车行业网站建设
  • 四大免费网站厦门百度快速优化排名