当前位置:网站首页>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.
边栏推荐
- Leetcode daily practice (longest substring without repeated characters)
- The two trump brand products of Langjiu are resonating in Chengdu, continuously driving the consumption wave of bottled liquor
- SQL parsing practice of Pisa proxy
- Relation and operation of ORM table
- 正则匹配以什么开头、以什么结尾,以非什么开头,以非什么结尾
- The interview lasted for half a year. Last month, I successfully got Alibaba p7offer. It was all because I chewed the latest interview questions in 2020!
- 3.2 multiple condition judgment
- MySQL中符号@的作用
- About MySQL: the phenomenon and background of the problem
- QT audio playback upgrade (7)
猜你喜欢

Weekly snapshot of substrate technology 20220411

Source NAT address translation and server mapping web page configuration of firewall Foundation

LeetCode每日一练(无重复字符的最长子串)

Leetcode daily practice (longest substring without repeated characters)

The interview lasted for half a year. Last month, I successfully got Alibaba p7offer. It was all because I chewed the latest interview questions in 2020!
![[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth](/img/70/fa79ba38e28c41ed28bce2ec73cd79.png)
[Niuke's questions] nowcoder claims to have remembered all Fibonacci numbers between 1 and 100000. To test him, we gave him a random number N and asked him to say the nth Fibonacci number. If the nth

Leetcode daily practice (main elements)

10 minutes to master the installation steps of MySQL

Kubernetes基础自学系列 | Ingress API讲解

List转Table
随机推荐
LeetCode每日一练(无重复字符的最长子串)
About how vs2019c # establishes the login interface, the user name and password entered must match the records in the access database
锚文本大量丢失的问题
List to table
SQL parsing practice of Pisa proxy
EMQ helps Qingdao Yanbo build a smart water platform
等保2.0密码要求是什么?法律依据有哪些?
Yyds dry inventory brief chrome V8 engine garbage collection
Distributed session solution
The interview lasted for half a year. Last month, I successfully got Alibaba p7offer. It was all because I chewed the latest interview questions in 2020!
事务的四大特性
Redis Series 2: data persistence improves availability
LeetCode每日一练(主要元素)
A robot is located in the upper left corner of an M x n grid. The robot can only move down or right one step at a time. The robot attempts to reach the lower right corner of the grid. How many differe
跨域图像的衡量新方式Style relevance:论文解读和代码实战
Data center table reports realize customized statistics, overtime leave summary record sharing
一场分销裂变活动,不止是发发朋友圈这么简单!
Drawing for example study of flashcc
2022年中国音频市场年度综合分析
[pygame Games] ce jeu "eat Everything" est fantastique? Tu manges tout? (avec code source gratuit)