b8b2cc7c74
* zh-trans:/docs/docs/concepts/workloads/pods/ephemeral-containers.md (#16948) * update zh-trans of define-environment-variable-container.md (#16999) Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> * update chinese docs (#16985) * Fix ordered list (#16988) Signed-off-by: PingWang <wang.ping5@zte.com.cn> update Signed-off-by: PingWang <wang.ping5@zte.com.cn> * zh-trans:/docs/reference/setup-tools/kubeadm/kubeadm-upgrade-phase.md (#16951) Signed-off-by: PingWang <wang.ping5@zte.com.cn> update Signed-off-by: PingWang <wang.ping5@zte.com.cn> update Signed-off-by: PingWang <wang.ping5@zte.com.cn> * Remove redundant symbol and fix some ordered list (#17000) Signed-off-by: PingWang <wang.ping5@zte.com.cn> update Signed-off-by: PingWang <wang.ping5@zte.com.cn> * update-zh-translation/docs/reference/setup-tools/kubeadm/kubeadm-init.md (#16997) * update zh translation kubeadm-reset.md kubeadm-upgrade.md (#16992) * Create kubeadm_join_phase_control-plane-join_all.md (#16987) * Update web-ui-dashboard.md (#16976) * update format problem (#16956) Signed-off-by: PingWang <wang.ping5@zte.com.cn> update Signed-off-by: PingWang <wang.ping5@zte.com.cn> * zh-trans:/docs/docs/concepts/storage/volume-pvc-datasource.md (#17021) * update zh translation /docs/reference/access-authn-authz/webhook.md (#16860) * fix confict update zh translation (#16863) * zh-trans:/docs/concepts/workloads/pods/disruptions.md (#16983) * zh-trans:/docs/concepts/workloads/pods/disruptions.md * Update content/zh/docs/concepts/workloads/pods/disruptions.md Co-Authored-By: Qiming <tengqim@cn.ibm.com> * update zh translation content/zh/docs/reference/command-line-tools-reference/kube-scheduler.md (#17006) * Update RC's link (#16935) Signed-off-by: PingWang <wang.ping5@zte.com.cn> Update Signed-off-by: PingWang <wang.ping5@zte.com.cn> update the style Signed-off-by: PingWang <wang.ping5@zte.com.cn> * Update the links for /zh/docs/setup (#16938) Signed-off-by: PingWang <wang.ping5@zte.com.cn> * zh-trans:/docs/docs/concepts/services-networking/dual-stack.md (#17024) * update zh translation /reference/setup-tools/kubeadm/generated/kubeadm.md (#17036) * update zh tanslation /reference/setup-tools/kubeadm/generated/kubeadm_alpha_kubelet_config_download.md (#17037) * update zh translation -/reference/setup-tools/kubeadm/generated/kubeadm_alpha.md (#17038) * update zh translation /docs/contribute/participating.md (#17040) * Fix cri-o's links to match English docs (#16936) Signed-off-by: PingWang <wang.ping5@zte.com.cn> * update zh translation content/zh/docs/reference/kubectl/jsonpath.md (#16862) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_token_generate.md (#17049) * update Unkown -> Unknown (#17062) * zh-translation:high-availability.md (#16960) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * update Runnning -> Running (#17061) * zh-trans:/docs/docs/concepts/storage/volume-snapshots.md (#17054) * update zh transation /docs/reference/setup-tools/kubeadm/generated/kubeadm_reset.md (#17060) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_token_create.md (#17052) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_token.md (#17055) * update zh translation update-zh-translation-/docs/reference/setup-tools/kubeadm/generated/kubeadm_token_list.md (#17048) * update zh-translation:ha-topology.md (#17099) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * zh-trans /reference/setup-tools/kubeadm/generated/kubeadm_config_images_list.md (#17093) * update zh translation /reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_all.md (#17083) * Add Chinese translation for scheduler-perf-tuning (#17087) Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for scheduler-perf-tuning Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for scheduler-perf-tuning Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for scheduler-perf-tuning Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> * zh trans content/zh/docs/setup/production-environment/tools/kubeadm/control-plane-flags.md (#17121) * update zh trans content/zh/docs/tasks/access-application-cluster/service-access-application-cluster.md (#17122) * zh-translation:content/zh/docs/tasks/administer-cluster/namespaces-walkthrough.md (#17105) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * update-zh-translation-/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_migrate.md (#17091) * update zh trans /docs/setup/learning-environment/minikube.md (#17143) * update zh trans /zh/docs/reference/_index.md (#17146) * update zh trans /docs/tasks/access-application-cluster/port-forward-access-application-cluster.md (#17134) * update zh translation 20191020-update-zh-translation-/docs/contribute/localization.md (#17046) * update zh trans /docs/reference/using-api/client-libraries.md (#17144) * update zh trans /docs/reference/setup-tools/kubeadm/generated/kubeadm_version.md (#17145) * update zh /docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_node.md (#17131) * update zh translation /reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-client.md (#17081) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig.md (#17078) * add zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_update-status.md (#17076) * update zh trans content/zh/docs/contribute/generate-ref-docs/kubectl.md (#17165) * update zh translation /reference/command-line-tools-reference/kube-proxy.md (#17107) * zh-trans:/docs/docs/concepts/workloads/pods/pod-topology-spread-const… (#16955) * zh-trans:/docs/docs/concepts/workloads/pods/pod-topology-spread-constraints.md * Update pod-topology-spread-constraints.md * zh-trans:/docs/concepts/configuration/scheduling-framework.md (#17088) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config_kubelet.md (#17079) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_apiserver.md (#17077) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join.md (#17075) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_token_delete.md (#17050) * update zh trans /docs/concepts/overview/working-with-objects/namespaces.md (#17205) * update zh trans /docs/concepts/overview/what-is-kubernetes.md (#17203) * pr_release-1.16_crictl (#17201) * update zh docs/tasks/administer-cluster/dns-debugging-resolution.md (#17186) * update zh trans content/zh/docs/concepts/overview/working-with-objects/field-selectors.md (#17191) * translate configure_upgrade_etcd (#17160) * translate kubeadm_upgrade_apply (#17159) * update zh /docs/tasks/job/coarse-parallel-processing-work-queue.md (#17155) * translate docs/setup/release/version-skew-policy.md to Chinese (#17142) * update zh trans content/zh/docs/tasks/access-application-cluster/create-external-load-balancer.md (#17124) * zh-trans replace the wrong translation (#17103) zh-trans replace the wrong translation * Merged 1.14~1.16 changes (#17117) * zh-trans:/docs/concepts/configuration/assign-pod-node.md (#17129) * update zh trans /docs/contribute/generate-ref-docs/kubernetes-api.md (#17161) * pr_release-1.16_basic-ss (#17169) * Add zh-trans of assign-cpu-resource.md (#17063) Signed-off-by: heqg <he.qingguo@zte.com.cn> Add zh-trans of assign-cpu-resource.md Signed-off-by: heqg <he.qingguo@zte.com.cn> Add zh-trans of assign-cpu-resource.md Signed-off-by: heqg <he.qingguo@zte.com.cn> Add zh-trans of assign-cpu-resource.md Signed-off-by: heqg <he.qingguo@zte.com.cn> Add zh-trans of assign-cpu-resource.md Signed-off-by: heqg <he.qingguo@zte.com.cn> * update zh trans content/zh/docs/concepts/overview/working-with-objects/common-labels.md (#17193) * update zh translation /docs/contribute/intermediate.md (#17041) * zh-trans:docs/setup/production-environment/turnkey/tencent.md (#17207) * pr_release-1.16_mysql-wordpress-pv (#17202) * pr_release-1.16_reconfig-kubelet (#17200) * zh-trans:/docs/docs/concepts/workloads/controllers/jobs-run-completio… (#17020) * zh-trans:/docs/docs/concepts/workloads/controllers/jobs-run-completion.md * Update jobs-run-completion.md * Update jobs-run-completion.md * update zh trans content/zh/docs/concepts/extend-kubernetes/extend-cluster.md (#17212) * update zh trans content/zh/docs/concepts/extend-kubernetes/api-extension/apiserver-aggregation.md (#17213) * add zh trans /docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_kubeconfig.md (#17220) kubeadm_join_phase_control-plane-prepare_download-certs.md * add zh trans /reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs.md and /reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare.md (#17219) * update zh trans content/zh/docs/concepts/containers/images.md (#17216) * ZH-trans: add _index.md (#17214) * ZH-trans: add _index.md * add _index.md file * add _index.md files * pr_release-1.16_crd-versions (#17198) * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_config_images_pull.md (#17092) * zh-trans /reference/setup-tools/kubeadm/generated/kubeadm_config_images.md (#17094) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_kube-proxy.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_sa.md (#17222) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_all.md content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_certs.md (#17221) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_all.md (#17223) * 013 /docs/concepts/services networking/ingress.md (#17185) * x * update zh trans content/zh/docs/concepts/services-networking/ingress.md * zh-trans:/reference/setup-tools/kubeadm/generated/kubeadm_completion.md and kubeadm_config.md (#17097) * add zh trans reference/glossary/pod-lifecycle (#17226) * update zh-translation document (#17096) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * update zh-translation:setup-ha-etcd-with-kubeadm.md (#17098) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * add zh trans /docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_selfhosting.md and /docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_kubelet_config_enable-dynamic.md (#17227) * add zh trans /docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_kubeconfig_user.md and /docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config_kubeadm.md (#17228) * zh-translation:content/zh/docs/tasks/extend-kubectl/kubectl-plugins.md (#17089) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * update zh translation /docs/reference/setup-tools/kubeadm/generated/kubeadm_join.md (#17080) * update zh translation /reference/setup-tools/kubeadm/generated/kubeadm_config_view.md (#17085) * zh-translation:troubleshooting-kubeadm.md (#17069) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * zh-trans: docs/concepts/scheduling/kube-scheduler.md (#17067) * Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> Add Chinese translation for kube-scheduler Signed-off-by: GeorgeSen <wang.sen2@zte.com.cn> * Update kube-scheduler.md * Add Chinese translation for kube-scheduler * Update kube-scheduler.md * Update kube-scheduler.md * Update kube-scheduler.md * translate pods.md and init-containers.md for branch release-1.16 (#17208) * update zh translation /docs/contribute/start.md (#17039) * zh-translation:2017-10-00-Five-Days-Of-Kubernetes-18.md (#17229) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * translate kubeadm-certs.md (#17090) * update the Illegal comment such as : (<!--、<--) (#17266) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-ca.md (#17268) * update zh /docs/concepts/architecture/cloud-controller.md (#17263) * update zh /docs/concepts/cluster-administration/logging.md (#17247) * modify the show of zh translation /concepts/overview/what-is-kubernetes.md /reference/setup-tools/kubeadm/generated/kubeadm_init.md /reference/setup-tools/kubeadm/kubeadm-init.md (#17246) * zh-translation:kubeadm_init_phase_control-plane_all.md (#17243) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * zh-translation:kubeadm_join_phase_control-plane-join_etcd.md (#17236) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubelet-start.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-certs.md (#17230) * add content/zh/docs/reference/glossary/container-runtime.md file fix-up to pass the ci and trans content/zh/docs/reference/glossary/container-runtime.md、content/zh/docs/concepts/overview/components.md (#17211) * zh-translation:mirror-pod.md (#17231) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * zh-translation:kubeadm_init_phase_upload-config.md (#17238) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * update zh /docs/concepts/workloads/pods/pod-overview.md (#17239) * update the format of zh translation content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset.md content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade.md content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_apply.md content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_upgrade_plan.md content/zh/docs/reference/setup-tools/kubeadm/kubeadm-config.md content/zh/docs/reference/setup-tools/kubeadm/kubeadm-reset.md content/zh/docs/reference/setup-tools/kubeadm/kubeadm-token.md content/zh/docs/reference/setup-tools/kubeadm/kubeadm-upgrade.md (#17248) * Create advanced.md (#17256) * Create advanced.md * trans the advanced.md and fix the build bugs * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_scheduler.md (#17269) * zh-translation:kubelet-integration.md (#17272) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * pr_release-1.16_out-of-resource (#17199) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_front-proxy-ca.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane_controller-manager.md (#17267) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-peer.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_admin.md (#17271) * pr_release-1.16_ext-admission-ctl (#17196) * update zh translation /docs/contribute/advanced.md (#17042) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-etcd-client.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_ca.md (#17275) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print.md update zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_init-defaults.md (#17282) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated… (#17287) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_etcd.md content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_upload-config_all.md update zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_control-plane.md * Update kubeadm_init_phase_etcd.md * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/… (#17285) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_etcd-server.md content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_kubelet.md update zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_apiserver.md * Update kubeadm_alpha_kubelet.md * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_all.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon.md fix-up bad comment kubeadm_alpha_certs_renew.md、kubeadm_alpha_certs_renew_apiserver-etcd-client.md、kubeadm_init_phase_addon_all.md (#17276) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/… (#17281) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_etcd_local.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_print_join-defaults.md * Update kubeadm_init_phase_etcd_local.md * zh trans update-daemon-set.md (#16872) * zh trans update-daemon-set.md * Update update-daemon-set.md * managing-tls-in-a-cluster.md (#16874) * update-api-object-kubectl-patch.md (#16875) * improve the zh trans /kubeadm/generated/kubeadm_init_phase_.* 1 (#17295) * improve the zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_config_.* (#17294) * modify the zh translation content/zh/docs/reference/setup-tools/kubea… (#17293) * modify the zh translation content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_.* * Update kubeadm_alpha.md * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_all.md and content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_preflight.md (#17280) * add zh /docs/reference/glossary/cgroup.md (#17291) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_kubelet_config.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver-kubelet-client.md (#17288) * improve zh trans of command in /kubeadm/generated/kubeadm_init_phase_.* files (#17297) * improve zh command translation /kubeadm/generated/kubeadm_init_.* files (#17298) * update zh trans in /kubeadm/generated/kubeadm_.* files (#17306) * add zh trans /reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_etcd-healthcheck-client.md、/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_etcd-peer.md、/reference/setup-tools/kubeadm/generated/kubeadm_alpha_kubeconfig.md (#17308) * Improve previously translated documents (#17327) Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * zh-trans: docs/setup/production-environment/turnkey/aws.md (#17320) * Update zh.toml * update zh trans /generated/kubeadm_join_phase_.* files (#17301) * Update zh.toml * add zh /docs/reference/glossary/pod-disruption-budget.md (#17344) * pr_release-1.16_config-aggregation-layer (#17197) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_controller-manager.conf.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_scheduler.conf.md (#17390) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_scheduler.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-prepare_control-plane.md (#17381) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_apiserver-kubelet-client.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_control-plane-join_mark-control-plane.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_kubelet-start.md (#17380) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_addon_coredns.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_bootstrap-token.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_apiserver.md (#17383) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_certificate-key.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_preflight.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_update-cluster-status.md (#17385) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_admin.conf.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_reset_phase_cleanup-node.md (#17387) * add zh trans content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_apiserver-kubelet-client.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_certs_renew_front-proxy-client.md、content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_alpha_selfhosting_pivot.md (#17384) * add zh /docs/reference/glossary/limitrange.md (#17324) * add zh trans content/zh/docs/setup/best-practices/cluster-large.md (#17321) * add zh trans content/zh/docs/setup/best-practices/cluster-large.md * Update cluster-large.md * add zh trans /docs/reference/setup-tools/kubeadm/kubeadm-alpha.md、/do… (#17403) * add zh trans /docs/reference/setup-tools/kubeadm/kubeadm-alpha.md、/docs/reference/setup-tools/kubeadm/generated/kubeadm_join_phase_preflight.md、/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_certs_etcd-server.md * Update kubeadm_init_phase_certs_etcd-server.md * add zh /docs/reference/glossary/cluster-operations.md (#17300) * add zh /docs/reference/glossary/applications.md (#17419) * update zh trans kubelet (#17379) * update zh trans kubelet * update the file according to feedback from reviewer tengqm * update 1000-1757 lines * update the advice zh trans * add zh /docs/reference/glossary/static-pod.md (#17418) * add zh /docs/reference/glossary/preemption.md (#17423) * add zh /docs/reference/glossary/pod-priority.md (#17421) * add zh /docs/reference/glossary/control-plane.md (#17425) * add zh /docs/reference/glossary/cluster-infrastructure.md (#17424) * pr_release-1.16_api-overview (#17444) * pr_release-1.16_daemonset (#17435) * pr_release-1.16_gc (#17445) * pr_release-1.16_qos-class (#17442) * fix QoS Class to QoS 类 (#17464) * pr_release-1.16-abac (#17427) * zh-trans:docs/setup/production-environment/turnkey/alibaba-cloud.md (#17345) * pr_release-1.16_endpoint-slice (#17468) * pr_release-1.16_taint (#17469) * pr_release-1.16_operator-pattern (#17467) * pr_release-1.16_ss (#17433) * pr_release-1.16_admission-controller (#17440) * pr_release-1.16_containerd (#17441) * pr_release-1.16_app-container (#17466) * add zh-trans content/zh/docs/setup/_index.md、content/zh/docs/setup/release/_index.md (#17503) * pr-release-1.16_enabling-endpoint-slices (#17504) * update zh trans content/zh/docs/reference/setup-tools/kubeadm/kubeadm… (#17495) * update zh trans content/zh/docs/reference/setup-tools/kubeadm/kubeadm-upgrade-phase.md、content/zh/docs/reference/setup-tools/kubeadm/kubeadm-init-phase.md * add content/zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_kubelet.md * pr-release-1.16_logging (#17491) * pr-release-1.16_cri (#17486) * add zh-trans:docs/setup/production-environment/turnkey/azure.md (#17482) * pattern translate into 模式 (#17485) * fix zk affinity description in zh trans (#17393) * pr-release-1.16_ephemeral-container (#17487) * pr-release-1.16_data-plane (#17489) * pr-release-1.16_cncf (#17490) * zh-trans add content\zh\docs\tools\install-minikube.md (#16920) * zh-trans add content\zh\docs\tools\install-minikube.md * zh-trans update content\zh\docs\tools\install-minikube.md * zh-trans update content\zh\docs\tools\install-minikube.md * update \docs\tasks\tools\install-minikube.md * update docs\concepts\workloads\controllers\deployment.md * update deployment.md * pr-release-1.16_extensions (#17492) * pr-release-1.16_toleration (#17493) * Revert "update zh trans content/zh/docs/reference/setup-tools/kubeadm/kubeadm… (#17495)" (#17521) This reverts commit 1134c14e0a39bdc3d1a920ac9797139a6dcccf4b. * motidy extensions in content/zh/docs/reference/glossary/extensions (#17524) * motidy toleration in content/zh/docs/reference/glossary/toleration.md (#17523) * motidy toleration in content/zh/docs/reference/glossary/toleration.md * Update toleration.md * improve zh-trans in content/zh/docs/setup/_index.md (#17526) * add zh-trans /zh/docs/reference/setup-tools/kubeadm/generated/kubeadm_init_phase_kubeconfig_kubelet.md (#17527) * Broken Link (#17546) Issue available at https://kubernetes.io/zh/docs/concepts/containers/runtime-class/ and introduced by original English documentation (see #17543) * Update trans kubeadm_upgrade_plan.md (#17395) * Update kubeadm_upgrade_plan.md * Update kubeadm_upgrade_plan.md * Update kubeadm_upgrade_plan.md * Update kubeadm_upgrade_plan.md * Update kubeadm_upgrade_plan.md * Update kubeadm_upgrade_plan.md * update zh-trans of define-command-argument-container.md (#17022) Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> update zh-trans of define-command-argument-container.md Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> Add back the Original English Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> update title of define-command-argument-container.md Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> update table title and reference Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> update reference of define-command-argument-container.md Signed-off-by: Yixiang2019 <wang.yixiang@zte.com.cn> * ZH-trans: fix multiple jump links and update files (#17603) * ZH-trans: fix multiple jump links and update files * Update _index.html * update zh trans content/zh/docs/reference/setup-tools/kubeadm/kubeadm-init-phase.md (#17528) * update zh trans /doc/concepts/architecture/nodes.md (#17617) * update zh trans content/zh/docs/concepts/architecture/nodes.md * fix-up content/zh/docs/concepts/architecture/nodes.md * add zh-trans /docs/setup/release/notes.md (#17519) * add zh-trans /docs/setup/release/notes.md update-750 * fix-up 1575 line and udpate 2483 line * update to line 2980 * update to the last line 3160 * add zh-trans:docs/setup/production-environment/turnkey/icp.md (#17568) * zh-trans: /docs/setup/production-environment/container-runtimes.md (#17646) * zh-trs:container-runtimes.md Signed-off-by: yuxiaobo <yuxiaobogo@163.com> * Update container-runtimes.md * Translate /docs/concepts/workloads/controllers/ttlafterfinished.md into Chinese (#17791) * Translate /docs/concepts/cluster-administration/cloud-providers.md into Chinese * Translate /docs/concepts/workloads/controllers/ttlafterfinished.md into Chinese * Sorry, wrong commit, roll back... * Translate /docs/concepts/workloads/controllers/ttlafterfinished.md * Translate /docs/concepts/workloads/controllers/ttlafterfinished.md into Chinese * Translate /docs/concepts/workloads/controllers/ttlafterfinished.md into Chinese * Create trans kubeadm_upgrade_diff.md (#17392) * Update kubeadm_upgrade_diff.md * Update kubeadm_upgrade_diff.md * Update kubeadm_upgrade_diff.md * Create _index.md (#17831) * zh-trans zh-trans-/docs/reference/command-line-tools-reference/feature-gates.md (#17658) * Update volume-snapshots.md (#17829) * Update volume-snapshots.md * Update volume-snapshots.md * Update volume-snapshots.md * Create ovirt.md (#17849) * Create ovirt.md * Update ovirt.md * Translate /docs/concepts/cluster-administration/cloud-providers.md into Chinese (#17761) * Translate /docs/concepts/cluster-administration/cloud-providers.md into Chinese * Translate /docs/concepts/workloads/controllers/ttlafterfinished.md into Chinese * Sorry, wrong commit, roll back... * Update translation after tengqm's review. * Update cloud-providers.md * Update dual-stack.md (#17836) * Update dual-stack.md * Update dual-stack.md * Update dual-stack.md * Update dual-stack.md * Create validate-dual-stack.md (#17833) * Create validate-dual-stack.md * Update validate-dual-stack.md * translation content/zh/docs/reference/setup-tools/kubeadm/ kubeadm-join-phase、kubeadm-reset-phase (#17881) * zh-trans content/zh/docs/contribute/generate-ref-docs/contribute-upstream.md (#17882) * Chinese translation /docs/tasks/administer-cluster/highly-available-master.md (#17884) * Chinese translation /docs/tasks/administer-cluster/highly-available-master.md * Apply suggestions from code review Co-Authored-By: Qiming <tengqim@cn.ibm.com> * Fix format issue (#17921) * Create topology-manager.md (#17901) * Create topology-manager.md * Update topology-manager.md * add zh-trans:docs/setup/production-environment/windows/user-guide-windows-containers.md (#17876) * Update pod-overhead.md (#17931) * Update scheduler-perf-tuning.md (#17934) * Create dcos.md (#17932) * Create dcos.md * Update dcos.md * Update object-management.md (#17937) * zh-translation content/zh/docs/setup/production-environment/tools/kops.md (#17991) * Create imperative-config.md (#17956) * Create imperative-config.md * Update imperative-config.md * Create self-hosting.md (#17950) * Create resource-bin-packing.md (#17935) * Create nodelocaldns.md (#17938) * Update config.toml(release-1.16) for 1.17 (#18025) * Update config.toml(release-1.16) for 1.17 * Update config.toml * Remove ru language * Update the conflict and merge the two commits * add nginx-deployment.yaml file Co-authored-by: ZhongliangXiong <xiong.zhongliang@zte.com.cn> Co-authored-by: Yixiang Wang <wang.yixiang@zte.com.cn> Co-authored-by: li mengyang <hwdef97@gmail.com> Co-authored-by: PingWang <wang.ping5@zte.com.cn> Co-authored-by: chentanjun <tanjunchen20@gmail.com> Co-authored-by: Sophy417 <53026875+Sophy417@users.noreply.github.com> Co-authored-by: zhangx501 <zhang0000xun@gmail.com> Co-authored-by: Qiming <tengqim@cn.ibm.com> Co-authored-by: yuxiaobo96 <41496192+yuxiaobo96@users.noreply.github.com> Co-authored-by: senwang <wang.sen2@zte.com.cn> Co-authored-by: lichuqiang <lichuqiang@huawei.com> Co-authored-by: lpf7551321 <liupengfei20@huawei.com> Co-authored-by: Hongcai Ren <renhongcai@huawei.com> Co-authored-by: jiajie <jiaj12@chinaunicom.cn> Co-authored-by: heqg <56527988+heqg@users.noreply.github.com> Co-authored-by: IreneByron <zhangbingqing7@huawei.com> Co-authored-by: Wang Bing <wangbing.adam@gmail.com> Co-authored-by: Damini Satya <daminisatya@gmail.com> Co-authored-by: liufangwai <liufangwai@huawei.com> Co-authored-by: wangcong <congfairy2536@gmail.com> Co-authored-by: XuefeiWang2 <wangxuefei2@huawei.com> Co-authored-by: Kubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com> Co-authored-by: Ziqiu Zhu <zzqshu@126.com> Co-authored-by: ten2ton <50288981+ten2ton@users.noreply.github.com> Co-authored-by: Oleg Butuzov <butuzov@users.noreply.github.com> Co-authored-by: jiazxjason <52809535+jiazxjason@users.noreply.github.com> Co-authored-by: Coffey Gao <coffiney@qq.com> Co-authored-by: Bingshen Wang <bingshen.wbs@alibaba-inc.com>
613 lines
26 KiB
Markdown
613 lines
26 KiB
Markdown
---
|
|
reviewers:
|
|
- soltysh
|
|
- sttts
|
|
- ericchiang
|
|
content_template: templates/concept
|
|
title: Auditing
|
|
---
|
|
|
|
{{% capture overview %}}
|
|
|
|
{{< feature-state state="beta" >}}
|
|
|
|
<!--
|
|
Kubernetes auditing provides a security-relevant chronological set of records documenting
|
|
the sequence of activities that have affected system by individual users, administrators
|
|
or other components of the system. It allows cluster administrator to
|
|
answer the following questions:
|
|
-->
|
|
Kubernetes 审计功能提供了与安全相关的按时间顺序排列的记录集,记录单个用户、管理员或系统其他组件影响系统的活动顺序。
|
|
它能帮助集群管理员处理以下问题:
|
|
|
|
<!--
|
|
- what happened?
|
|
- when did it happen?
|
|
- who initiated it?
|
|
- on what did it happen?
|
|
- where was it observed?
|
|
- from where was it initiated?
|
|
- to where was it going?
|
|
-->
|
|
- 发生了什么?
|
|
- 什么时候发生的?
|
|
- 谁触发的?
|
|
- 活动发生在哪个(些)对象上?
|
|
- 在哪观察到的?
|
|
- 它从哪触发的?
|
|
- 活动的后续处理行为是什么?
|
|
|
|
{{% /capture %}}
|
|
|
|
{{< toc >}}
|
|
|
|
{{% capture body %}}
|
|
|
|
<!--
|
|
[Kube-apiserver][kube-apiserver] performs auditing. Each request on each stage
|
|
of its execution generates an event, which is then pre-processed according to
|
|
a certain policy and written to a backend. The policy determines what's recorded
|
|
and the backends persist the records. The current backend implementations
|
|
include logs files and webhooks.
|
|
-->
|
|
[Kube-apiserver][kube-apiserver] 执行审计。每个执行阶段的每个请求都会生成一个事件,然后根据特定策略对事件进行预处理并写入后端。
|
|
您可以在 [设计方案][auditing-proposal] 中找到更多详细信息。
|
|
该策略确定记录的内容并且在后端存储记录。当前的后端支持日志文件和 webhook。
|
|
|
|
<!--
|
|
Each request can be recorded with an associated "stage". The known stages are:
|
|
|
|
- `RequestReceived` - The stage for events generated as soon as the audit
|
|
handler receives the request, and before it is delegated down the handler
|
|
chain.
|
|
- `ResponseStarted` - Once the response headers are sent, but before the
|
|
response body is sent. This stage is only generated for long-running requests
|
|
(e.g. watch).
|
|
- `ResponseComplete` - The response body has been completed and no more bytes
|
|
will be sent.
|
|
- `Panic` - Events generated when a panic occurred.
|
|
-->
|
|
|
|
每个请求都可以用相关的 "stage" 记录。已知的 stage 有:
|
|
|
|
- `RequestReceived` - 事件的 stage 将在审计处理器接收到请求后,并且在委托给其余处理器之前生成。
|
|
|
|
- `ResponseStarted` - 在响应消息的头部发送后,但是响应消息体发送前。这个 stage 仅为长时间运行的请求生成(例如 watch)。
|
|
|
|
- `ResponseComplete` - 当响应消息体完成并且没有更多数据需要传输的时候。
|
|
- `Panic` - 当 panic 发生时生成。
|
|
|
|
{{< note >}}
|
|
<!--
|
|
The audit logging feature increases the memory consumption of the API
|
|
server because some context required for auditing is stored for each request.
|
|
Additionally, memory consumption depends on the audit logging configuration.
|
|
-->
|
|
**注意** 审计日志记录功能会增加 API server 的内存消耗,因为需要为每个请求存储审计所需的某些上下文。
|
|
此外,内存消耗取决于审计日志记录的配置。
|
|
{{< /note >}}
|
|
|
|
<!--
|
|
## Audit Policy
|
|
|
|
Audit policy defines rules about what events should be recorded and what data
|
|
they should include. The audit policy object structure is defined in the
|
|
[`audit.k8s.io` API group][auditing-api]. When an event is processed, it's
|
|
compared against the list of rules in order. The first matching rule sets the
|
|
"audit level" of the event. The known audit levels are:
|
|
-->
|
|
## 审计策略
|
|
|
|
审计政策定义了关于应记录哪些事件以及应包含哪些数据的规则。审计策略对象结构在 [`audit.k8s.io` API 组][auditing-api] 中定义。
|
|
处理事件时,将按顺序与规则列表进行比较。第一个匹配规则设置事件的 [审计级别][auditing-level]。已知的审计级别有:
|
|
|
|
<!--
|
|
- `None` - don't log events that match this rule.
|
|
- `Metadata` - log request metadata (requesting user, timestamp, resource,
|
|
verb, etc.) but not request or response body.
|
|
- `Request` - log event metadata and request body but not response body.
|
|
This does not apply for non-resource requests.
|
|
- `RequestResponse` - log event metadata, request and response bodies.
|
|
This does not apply for non-resource requests.
|
|
-->
|
|
- `None` - 符合这条规则的日志将不会记录。
|
|
- `Metadata` - 记录请求的 metadata(请求的用户、timestamp、resource、verb 等等),但是不记录请求或者响应的消息体。
|
|
- `Request` - 记录事件的 metadata 和请求的消息体,但是不记录响应的消息体。这不适用于非资源类型的请求。
|
|
- `RequestResponse` - 记录事件的 metadata,请求和响应的消息体。这不适用于非资源类型的请求。
|
|
|
|
<!--
|
|
You can pass a file with the policy to [kube-apiserver][kube-apiserver]
|
|
using the `--audit-policy-file` flag. If the flag is omitted, no events are logged.
|
|
Note that the `rules` field __must__ be provided in the audit policy file.
|
|
A policy with no (0) rules is treated as illegal.
|
|
|
|
Below is an example audit policy file:
|
|
-->
|
|
您可以使用 `--audit-policy-file` 标志将包含策略的文件传递给 [kube-apiserver][kube-apiserver]。如果不设置该标志,则不记录事件。
|
|
注意 `rules` 字段 __必须__ 在审计策略文件中提供。没有(0)规则的策略将被视为非法配置。
|
|
|
|
以下是一个审计策略文件的示例:
|
|
|
|
{{< codenew file="audit/audit-policy.yaml" >}}
|
|
|
|
<!--
|
|
You can use a minimal audit policy file to log all requests at the `Metadata` level:
|
|
-->
|
|
您可以使用最低限度的审计策略文件在 `Metadata` 级别记录所有请求:
|
|
|
|
```yaml
|
|
# Log all requests at the Metadata level.
|
|
apiVersion: audit.k8s.io/v1beta1
|
|
kind: Policy
|
|
rules:
|
|
- level: Metadata
|
|
```
|
|
|
|
<!--
|
|
The [audit profile used by GCE][gce-audit-profile] should be used as reference by
|
|
admins constructing their own audit profiles.
|
|
-->
|
|
管理员构建自己的审计配置文件时,应使用 [GCE 使用的审计配置文件][gce-audit-profile] 作为参考。
|
|
|
|
<!--
|
|
## Audit backends
|
|
|
|
Audit backends persist audit events to an external storage.
|
|
[Kube-apiserver][kube-apiserver] out of the box provides two backends:
|
|
|
|
- Log backend, which writes events to a disk
|
|
- Webhook backend, which sends events to an external API
|
|
|
|
In both cases, audit events structure is defined by the API in the
|
|
`audit.k8s.io` API group. The current version of the API is
|
|
[`v1beta1`][auditing-api].
|
|
-->
|
|
## 审计后端
|
|
|
|
审计后端实现将审计事件导出到外部存储。
|
|
[Kube-apiserver][kube-apiserver] 提供两个后端:
|
|
|
|
- Log 后端,将事件写入到磁盘
|
|
- Webhook 后端,将事件发送到外部 API
|
|
|
|
在这两种情况下,审计事件结构均由 `audit.k8s.io` API 组中的 API 定义。当前版本的 API 是 [`v1beta1`][auditing-api]。
|
|
|
|
{{< note >}}
|
|
<!--
|
|
In case of patches, request body is a JSON array with patch operations, not a JSON object
|
|
with an appropriate Kubernetes API object. For example, the following request body is a valid patch
|
|
request to `/apis/batch/v1/namespaces/some-namespace/jobs/some-job-name`.
|
|
-->
|
|
**注意:** 在 patch 请求的情况下,请求的消息体需要是一个 JSON 串指定 patch 操作,而不是一个完整的 Kubernetes API 对象 JSON 串。
|
|
例如,以下的示例是一个合法的 patch 请求消息体,该请求对应 `/apis/batch/v1/namespaces/some-namespace/jobs/some-job-name`。
|
|
|
|
```json
|
|
[
|
|
{
|
|
"op": "replace",
|
|
"path": "/spec/parallelism",
|
|
"value": 0
|
|
},
|
|
{
|
|
"op": "remove",
|
|
"path": "/spec/template/spec/containers/0/terminationMessagePolicy"
|
|
}
|
|
]
|
|
```
|
|
{{< /note >}}
|
|
|
|
<!--
|
|
### Log backend
|
|
|
|
Log backend writes audit events to a file in JSON format. You can configure
|
|
log audit backend using the following [kube-apiserver][kube-apiserver] flags:
|
|
-->
|
|
### Log 后端
|
|
|
|
Log 后端将审计事件写入 JSON 格式的文件。您可以使用以下 [kube-apiserver][kube-apiserver] 标志配置 Log 审计后端:
|
|
|
|
<!--
|
|
- `--audit-log-path` specifies the log file path that log backend uses to write
|
|
audit events. Not specifying this flag disables log backend. `-` means standard out
|
|
- `--audit-log-maxage` defined the maximum number of days to retain old audit log files
|
|
- `--audit-log-maxbackup` defines the maximum number of audit log files to retain
|
|
- `--audit-log-maxsize` defines the maximum size in megabytes of the audit log file before it gets rotated
|
|
-->
|
|
- `--audit-log-path` 指定用来写入审计事件的日志文件路径。不指定此标志会禁用日志后端。`-` 意味着标准化
|
|
- `--audit-log-maxage` 定义了保留旧审计日志文件的最大天数
|
|
- `--audit-log-maxbackup` 定义了要保留的审计日志文件的最大数量
|
|
- `--audit-log-maxsize` 定义审计日志文件的最大大小(兆字节)
|
|
|
|
<!--
|
|
### Webhook backend
|
|
|
|
Webhook backend sends audit events to a remote API, which is assumed to be the
|
|
same API as [kube-apiserver][kube-apiserver] exposes. You can configure webhook
|
|
audit backend using the following kube-apiserver flags:
|
|
-->
|
|
### Webhook 后端
|
|
|
|
Webhook 后端将审计事件发送到远程 API,该远程 API 应该暴露与 [kube-apiserver][kube-apiserver] 相同的API。
|
|
您可以使用如下 kube-apiserver 标志来配置 webhook 审计后端:
|
|
|
|
<!--
|
|
- `--audit-webhook-config-file` specifies the path to a file with a webhook
|
|
configuration. Webhook configuration is effectively a [kubeconfig][kubeconfig].
|
|
- `--audit-webhook-initial-backoff` specifies the amount of time to wait after the first failed
|
|
request before retrying. Subsequent requests are retried with exponential backoff.
|
|
|
|
The webhook config file uses the kubeconfig format to specify the remote address of
|
|
the service and credentials used to connect to it.
|
|
-->
|
|
- `--audit-webhook-config-file` webhook 配置文件的路径。Webhook 配置文件实际上是一个 [kubeconfig][kubeconfig]。
|
|
- `--audit-webhook-initial-backoff` 指定在第一次失败后重发请求等待的时间。随后的请求将以指数退避重试。
|
|
|
|
webhook 配置文件使用 kubeconfig 格式指定服务的远程地址和用于连接它的凭据。
|
|
|
|
### Batching
|
|
|
|
<!--
|
|
Both log and webhook backends support batching. Using webhook as an example, here's the list of
|
|
available flags. To get the same flag for log backend, replace `webhook` with `log` in the flag
|
|
name. By default, batching is enabled in `webhook` and disabled in `log`. Similarly, by default
|
|
throttling is enabled in `webhook` and disabled in `log`.
|
|
|
|
- `--audit-webhook-mode` defines the buffering strategy. One of the following:
|
|
- `batch` - buffer events and asynchronously process them in batches. This is the default.
|
|
- `blocking` - block API server responses on processing each individual event.
|
|
-->
|
|
|
|
log 和 webhook 后端都支持 batch。以 webhook 为例,以下是可用参数列表。要获取 log 后端的同样参数,请在参数名称中将 `webhook` 替换为 `log`。
|
|
默认情况下,在 `webhook` 中启用 batch,在 `log` 中禁用 batch。同样,默认情况下,在 `webhook` 中启用限制,在 `log` 中禁用限制。
|
|
|
|
- `--audit-webhook-mode` 定义缓存策略,可选值如下:
|
|
- `batch` - 以批处理缓存事件和异步的过程。这是默认值。
|
|
- `blocking` - 阻止 API server 处理每个单独事件的响应。
|
|
|
|
<!--
|
|
The following flags are used only in the `batch` mode.
|
|
|
|
- `--audit-webhook-batch-buffer-size` defines the number of events to buffer before batching.
|
|
If the rate of incoming events overflows the buffer, events are dropped.
|
|
- `--audit-webhook-batch-max-size` defines the maximum number of events in one batch.
|
|
- `--audit-webhook-batch-max-wait` defines the maximum amount of time to wait before unconditionally
|
|
batching events in the queue.
|
|
- `--audit-webhook-batch-throttle-qps` defines the maximum average number of batches generated
|
|
per second.
|
|
- `--audit-webhook-batch-throttle-burst` defines the maximum number of batches generated at the same
|
|
moment if the allowed QPS was underutilized previously.
|
|
-->
|
|
以下参数仅用于 `batch` 模式。
|
|
|
|
- `--audit-webhook-batch-buffer-size` 定义 batch 之前要缓存的事件数。
|
|
如果传入事件的速率溢出缓存区,则会丢弃事件。
|
|
- `--audit-webhook-batch-max-size` 定义一个 batch 中的最大事件数。
|
|
- `--audit-webhook-batch-max-wait` 无条件 batch 队列中的事件前等待的最大事件。
|
|
- `--audit-webhook-batch-throttle-qps` 每秒生成的最大 batch 平均值。
|
|
- `--audit-webhook-batch-throttle-burst` 在达到允许的 QPS 前,同一时刻允许存在的最大 batch 生成数。
|
|
|
|
<!--
|
|
#### Parameter tuning
|
|
|
|
Parameters should be set to accommodate the load on the apiserver.
|
|
|
|
For example, if kube-apiserver receives 100 requests each second, and each request is audited only
|
|
on `ResponseStarted` and `ResponseComplete` stages, you should account for ~200 audit
|
|
events being generated each second. Assuming that there are up to 100 events in a batch,
|
|
you should set throttling level at least 2 QPS. Assuming that the backend can take up to
|
|
5 seconds to write events, you should set the buffer size to hold up to 5 seconds of events, i.e.
|
|
10 batches, i.e. 1000 events.
|
|
-->
|
|
#### 参数调整
|
|
|
|
需要设置参数以适应 apiserver 上的负载。
|
|
|
|
|
|
例如,如果 kube-apiserver 每秒收到 100 个请求,并且每个请求仅在 `ResponseStarted` 和 `ResponseComplete` 阶段进行审计,则应该考虑每秒生成约 200 个审计事件。
|
|
假设批处理中最多有 100 个事件,则应将限制级别设置为至少 2 个 QPS。
|
|
假设后端最多需要 5 秒钟来写入事件,您应该设置缓冲区大小以容纳最多 5 秒的事件,即 10 个 batch,即 1000 个事件。
|
|
|
|
<!--
|
|
In most cases however, the default parameters should be sufficient and you don't have to worry about
|
|
setting them manually. You can look at the following Prometheus metrics exposed by kube-apiserver
|
|
and in the logs to monitor the state of the auditing subsystem.
|
|
|
|
- `apiserver_audit_event_total` metric contains the total number of audit events exported.
|
|
- `apiserver_audit_error_total` metric contains the total number of events dropped due to an error
|
|
during exporting.
|
|
-->
|
|
但是,在大多数情况下,默认参数应该足够了,您不必手动设置它们。您可以查看 kube-apiserver 公开的以下 Prometheus 指标,并在日志中监控审计子系统的状态。
|
|
|
|
- `apiserver_audit_event_total` 包含所有暴露的审计事件数量的指标。
|
|
- `apiserver_audit_error_total` 在暴露时由于发生错误而被丢弃的事件的数量。
|
|
|
|
<!--
|
|
## Multi-cluster setup
|
|
|
|
If you're extending the Kubernetes API with the [aggregation layer][kube-aggregator], you can also
|
|
set up audit logging for the aggregated apiserver. To do this, pass the configuration options in the
|
|
same format as described above to the aggregated apiserver and set up the log ingesting pipeline
|
|
to pick up audit logs. Different apiservers can have different audit configurations and different
|
|
audit policies.
|
|
-->
|
|
## 多集群配置
|
|
|
|
如果您通过 [aggregation layer][kube-aggregator] 对 Kubernetes API 进行扩展,那么您也可以为聚合的 apiserver 设置审计日志。
|
|
想要这么做,您需要以上述的格式给聚合的 apiserver 配置参数,并且配置日志管道以采用审计日志。不同的 apiserver 可以配置不同的审计配置和策略。
|
|
|
|
<!--
|
|
## Log Collector Examples
|
|
|
|
### Use fluentd to collect and distribute audit events from log file
|
|
|
|
[Fluentd][fluentd] is an open source data collector for unified logging layer.
|
|
In this example, we will use fluentd to split audit events by different namespaces.
|
|
|
|
1. install [fluentd, fluent-plugin-forest and fluent-plugin-rewrite-tag-filter][fluentd_install_doc] in the kube-apiserver node
|
|
1. create a config file for fluentd
|
|
-->
|
|
## 日志选择器示例
|
|
|
|
### 使用 fluentd 从日志文件中选择并且分发审计日志
|
|
|
|
[Fluentd][fluentd] 是一个开源的数据采集器,可以从统一的日志层中采集。
|
|
在以下示例中,我们将使用 fluentd 来按照命名空间划分审计事件。
|
|
|
|
1. 在 kube-apiserver node 节点上安装 [fluentd, fluent-plugin-forest and fluent-plugin-rewrite-tag-filter][fluentd_install_doc]
|
|
1. 为 fluentd 创建一个配置文件
|
|
|
|
```none
|
|
$ cat <<EOF > /etc/fluentd/config
|
|
# fluentd conf runs in the same host with kube-apiserver
|
|
<source>
|
|
@type tail
|
|
# audit log path of kube-apiserver
|
|
path /var/log/audit
|
|
pos_file /var/log/audit.pos
|
|
format json
|
|
time_key time
|
|
time_format %Y-%m-%dT%H:%M:%S.%N%z
|
|
tag audit
|
|
</source>
|
|
|
|
<filter audit>
|
|
#https://github.com/fluent/fluent-plugin-rewrite-tag-filter/issues/13
|
|
type record_transformer
|
|
enable_ruby
|
|
<record>
|
|
namespace ${record["objectRef"].nil? ? "none":(record["objectRef"]["namespace"].nil? ? "none":record["objectRef"]["namespace"])}
|
|
</record>
|
|
</filter>
|
|
|
|
<match audit>
|
|
# route audit according to namespace element in context
|
|
@type rewrite_tag_filter
|
|
rewriterule1 namespace ^(.+) ${tag}.$1
|
|
</match>
|
|
|
|
<filter audit.**>
|
|
@type record_transformer
|
|
remove_keys namespace
|
|
</filter>
|
|
|
|
<match audit.**>
|
|
@type forest
|
|
subtype file
|
|
remove_prefix audit
|
|
<template>
|
|
time_slice_format %Y%m%d%H
|
|
compress gz
|
|
path /var/log/audit-${tag}.*.log
|
|
format json
|
|
include_time_key true
|
|
</template>
|
|
</match>
|
|
```
|
|
|
|
<!--
|
|
1. start fluentd
|
|
-->
|
|
1. 启动 fluentd
|
|
|
|
```shell
|
|
$ fluentd -c /etc/fluentd/config -vv
|
|
```
|
|
|
|
<!--
|
|
1. start kube-apiserver with the following options:
|
|
-->
|
|
1. 给 kube-apiserver 配置以下参数并启动:
|
|
|
|
```shell
|
|
--audit-policy-file=/etc/kubernetes/audit-policy.yaml --audit-log-path=/var/log/kube-audit --audit-log-format=json
|
|
```
|
|
|
|
<!--
|
|
1. check audits for different namespaces in `/var/log/audit-*.log`
|
|
-->
|
|
1. 在 `/var/log/audit-*.log` 文件中检查不同命名空间的审计事件
|
|
|
|
<!--
|
|
### Use logstash to collect and distribute audit events from webhook backend
|
|
|
|
[Logstash][logstash] is an open source, server-side data processing tool. In this example,
|
|
we will use logstash to collect audit events from webhook backend, and save events of
|
|
different users into different files.
|
|
|
|
1. install [logstash][logstash_install_doc]
|
|
1. create config file for logstash
|
|
-->
|
|
### 使用 logstash 采集并分发 webhook 后端的审计事件
|
|
|
|
[Logstash][logstash] 是一个开源的、服务器端的数据处理工具。在下面的示例中,我们将使用 logstash 采集 webhook 后端的审计事件,并且将来自不同用户的事件存入不同的文件。
|
|
|
|
1. 安装 [logstash][logstash_install_doc]
|
|
1. 为 logstash 创建配置文件
|
|
|
|
```none
|
|
$ cat <<EOF > /etc/logstash/config
|
|
input{
|
|
http{
|
|
#TODO, figure out a way to use kubeconfig file to authenticate to logstash
|
|
#https://www.elastic.co/guide/en/logstash/current/plugins-inputs-http.html#plugins-inputs-http-ssl
|
|
port=>8888
|
|
}
|
|
}
|
|
filter{
|
|
split{
|
|
# Webhook audit backend sends several events together with EventList
|
|
# split each event here.
|
|
field=>[items]
|
|
# We only need event subelement, remove others.
|
|
remove_field=>[headers, metadata, apiVersion, "@timestamp", kind, "@version", host]
|
|
}
|
|
mutate{
|
|
rename => {items=>event}
|
|
}
|
|
}
|
|
output{
|
|
file{
|
|
# Audit events from different users will be saved into different files.
|
|
path=>"/var/log/kube-audit-%{[event][user][username]}/audit"
|
|
}
|
|
}
|
|
```
|
|
|
|
<!--
|
|
1. start logstash
|
|
-->
|
|
1. 启动 logstash
|
|
|
|
```shell
|
|
$ bin/logstash -f /etc/logstash/config --path.settings /etc/logstash/
|
|
```
|
|
|
|
<!--
|
|
1. create a [kubeconfig file](/docs/tasks/access-application-cluster/authenticate-across-clusters-kubeconfig/) for kube-apiserver webhook audit backend
|
|
-->
|
|
1. 为 kube-apiserver webhook 审计后端创建一个 [kubeconfig 文件](/docs/tasks/access-application-cluster/authenticate-across-clusters-kubeconfig/)
|
|
|
|
```none
|
|
$ cat <<EOF > /etc/kubernetes/audit-webhook-kubeconfig
|
|
apiVersion: v1
|
|
clusters:
|
|
- cluster:
|
|
server: http://<ip_of_logstash>:8888
|
|
name: logstash
|
|
contexts:
|
|
- context:
|
|
cluster: logstash
|
|
user: ""
|
|
name: default-context
|
|
current-context: default-context
|
|
kind: Config
|
|
preferences: {}
|
|
users: []
|
|
EOF
|
|
```
|
|
|
|
<!--
|
|
1. start kube-apiserver with the following options:
|
|
-->
|
|
1. 为 kube-apiserver 配置以下参数并启动:
|
|
|
|
```shell
|
|
--audit-policy-file=/etc/kubernetes/audit-policy.yaml --audit-webhook-config-file=/etc/kubernetes/audit-webhook-kubeconfig
|
|
```
|
|
|
|
<!--
|
|
1. check audits in logstash node's directories `/var/log/kube-audit-*/audit`
|
|
|
|
Note that in addition to file output plugin, logstash has a variety of outputs that
|
|
let users route data where they want. For example, users can emit audit events to elasticsearch
|
|
plugin which supports full-text search and analytics.
|
|
-->
|
|
1. 在 logstash node 节点的 `/var/log/kube-audit-*/audit` 目录中检查审计事件
|
|
|
|
注意到,除了文件输出插件外,logstash 还有其它多种输出可以让用户路由不同的数据。例如,用户可以将审计事件发送给支持全文搜索和分析的 elasticsearch 插件。
|
|
|
|
<!--
|
|
## Legacy Audit
|
|
|
|
__Note:__ Legacy Audit is deprecated and is disabled by default since 1.8 and
|
|
will be removed in 1.12. To fallback to this legacy audit, disable the advanced
|
|
auditing feature using the `AdvancedAuditing` feature gate in [kube-apiserver][kube-apiserver]:
|
|
-->
|
|
## 传统的审计
|
|
|
|
__注意:__ 传统审计已被弃用,自 1.8 版本以后默认禁用,并且将会在 1.12 版本中彻底移除。
|
|
如果想要回退到传统的审计功能,请使用 [kube-apiserver][kube-apiserver] 中 feature gate 的 `AdvancedAuditing` 功能来禁用高级审核功能:
|
|
|
|
```
|
|
--feature-gates=AdvancedAuditing=false
|
|
```
|
|
|
|
<!--
|
|
In legacy format, each audit log entry contains two lines:
|
|
|
|
1. The request line containing a unique ID to match the response and request
|
|
metadata, such as the source IP, requesting user, impersonation information,
|
|
resource being requested, etc.
|
|
2. The response line containing a unique ID matching the request line and the response code.
|
|
|
|
Example output for `admin` user listing pods in the `default` namespace:
|
|
-->
|
|
在传统格式中,每个审计文件条目包含两行:
|
|
|
|
1. 请求行包含唯一 ID 以匹配响应和请求元数据,例如源 IP、请求用户、模拟信息和请求的资源等。
|
|
2. 响应行包含与请求行和响应代码相匹配的唯一 ID。
|
|
|
|
```
|
|
2017-03-21T03:57:09.106841886-04:00 AUDIT: id="c939d2a7-1c37-4ef1-b2f7-4ba9b1e43b53" ip="127.0.0.1" method="GET" user="admin" groups="\"system:masters\",\"system:authenticated\"" as="<self>" asgroups="<lookup>" namespace="default" uri="/api/v1/namespaces/default/pods"
|
|
2017-03-21T03:57:09.108403639-04:00 AUDIT: id="c939d2a7-1c37-4ef1-b2f7-4ba9b1e43b53" response="200"
|
|
```
|
|
|
|
<!--
|
|
### Configuration
|
|
|
|
[Kube-apiserver][kube-apiserver] provides the following options which are responsible
|
|
for configuring where and how audit logs are handled:
|
|
-->
|
|
### 配置
|
|
|
|
[Kube-apiserver][kube-apiserver] 提供以下选项,负责配置审核日志的位置和处理方式:
|
|
|
|
<!--
|
|
- `audit-log-path` - enables the audit log pointing to a file where the requests are being logged to, '-' means standard out.
|
|
- `audit-log-maxage` - specifies maximum number of days to retain old audit log files based on the timestamp encoded in their filename.
|
|
- `audit-log-maxbackup` - specifies maximum number of old audit log files to retain.
|
|
- `audit-log-maxsize` - specifies maximum size in megabytes of the audit log file before it gets rotated. Defaults to 100MB.
|
|
-->
|
|
- `audit-log-path` - 使审计日志指向请求被记录到的文件,'-' 表示标准输出。
|
|
- `audit-log-maxage` - 根据文件名中编码的时间戳指定保留旧审计日志文件的最大天数。
|
|
- `audit-log-maxbackup` - 指定要保留的旧审计日志文件的最大数量。
|
|
- `audit-log-maxsize` - 指定审核日志文件的最大大小(兆字节)。默认为100MB。
|
|
|
|
<!--
|
|
If an audit log file already exists, Kubernetes appends new audit logs to that file.
|
|
Otherwise, Kubernetes creates an audit log file at the location you specified in
|
|
`audit-log-path`. If the audit log file exceeds the size you specify in `audit-log-maxsize`,
|
|
Kubernetes will rename the current log file by appending the current timestamp on
|
|
the file name (before the file extension) and create a new audit log file.
|
|
Kubernetes may delete old log files when creating a new log file; you can configure
|
|
how many files are retained and how old they can be by specifying the `audit-log-maxbackup`
|
|
and `audit-log-maxage` options.
|
|
-->
|
|
如果审核日志文件已经存在,则 Kubernetes 会将新的审核日志附加到该文件。
|
|
否则,Kubernetes 会在您在 `audit-log-path` 中指定的位置创建一个审计日志文件。
|
|
如果审计日志文件超过了您在 `audit-log-maxsize` 中指定的大小,则 Kubernetes 将通过在文件名(在文件扩展名之前)附加当前时间戳并重新创建一个新的审计日志文件来重命名当前日志文件。
|
|
Kubernetes 可能会在创建新的日志文件时删除旧的日志文件; 您可以通过指定 `audit-log-maxbackup` 和 `audit-log-maxage` 选项来配置保留多少文件以及它们的保留时间。
|
|
|
|
[kube-apiserver]: /docs/admin/kube-apiserver
|
|
[auditing-proposal]: https://github.com/kubernetes/community/blob/master/contributors/design-proposals/api-machinery/auditing.md
|
|
[auditing-api]: https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/staging/src/k8s.io/apiserver/pkg/apis/audit/v1beta1/types.go
|
|
[gce-audit-profile]: https://github.com/kubernetes/kubernetes/blob/{{< param "githubbranch" >}}/cluster/gce/gci/configure-helper.sh#L735
|
|
[kubeconfig]: /docs/tasks/access-application-cluster/configure-access-multiple-clusters/
|
|
[fluentd]: http://www.fluentd.org/
|
|
[fluentd_install_doc]: https://docs.fluentd.org/v/0.12/articles/quickstart#step1-installing-fluentd
|
|
[logstash]: https://www.elastic.co/products/logstash
|
|
[logstash_install_doc]: https://www.elastic.co/guide/en/logstash/current/installing-logstash.html
|
|
[kube-aggregator]: /docs/concepts/api-extension/apiserver-aggregation
|
|
|
|
{{% /capture %}}
|