检测到您已登录华为云国际站账号,为了您更好的体验,建议您访问国际站服务网站 https://www.huaweicloud.com/intl/zh-cn
不再显示此消息
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPSeccomp metadata: name: psp-seccomp spec: match: kinds: - apiGroups:
- apiGroups: [""] kinds: ["Pod"] parameters: hostNetwork: bool min: 80 max: 9000 符合策略实例的资源定义 示例中hostNetwork设置成了
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPSELinuxV2 metadata: name: psp-selinux-v2 spec: match: kinds: - apiGroups
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sRequiredProbes metadata: name: must-have-probes spec: match: kinds: - apiGroups
- apiGroups: [""] kinds: ["Pod"] parameters: forbiddenSysctls: # - "*" # * may be used to forbid all sysctls - kernel
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPFSGroup metadata: name: psp-fsgroup spec: match: kinds: - apiGroups:
apiGroups: [""] kinds: ["Namespace"] parameters: message: "All namespaces must have an `owner` label that points to your company
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sReplicaLimits metadata: name: replica-limits spec: match: kinds: - apiGroups
- apiGroups: [""] kinds: ["Pod"] parameters: cpu: "200m" memory: "1Gi" 符合策略实例的资源定义 CPU和内存的Request小于配置的最大值,符合策略实例。
apiGroups: [""] kinds: ["Pod"] namespaces: - "default" parameters: allowedCapabilities: ["something"] requiredDropCapabilities
- apiGroups: [""] kinds: ["Pod"] parameters: runAsUser: rule: MustRunAs # MustRunAsNonRoot # RunAsAny ranges
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPVolumeTypes metadata: name: psp-volume-types spec: match: kinds: - apiGroups
- apiGroups: ["extensions", "networking.k8s.io"] kinds: ["Ingress"] 符合策略实例的资源定义 ingress配置的hostname不是空白或通配符类型,符合策略实例。
服务网关 服务网关概述 网关实例 网关路由 网关证书 父主题: 服务网格
kinds: - apiGroups: [""] kinds: ["Pod"] parameters: ratio: "1" cpuRatio: "10" 符合策略实例的资源定义 cpu比例为4,内存比例为1,符合约束。
服务网格 网格管理 服务管理 灰度发布 流量治理 服务安全 服务网关 监控中心
match: kinds: - apiGroups: [""] kinds: ["Service"] parameters: message: "All services must have a `a8r.io/owner` and
kinds: - apiGroups: [""] kinds: ["Namespace"] parameters: labels: ["gatekeeper"] 改策略实例示例指定了使用“K8sRequiredLabels”策略定义并将执行策略的操作设置为
图1 服务网关 目前默认是基于Kubernetes Gateway API模型实现网关能力,如需要使用原Istio API (如 Gateway 和 VirtualService)能力请参考如何使用Istio API配置网关路由规则。 父主题: 服务网关
YAML设置参考如下(根据实际需求调整配置参数): apiVersion: v1 data: tls.crt: LS0== # base64后 tls.key: LS0== # base64后 kind: Secret metadata: name: httpbin-credential