This commit is contained in:
81
File/Yaml/ingress-values-loadbalancer.yaml
Normal file
81
File/Yaml/ingress-values-loadbalancer.yaml
Normal file
@@ -0,0 +1,81 @@
|
||||
# 未完成的 YAML 配置文件片段
|
||||
controller:
|
||||
# 开启监控
|
||||
metrics:
|
||||
enabled: true
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
|
||||
# 配置镜像加速
|
||||
image:
|
||||
registry: k8s.mirror.nju.edu.cn
|
||||
|
||||
# Pod 使用 DaemonSet 方式运行 Deployment 或 DaemonSet
|
||||
kind: Deployment
|
||||
# 副本数
|
||||
replicaCount: 2
|
||||
|
||||
# 只允许调度到具有 ingress="true" 的节点上,[ kubectl label node xxx ingress="true" ]
|
||||
nodeSelector:
|
||||
kubernetes.io/os: linux
|
||||
ingress: "true"
|
||||
|
||||
# 禁用后状态字段会报告 Ingress 控制器 Pod 所在节点的 IP 地址或节点列表的 IP 地址
|
||||
publishService:
|
||||
enabled: false
|
||||
|
||||
# 配置镜像加速
|
||||
admissionWebhooks:
|
||||
patch:
|
||||
image:
|
||||
registry: k8s.mirror.nju.edu.cn
|
||||
|
||||
# 设置为集群默认 ingress 控制器
|
||||
ingressClassResource:
|
||||
default: true
|
||||
|
||||
# 配置资源限制
|
||||
resources:
|
||||
requests:
|
||||
cpu: 200m
|
||||
memory: 256Mi
|
||||
limits:
|
||||
cpu: 1000m
|
||||
memory: 1Gi
|
||||
|
||||
# 配置 Pod 安全上下文
|
||||
podSecurityContext:
|
||||
fsGroup: 101
|
||||
runAsUser: 101
|
||||
|
||||
# 配置安全上下文
|
||||
containerSecurityContext:
|
||||
allowPrivilegeEscalation: false # 禁止特权提升
|
||||
capabilities:
|
||||
add: ["NET_BIND_SERVICE"]
|
||||
drop:
|
||||
- ALL # 去除所有能力
|
||||
runAsNonRoot: true # 以非 root 用户运行
|
||||
seccompProfile:
|
||||
type: RuntimeDefault # 启用默认系统调用过滤
|
||||
|
||||
service:
|
||||
type: LoadBalancer
|
||||
# 在这里指定你的浮动 IP
|
||||
loadBalancerIP: ""
|
||||
externalIPs:
|
||||
- ""
|
||||
# 根据你的环境,可能不需要额外的注解,或者可能需要设置特定的注解
|
||||
annotations:
|
||||
# 如果你的环境需要,可以添加以下注解(例如,使用 MetalLB)
|
||||
# metallb.universe.tf/address-pool: default
|
||||
# 或者,如果你使用 keepalived,可能需要以下注解来避免外部负载均衡器提供商尝试分配 IP
|
||||
# 例如,在 OpenStack 中,你可以指定使用 keepalived 的 IP
|
||||
# 注意:具体注解取决于你的环境和云提供商集成,如果没有特定的集成,可能不需要注解。
|
||||
# 对于裸机 keepalived,通常只需要指定 loadBalancerIP 即可。
|
||||
|
||||
# 其他服务配置,如端口
|
||||
ports:
|
||||
http: 80
|
||||
https: 443
|
||||
externalTrafficPolicy: Local
|
||||
Reference in New Issue
Block a user