Skip to Content
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
For Enterprise
For Government
For Higher Ed
For Individuals
For Marketing
Explore Skills
Cloud Computing
Microsoft Azure
Amazon Web Services (AWS)
Google Cloud
Cloud Migration
Cloud Deployment
Cloud Platforms
Data Engineering
Data Warehouse
SQL
Apache Spark
Microsoft SQL Server
MySQL
Kafka
Data Lake
Streaming & Messaging
NoSQL Databases
Relational Databases
Data Science
Pandas
R
MATLAB
SAS
D3
Power BI
Tableau
Statistics
Exploratory Data Analysis
Data Visualization
AI & ML
Generative AI
Machine Learning
Artificial Intelligence (AI)
Deep Learning
Reinforcement Learning
Natural Language Processing
TensorFlow
Scikit-Learn
Hyperparameter Tuning
MLOps
Programming Languages
Java
JavaScript
Spring
Python
Go
C#
C++
C
Swift
Rust
Functional Programming
Software Architecture
Object-Oriented
Distributed Systems
Domain-Driven Design
Architectural Patterns
IT/Ops
Kubernetes
Docker
GitHub
Terraform
Continuous Delivery
Continuous Integration
Database Administration
Computer Networking
Operating Systems
IT Certifications
Security
Network Security
Application Security
Incident Response
Zero Trust Model
Disaster Recovery
Penetration Testing / Ethical Hacking
Governance
Malware
Security Architecture
Security Engineering
Security Certifications
Design
Web Design
Graphic Design
Interaction Design
Film & Video
User Experience (UX)
Design Process
Design Tools
Business
Agile
Project Management
Product Management
Marketing
Human Resources
Finance
Team Management
Business Strategy
Digital Transformation
Organizational Leadership
Soft Skills
Professional Communication
Emotional Intelligence
Presentation Skills
Innovation
Critical Thinking
Public Speaking
Collaboration
Personal Productivity
Confidence / Motivation
Features
All features
Verifiable skills
AI Academy
Courses
Certifications
Interactive learning
Live events
Superstreams
Answers
Insights reporting
Radar Blog
Buy Courses
Plans
Sign In
Try Now
O'Reilly Platform
book
Kubernetes即学即用(第二版)
by
Brendan Burns
,
Joe Beda
,
Kelsey Hightower
June 2021
Intermediate to advanced
300 pages
5h 4m
Chinese
China Electric Power Press Ltd.
Content preview from
Kubernetes即学即用(第二版)
Ingress
的
HTTP
负载均衡
|
117
8.4.4
改写路径
有些
Ingress
控制器实现支持改写路径(可选)。我们可以通过改写路径,修
改
HTTP
请求被重定向时的路径。一般改写路径需要通过
Ingress
对象的注释
指定,该对象指定的所有请求都生效。例如,如果使用
NGINX Ingress
控制器,
则可以指定注释
nginx.ingress.kubernetes.io/rewrite-target:
/.
。有时
候,这样做可以让无法处理子路径的上游服务正常工作。
很多实现不仅实现了改写路径,而且还支持使用正则表达式指定路径。例如,
NGINX
控制器可以使用正则表达式捕捉路径的一部分,然后在改写路径时使
用捕捉到的内容。具体的做法(以及使用哪种正则表达式变体)因实现而异。
然而,改写路径并不是万能的,而且还常常引发错误。许多
Web
应用程序
都假设可以通过绝对路径在应用程序内部实现链接。有可能应用程序托管在
/subpath
上,但它发出的请求的路径却是
/
。这会导致将用户重定向到
/app-
path
。这就很难判断,该链接究竟是应用程序的“内部”链接(这种情况下
应该改写为
/subpath/app-path
),还是到其他应用程序的链接。因此,在复
杂的应用程序中,我们最好还是避免使用子路径。
8.4.5
提供
TLS
在运行网站的时候,使用
TLS
和
HTTPS
来确保安全的做法越来越有必要。
Ingress
支持这种做法(大多数
Ingress
控制器也都支持)。
首先,用户需要使用
TLS
证书和密钥指定一个机密,内容大致如示例 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial
You might also like
PyTorch深度学习
Posts & Telecom Press, Vishnu Subramanian
Python数据分析
Posts & Telecom Press, Ivan Idris
Python贝叶斯分析(第2版)
Posts & Telecom Press, Osvaldo Martin
Python高级编程(第2版)
Posts & Telecom Press, Michał Jaworski, Tarek Ziadé
Publisher Resources
ISBN: 9787519856762