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"] parameters: allowedFlexVolumes: #[] - driver: "example/lvm" - driver: "example/cifs" 符合策略实例的资源定义
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPAppArmor metadata: name: psp-apparmor spec: match: kinds: - apiGroups
apiGroups: [""] kinds: ["Pod"] namespaces: - "default" parameters: allowedCapabilities: ["something"] requiredDropCapabilities
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
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,符合约束。
- apiGroups: [""] resources: ["pods"] # 可以访问pod verbs: ["get", "list"] # 可以执行GET、LIST操作 apiGroups
- apiGroups: [""] kinds: ["Pod"] parameters: runAsUser: rule: MustRunAs # MustRunAsNonRoot # RunAsAny ranges
服务网关 服务网关概述 网关实例 网关路由 网关证书 父主题: 服务网格
服务网格 网格管理 服务管理 灰度发布 流量治理 服务安全 服务网关 监控中心
match: kinds: - apiGroups: [""] kinds: ["Service"] parameters: message: "All services must have a `a8r.io/owner` and
kinds: - apiGroups: [""] kinds: ["Namespace"] parameters: labels: ["gatekeeper"] 改策略实例示例指定了使用“K8sRequiredLabels”策略定义并将执行策略的操作设置为
YAML设置参考如下(根据实际需求调整配置参数): apiVersion: v1 data: tls.crt: LS0== # base64后 tls.key: LS0== # base64后 kind: Secret metadata: name: httpbin-credential
在801端口上创建负载均衡器,用于接收HTTP连接,只处理HTTP协议的流量(根据实际需求调整配置参数): apiVersion: gateway.networking.k8s.io/v1beta1 kind: Gateway metadata: annotations:
kind: ClusterRole metadata: name: ucs-user-role rules: - apiGroups: - '*' resources: - '*' verbs: - '*' - nonResourceURLs: - '*
您即将访问非华为云网站,请注意账号财产安全