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

k8s network

minikue ssh到node上可以直接访问pod 和 service。 例如curl pod_ip 或者curl servcie_ip。


如果想在外面访问:

需要ingress

或者nodePort类型,curl $(minikube ip)

或者需要port-forward,curl $(minikube ip)

here’s a short explanation of the differences between ingress, NodePort, and port-forward in Kubernetes:

  • NodePort:
    • Opens a specific port on each node of the cluster.
    • A service is accessible externally via node’s IP address and the assigned port.
    • Typically used for simple external access without needing a dedicated load balancer or advanced routing rules.
  • Ingress:
    • An API object that manages external access to services in a cluster, typically HTTP/HTTPS.
    • Provides features such as path-based routing, SSL termination, and name-based virtual hosting.
    • Requires an Ingress Controller (e.g., NGINX, Traefik) to handle requests and route traffic internally.
  • Port-Forward:
    • Forwards traffic from a local machine to a specific Pod in the cluster.
    • Used primarily for local debugging, development, or testing scenarios—no need to expose the service to the outside world.
    • Not meant for broad user traffic; the developer manually runs “kubectl port-forward” to open that tunnel.

In summary:

  • Use NodePort when you want a simple way to expose your service on a fixed port across all nodes.
  • Use Ingress when you need advanced routing (e.g., host-based or path-based rules) and want a consolidated entry point for multiple services.
  • Use Port-Forward when you only need quick, local access to a Pod for debugging without using a public or external endpoint.

 

http://www.njgz.com.cn/news/406.html

相关文章:

  • hyprland初尝试
  • 正则表达式 更新常用则表达式-----loading
  • 幼儿园小班线段树
  • 树02
  • 深入ADC采样
  • 学习笔记:MySQL :eq_range_index_dive_limit参数
  • Python字符串知识点总结
  • SQL Server 2025年7月更新 - 修复 CVE-2025-49718 Microsoft SQL Server 信息泄露漏洞
  • 读书笔记:Oracle数据库内存结构:系统全局区(SGA)详解
  • 小飞标签
  • 服务器配置的精细化控制(3960)
  • TCP连接优化的实战经验(7340)
  • 家庭主妇人到中年的生活困境很难突破防
  • 中间件架构的优雅实现(0454)
  • 梦醒时分
  • Hyperlane框架最全教学(6165)
  • 并发处理能力的巅峰对决:异步编程的艺术(3501)
  • 实战项目:全栈在线群聊系统(7048)
  • HTTP响应处理的灵活设计(0782)
  • Rust异步Web框架性能突破之路(6359)
  • 服务器配置的精细化控制(7138)
  • 内存使用效率的终极对决:零拷贝技术的实战应用(0345)
  • 明源相关漏洞自查清单(2025)
  • TCP连接优化的实战经验(3513)
  • 异步编程在Web开发中的应用(3842)
  • Proxmox Backup Server 4.0 Beta - 开源企业级备份解决方案
  • Proxmox Mail Gateway 8.2 - 全面的开源邮件安全平台
  • 数控编程利器!Mastercam 2025 安装教程+汉化全流程解析
  • 阿里云AI安全护栏
  • 浅谈一类容量很大但重量很小的背包——2025.7.27 鲜花