修改和新增
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2025-12-23 01:53:01 +08:00
parent 89a07bc062
commit b44594def6
17 changed files with 922 additions and 110 deletions

View File

@@ -1,4 +1,6 @@
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv4.ip_forward = 1
vm.swappiness = 0
vm.swappiness = 0

View File

@@ -0,0 +1,67 @@
controller:
# 开启监控
metrics:
enabled: true
serviceMonitor:
enabled: false
# 配置镜像加速
image:
registry: k8s.mirror.nju.edu.cn
# 使用主机网络时,利用 Kubernetes 集群内的 DNS 解析服务
dnsPolicy: ClusterFirstWithHostNet
# 使用本地网络
hostNetwork: true
# Pod 使用 DaemonSet 方式运行 Deployment 或 DaemonSet
kind: DaemonSet
# 只允许调度到具有 ingress="true" 的节点上,[ kubectl label node xxx ingress="true" ]
nodeSelector:
kubernetes.io/os: linux
ingress: "true"
# 禁用后状态字段会报告 Ingress 控制器 Pod 所在节点的 IP 地址或节点列表的 IP 地址
publishService:
enabled: false
# 启用 Kubernetes Service
service:
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 # 启用默认系统调用过滤

View 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

View File

@@ -0,0 +1,33 @@
apiVersion: install.istio.io/v1alpha1
kind: IstioOperator
metadata:
namespace: istio-system
spec:
hub: docker.io/istio
tag: 1.28.1
components:
base:
enabled: true # Istio 基础组件
pilot:
enabled: true # Istio 控制平面(Istiod)
# 进出口流量启用
ingressGateways:
- name: istio-ingressgateway
enabled: true
egressGateways:
- name: istio-egressgateway
enabled: false
# Most default values come from the helm chart's values.yaml
# Below are the things that differ
values:
defaultRevision: "" # 控制 sidecar 注入的默认版本
global:
istioNamespace: istio-system # Istio 安装的命名空间
configValidation: true # 启用配置验证
gateways:
istio-ingressgateway: {}
istio-egressgateway: {}
ztunnel:
resourceName: ztunnel # 为 Ztunnel DaemonSet 指定名称