当前位置:网站首页>Kubernetes basic self-study series | introduction to ingress API
Kubernetes basic self-study series | introduction to ingress API
2022-06-27 16:37:00 【51CTO】
Video source :B standing 《2021 At the end of the year, strive to build Kubernetes Introduction to mastery - 2022 Happy appetizer of the year 》
Organize the teacher's course content and test notes while studying , And share it with you , Infringement is deleted , Thank you for your support !
Information
Ingress-Nginx github Address :
https://github.com/kubernetes/ingress-nginx
Ingress-Nginx Official website :
https://kubernetes.github.io/ingress-nginx/


Deploy Ingress-Nginx
Ingress HTTP Agent access
deployment、Service、Ingress Yaml file
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-dm
spec:
replicas: 2
template:
metadata:
labels:
name: nginx
spec:
containers:
- name: nginx
image: wangyanglinux/myapp:v1
imagePullPolicy: IfNotPresent
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-svc
spec:
ports:
- port: 80
targetPort: 80
protocol: TCP
selector:
name: nginx
---
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: nginx-test
spec:
rules:
- host: www1.hongfu.com
http:
paths:
- path: /
backend:
serviceName: nginx-svc
servicePort: 80
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
Ingress HTTPS Agent access
Create certificate , as well as cert storage
deployment、Service、Ingress Yaml file
Nginx Conduct BasicAuth
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: auth.hongfu.com
annotations:
nginx.ingress.kubernetes.io/auth-type: basic
nginx.ingress.kubernetes.io/auth-secret: basic-auth
nginx.ingress.kubernetes.io/auth-realm: 'Authentication Required - foo'
spec:
rules:
- host: auth.hongfu.com
http:
paths:
- path: /
backend:
serviceName: nginx-svc
servicePort: 80
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
Nginx Rewrite
name | describe | value |
nginx.ingress.kubernetes.io/rewrite-target | The destination of the traffic must be redirected URI | strand |
nginx.ingress.kubernetes.io/ssl-redirect | Indicates whether the location section is accessible only SSL( When Ingress When the certificate is included, it defaults to True) | Boolean |
nginx.ingress.kubernetes.io/force-ssl-redirect | Even if Ingress not enabled TLS, Also force redirection to HTTPS | Boolean |
nginx.ingress.kubernetes.io/app-root | Definition Controller Application root that must be redirected , If it's in '/' In the context of | strand |
nginx.ingress.kubernetes.io/use-regex | instructions Ingress Whether the path defined on uses a regular expression | Boolean |
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
name: rew.hongfu.com
annotations:
nginx.ingress.kubernetes.io/rewrite-target: https://www.baidu.com
spec:
rules:
- host: rew.hongfu.com
http:
paths:
- path: /
backend:
serviceName: nginx-svc
servicePort: 80
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
边栏推荐
- A distribution fission activity is more than just a circle of friends!
- 正则匹配以什么开头、以什么结尾,以非什么开头,以非什么结尾
- Use redis to automatically cancel orders within 30 minutes
- 事务的四大特性
- List to table
- Pragma once Usage Summary
- 跨域图像的衡量新方式Style relevance:论文解读和代码实战
- 【Pygame小遊戲】這款“吃掉一切”遊戲簡直奇葩了?通通都吃掉嘛?(附源碼免費領)
- Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)
- 基于 Nebula Graph 构建百亿关系知识图谱实践
猜你喜欢

A distribution fission activity is more than just a circle of friends!

数据中心表格报表实现定制统计加班请假汇总记录分享

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing

Jialichuang EDA professional edition all offline client release

Introduce you to ldbc SNB, a powerful tool for database performance and scenario testing

Weekly snapshot of substrate technology 20220411

Cesium realizes satellite orbit detour

Distributed session solution

域名绑定动态IP最佳实践

树莓派初步使用
随机推荐
If you want to use DMS to handle database permissions, can you only use Alibaba cloud ram accounts (Alibaba cloud RDS)
ORM表关系及操作
Kubernetes基础自学系列 | Ingress API讲解
Redis Series 2: data persistence improves availability
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
List to table
C語言教師工作量管理系統
Leetcode daily practice (sum of two numbers)
Annual comprehensive analysis of China's audio market in 2022
10 minutes to master the installation steps of MySQL
Four characteristics of transactions
IDE Eval reset unlimited trial reset
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
Hierarchical clustering and case analysis
3.2 multiple condition judgment
EMQ 助力青岛研博建设智慧水务平台
事务的隔离级别详解
Qt5 signal and slot mechanism (demonstrate the correlation between the control's own signal and slot function)
P.A.R.A 方法在思源的简易应用(亲测好用)
Mode setting of pulseaudio (21)