- apiGroups: [""] kinds: ["Service"] 符合策略实例的资源定义 Servie类型非Nodeport,符合策略实例。
- apiGroups: - "" - events.k8s.io resources: - events verbs: - create - patch - update - apiGroups
spec: match: kinds: - apiGroups: [""] kinds: ["Pod"] 符合策略实例的资源定义 示例中allowPrivilegeEscalation的值为false,符合策略实例。
- apiGroups: [""] kinds: ["Pod"] excludedNamespaces: ["kube-system"] 符合策略实例的资源定义 示例中privileged设置为false,符合策略实例。
spec: match: kinds: - apiGroups: [""] kinds: ["Pod"] excludedNamespaces: ["kube-system"] 符合策略实例的资源定义 Pod的automountServiceAccountToken
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sPSPProcMount metadata: name: psp-proc-mount spec: match: kinds: - apiGroups
apiVersion: constraints.gatekeeper.sh/v1beta1 kind: K8sExternalIPs metadata: name: external-ips spec: match: kinds: - apiGroups
kinds: - apiGroups: [""] kinds: ["Pod"] namespaces: - "default" parameters: tags: ["latest"] exemptImages
终端节点(Endpoint) 终端节点(Endpoint)即调用API的请求地址,不同服务不同区域的终端节点不同,您可以从地区和终端节点查询服务的终端节点。 UCS的终端节点如下表所示,请您根据业务需要选择对应区域的终端节点。
- apiGroups: [""] kinds: ["Pod"] 符合策略实例的资源定义 示例中hostPID和hostIPC均为false,符合策略实例。
- apiGroups: [""] kinds: ["Pod"] namespaces: - "default" 符合策略实例的资源定义 容器镜像包含digest,符合策略实例。
- apiGroups: [""] kinds: ["Pod"] parameters: cpu: "200m" memory: "1Gi" 符合策略实例的资源定义 CPU和内存的Limit符合策略实例。
- apiGroups: [""] kinds: ["Pod"] parameters: allowedHostPaths: - readOnly: true pathPrefix: "/foo" 符合策略实例的资源定义 示例中hostPath
spec: match: kinds: - apiGroups: [""] kinds: ["Pod"] parameters: limits: - memory requests: - cpu
- apiGroups: [""] kinds: ["Pod"] parameters: forbiddenSysctls: # - "*" # * may be used to forbid all sysctls - kernel
- 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
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: K8sPSPFSGroup metadata: name: psp-fsgroup spec: match: kinds: - apiGroups:
您即将访问非华为云网站,请注意账号财产安全