kubernetes-yaml/description/Service/Ingress/description.yml

61 lines
1.9 KiB
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Ingress 说明,官方文档: https://v1-22.docs.kubernetes.io/zh/docs/concepts/services-networking/ingress
# API 版本
apiVersion: networking.k8s.io/v1
# 资源类型
kind: Ingress
# 元数据
metadata:
## 名称
name: 此 Ingress 的名称
## 命名空间
namespace: 此 Ingress 所属命名空间
## 标签
labels:
标签名1: 标签值1
标签名2: 标签值2
## 注解(使用不同的控制器时注解不同,具体见官方文档)
annotations:
nginx.ingress.kubernetes.io/rewrite-target: /
# 内容
spec:
## TLS 证书
tls:
### TLS 证书1
#### 该 TLS 证书对应的 HOST需要和 rules 中配置的 host 保持一致)
- hosts:
- host1
- host2
#### 该 TLS 证书使用的 Secret 名称
secretName: 该 TLS 证书使用的 Secret 名称
## 规则
rules:
### 规则1
#### HOST
- host: HOST
#### HTTP 规则
http:
##### 路径
paths:
###### 路径1
####### 路径
- path: 路径
####### 路径类型【ImplementationSpecific视 IngressClass 而定Prefix前缀匹配Exact精确匹配】
pathType: 路径类型
####### 后端
backend:
######## Service 类型(常用于后端服务,不能和 Resource 类型同时配置)
service:
######### Service 的名称
name: Service 的名称
######### Service 的端口号
port:
number: Service 的端口号
######## Resource 类型(常用于前端静态资源服务,不能和 Service 类型同时配置)
resource:
#########
apiGroup: k8s.example.com
######### 资源类型
kind: StorageBucket
######### 资源名称
name: icon-assets