-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #56 from DreamPWJ/develop
Develop
- Loading branch information
Showing
15 changed files
with
313 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
_k8s/letsencrypt/backup/cert-manager-ingress-lanneng-open-park-third-party.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
# Author: 潘维吉 | ||
# Description: 云原生K8S中使用cert-manager基于 ACME 协议与 Let's Encrypt 自动签发与续签免费的SSL证书 | ||
|
||
# 创建一个集群级的签发机构 仅需一次 | ||
apiVersion: cert-manager.io/v1 | ||
kind: ClusterIssuer | ||
metadata: | ||
name: letsencrypt-prod-lanneng-open-park-third-party | ||
namespace: cert-manager | ||
spec: | ||
acme: | ||
server: https://acme-v02.api.letsencrypt.org/directory # ACME 协议的服务端 acme-staging-v02测试证书没有限制 | ||
email: 406798106@qq.com # 证书快过期的时候会有邮件提醒 | ||
privateKeySecretRef: | ||
name: letsencrypt-prod-key-lanneng-open-park-third-party # 私钥秘密必须与cert-manager服务在同一个命名空间中才能工作 kubectl delete Secret letsencrypt-prod-key --namespace cert-manager | ||
solvers: | ||
- http01: # 签发机构使用 HTTP-01 的方式进行 acme 协议 (还可用 DNS 方式,acme 协议的目的是证明机器和域名都是属于你的,然后才准许颁发证书) | ||
ingress: | ||
#serviceType: ClusterIP | ||
name: lannengtech-k8s-ingress-lanneng-open-park-third-party # 这个匹配是关键!!! 1. class是指定自动创建的 Ingress 的 ingress class 2. name是指定被自动修改的 Ingress 名称 | ||
|
||
--- | ||
|
||
apiVersion: networking.k8s.io/v1 | ||
kind: Ingress | ||
metadata: | ||
name: lannengtech-k8s-ingress-lanneng-open-park-third-party | ||
namespace: default | ||
annotations: | ||
# 指定使用nginx做代理 | ||
#kubernetes.io/ingress.class: lanneng-park # 已弃用 使用 spec.ingressClassName代替 | ||
# add an annotation indicating the issuer to use | ||
cert-manager.io/cluster-issuer: letsencrypt-prod-lanneng-open-park-third-party | ||
acme.cert-manager.io/http01-edit-in-place: "true" | ||
|
||
# 后端大文件上传大小 | ||
nginx.ingress.kubernetes.io/client-body-buffer-size: 1024m | ||
nginx.ingress.kubernetes.io/proxy-max-temp-file-size: 2048m | ||
# 数据传输大小 | ||
nginx.ingress.kubernetes.io/proxy-body-size: 1024m | ||
|
||
# 开启CORS跨域请求 | ||
nginx.ingress.kubernetes.io/enable-cors: "true" | ||
nginx.ingress.kubernetes.io/cors-allow-origin: "*" | ||
nginx.ingress.kubernetes.io/cors-max-age: "64800" | ||
nginx.ingress.kubernetes.io/cors-allow-methods: "PUT, GET, POST, DELETE, PATCH, OPTIONS" | ||
nginx.ingress.kubernetes.io/cors-allow-credentials: "true" | ||
|
||
# 配置是否同时支持http和https访问应用 | ||
nginx.ingress.kubernetes.io/ssl-redirect: "false" | ||
|
||
# 采用了 “漏斗” 算法实现限流 保证服务可用性和被攻击 nginx的限流是一个队列模型。限流连接数为 队列长度+队列处理能力 | ||
# 每个IP每秒可以访问的次数 默认乘数为5 | ||
nginx.ingress.kubernetes.io/limit-rps: "50" | ||
# 为计算限速漏桶算法的 burst size和 limit-rps 的相乘放大系数 burst为队列长度 | ||
nginx.ingress.kubernetes.io/limit-burst-multiplier: "10" | ||
# 配合 limit-window 表示每多少秒全局限速多少次(需要依赖 memcached) | ||
nginx.ingress.kubernetes.io/global-rate-limit: "100000" | ||
nginx.ingress.kubernetes.io/global-rate-limit-window: 1s | ||
# 限制发送给后端服务的发送速率为 多少MB/每秒 rate为队列处理能力 | ||
#nginx.ingress.kubernetes.io/limit-rate: 10240 | ||
# 发送给后端服务的前 多少MB 数据不进行限速 | ||
#nginx.ingress.kubernetes.io/limit-rate-after: 102400 | ||
# 白名单 客户端IP源范围要从速率限制中排除。该值是逗号分隔的CIDR列表 | ||
#nginx.ingress.kubernetes.io/limit-whitelist: | ||
# 限流超出后的响应码 | ||
nginx.ingress.kubernetes.io/configuration-snippet: | | ||
limit_req_status 429; | ||
spec: | ||
ingressClassName: lanneng-park | ||
tls: | ||
- hosts: | ||
- park-foreign-api.pengbocloud.com | ||
secretName: park-foreign-api.pengbocloud.com-tls | ||
|
||
rules: | ||
#自定义域名 | ||
- host: park-foreign-api.pengbocloud.com | ||
http: | ||
paths: | ||
- path: / | ||
backend: | ||
#服务名称 | ||
service: | ||
name: park-saas-foreign-python-service | ||
#服务端口 | ||
port: | ||
number: 8201 | ||
pathType: Prefix |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.