当前位置:网站首页>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.
边栏推荐
- 【多线程】线程通信调度、等待集 wait() 、notify()
- IDE Eval reset unlimited trial reset
- In the Alibaba cloud experiment, if the k8s forwards to port 3306 and the MySQL client is turned on, it will terminate abnormally. What is the reason?
- Leetcode daily practice (Yanghui triangle)
- 字节跳动埋点数据流建设与治理实践
- 跨域图像的衡量新方式Style relevance:论文解读和代码实战
- A large number of missing anchor text
- About MySQL: the phenomenon and background of the problem
- 等保三级密码复杂度是多少?多久更换一次?
- 3.2 multiple condition judgment
猜你喜欢

Annual comprehensive analysis of China's audio market in 2022

事务的四大特性

事件监听机制

3.1 simple condition judgment

Drawing for example study of flashcc
![[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

Bit.Store:熊市漫漫,稳定Staking产品或成主旋律

【牛客刷题】NowCoder号称自己已经记住了1-100000之间所有的斐波那契数。 为了考验他,我们随便出一个数n,让他说出第n个斐波那契数。如果第n个斐波那契大于6位则只取后6位。

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

EMQ 助力青岛研博建设智慧水务平台
随机推荐
A distribution fission activity is more than just a circle of friends!
印象深刻的问题
Source NAT address translation and server mapping web page configuration of firewall Foundation
Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)
一场分销裂变活动,不止是发发朋友圈这么简单!
Raspberry pie preliminary use
Handling of difficult and miscellaneous problems during the installation and configuration of qt5.5.1 desktop version (configuring arm compilation Kit)
If you want to use DMS to handle database permissions, can you only use Alibaba cloud ram accounts (Alibaba cloud RDS)
字节跳动埋点数据流建设与治理实践
跨域图像的衡量新方式Style relevance:论文解读和代码实战
Four characteristics of transactions
[pyGame games] this "eat everything" game is really wonderful? Eat them all? (with source code for free)
分布式Session解决方案
The time of localdatetime type (2019-11-19t15:16:17) is queried with the time range of Oracle
Detailed explanation of various GPIO input and output modes (push-pull, open drain, quasi bidirectional port)
C语言教师工作量管理系统
Leetcode daily practice (main elements)
ICML 2022 ぷ the latest fedformer of the Dharma Institute of Afghanistan ⻓ surpasses SOTA in the whole process of time series prediction
P. Simple application of a.r.a method in Siyuan (friendly testing)
Relation and operation of ORM table