惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
L
LangChain Blog
T
The Blog of Author Tim Ferriss
J
Java Code Geeks
Y
Y Combinator Blog
月光博客
月光博客
雷峰网
雷峰网
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
F
Fortinet All Blogs
A
About on SuperTechFans
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
P
Proofpoint News Feed
小众软件
小众软件
H
Help Net Security
Last Week in AI
Last Week in AI
B
Blog RSS Feed
宝玉的分享
宝玉的分享
N
Netflix TechBlog - Medium
博客园 - 叶小钗
The GitHub Blog
The GitHub Blog

博客园 - Morya

不当心升级到 redis 7.4 怎么回到 valkey8 使用 cert-manager 为 traefik 自动申请和续约 https 证书 traefik学习 k8s 1.28 安装配置 knative-serving v1.15.2 + cert-manager v1.16.1 ssh端口映射玩法 golang echo group 用法的微妙注意点 使用docker最小化部署Git CI环境 使用mailpopbox构建个人独享EmailServer Influx cli cheetsheet 通过php docker快速验证简单代码 run gitlab-runner in k8s K8S配置traefik ingressroutes支持TLS ucloud k8s部署traefik的forward-auth 使用nginx构建限频、限速、限并发的应用保护层 macos 更改罗技k810无线键盘的映射 - Morya - 博客园 C++11 thread condition_variable mutex 综合使用 goland scope pattern 设置 Go 1.11 Module 介绍 - Morya hustOJ 添加 golang 支持
通过k8s service代理外部服务
Morya · 2020-09-25 · via 博客园 - Morya

通过k8s service代理外部服务

参考文章:《https://www.cnblogs.com/kuku0223/p/10898068.html》

本文中,需要通过service代理外部已经部署的nsqd服务,将其直接映射到某个更方便代码中统一使用的唯一名称。

apiVersion: v1
kind: Service
metadata:
  name: the-nsqd
spec:
  ports:
    - port: 80
      targetPort: 4151

---

kind: Endpoints
apiVersion: v1
metadata:
  name: the-nsqd
  # namespace: default
subsets:
  - addresses:
      - ip: 10.0.0.1
      - ip: 10.0.0.2
      - ip: 10.0.0.3
      - ip: 10.0.0.4
    ports:
      - port: 4151

实际上,k8s据说还有另外一种service代理方式, ExternalName
但这种配置方式不支持IP作为终点,仅支持 dns名称。