当前位置:网站首页>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.
边栏推荐
- Yyds dry inventory solution sword finger offer: a path with a certain value in the binary tree (3)
- Open source 23 things shardingsphere and database mesh have to say
- Hierarchical clustering and case analysis
- Nemo of pulseaudio (22)
- Autodesk Navisworks 2022软件安装包下载及安装教程
- Qt5 signal and slot mechanism (demonstrate the correlation between the control's own signal and slot function)
- 3.3 one of the fixed number of cycles
- Oracle概念二
- Huawei cloud devcloud launched four new capabilities, setting two domestic firsts
- LeetCode每日一练(主要元素)
猜你喜欢

Event listening mechanism

Source NAT address translation and server mapping web page configuration of firewall Foundation
The role of the symbol @ in MySQL

Bit. Store: long bear market, stable stacking products may become the main theme

After the mobile phone, it was reported that Samsung also cut the output of TV and other home appliance product lines

鸿蒙发力!HDD杭州站·线下沙龙邀您共建生态

Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm

Hongmeng makes efforts! HDD Hangzhou station · offline salon invites you to build ecology

Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
Yyds dry inventory brief chrome V8 engine garbage collection
随机推荐
Smart wind power | Tupu software digital twin wind turbine equipment, 3D visual intelligent operation and maintenance
LeetCode每日一练(两数之和)
字节跳动埋点数据流建设与治理实践
实现简单的三D立方体自动旋转
【牛客刷题】NowCoder号称自己已经记住了1-100000之间所有的斐波那契数。 为了考验他,我们随便出一个数n,让他说出第n个斐波那契数。如果第n个斐波那契大于6位则只取后6位。
C language teacher workload management system
深耕数字化,引领云原生,服务更多开发者
Google Earth Engine(GEE)——Export. image. The difference and mixing of toasset/todrive, correctly export classification sample data to asset assets and references
Four characteristics of transactions
Redis Series 2: data persistence improves availability
P.A.R.A 方法在思源的简易应用(亲测好用)
Distributed session solution
一场分销裂变活动,不止是发发朋友圈这么简单!
Can polardb-x be accessed through the client of related tools as long as the client supporting JDBC / ODBC protocol is afraid?
Etcd visualization tool: kstone deployment (I), rapid deployment based on Helm
Bit.Store:熊市漫漫,稳定Staking产品或成主旋律
Raspberry pie preliminary use
tensorflow求解泊松方程
Adaoracle supports multi chain distributed Oracle with wide area node quotation
Huawei cloud devcloud launched four new capabilities, setting two domestic firsts