From f4ac392cc09ba87bb56ff1e3151f02ce3686412f Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Fri, 3 Feb 2023 15:57:57 +0000 Subject: [PATCH] Update example manifests for Japanese Related to registry change, but also adopting any other changes from English upstream. --- .../ja/examples/admin/cloud/ccm-example.yaml | 14 ++-- .../admin/dns/dns-horizontal-autoscaler.yaml | 68 +++++++++++++++++-- .../two-files-counter-pod-agent-sidecar.yaml | 2 +- .../ja/examples/application/php-apache.yaml | 1 - .../application/zookeeper/zookeeper.yaml | 4 +- .../pods/inject/dapi-volume-resources.yaml | 1 - .../ja/examples/pods/inject/dapi-volume.yaml | 1 - .../pods/pod-configmap-env-var-valueFrom.yaml | 2 +- .../examples/pods/pod-with-node-affinity.yaml | 6 +- .../examples/pods/pod-with-pod-affinity.yaml | 2 +- .../ja/examples/pods/probe/http-liveness.yaml | 2 +- 11 files changed, 79 insertions(+), 24 deletions(-) diff --git a/content/ja/examples/admin/cloud/ccm-example.yaml b/content/ja/examples/admin/cloud/ccm-example.yaml index 6f3d115993..91b7ef2b89 100644 --- a/content/ja/examples/admin/cloud/ccm-example.yaml +++ b/content/ja/examples/admin/cloud/ccm-example.yaml @@ -1,4 +1,4 @@ -# This is an example of how to setup cloud-controller-manager as a Daemonset in your cluster. +# This is an example of how to set up cloud-controller-manager as a Daemonset in your cluster. # It assumes that your masters can run pods and has the role node-role.kubernetes.io/master # Note that this Daemonset will not work straight out of the box for your cloud, this is # meant to be a guideline. @@ -10,8 +10,8 @@ metadata: name: cloud-controller-manager namespace: kube-system --- -kind: ClusterRoleBinding apiVersion: rbac.authorization.k8s.io/v1 +kind: ClusterRoleBinding metadata: name: system:cloud-controller-manager roleRef: @@ -47,7 +47,7 @@ spec: image: registry.k8s.io/cloud-controller-manager:v1.8.0 command: - /usr/local/bin/cloud-controller-manager - - --cloud-provider= # Add your own cloud provider here! + - --cloud-provider=[YOUR_CLOUD_PROVIDER] # Add your own cloud provider here! - --leader-elect=true - --use-service-account-credentials # these flags will vary for every cloud provider @@ -59,9 +59,13 @@ spec: - key: node.cloudprovider.kubernetes.io/uninitialized value: "true" effect: NoSchedule - # this is to have the daemonset runnable on master nodes - # the taint may vary depending on your cluster setup + # these tolerations are to have the daemonset runnable on control plane nodes + # remove them if your control plane nodes should not run pods + - key: node-role.kubernetes.io/control-plane + operator: Exists + effect: NoSchedule - key: node-role.kubernetes.io/master + operator: Exists effect: NoSchedule # this is to restrict CCM to only run on master nodes # the node selector may vary depending on your cluster setup diff --git a/content/ja/examples/admin/dns/dns-horizontal-autoscaler.yaml b/content/ja/examples/admin/dns/dns-horizontal-autoscaler.yaml index fe50976460..3182fed3c8 100644 --- a/content/ja/examples/admin/dns/dns-horizontal-autoscaler.yaml +++ b/content/ja/examples/admin/dns/dns-horizontal-autoscaler.yaml @@ -1,22 +1,71 @@ +kind: ServiceAccount +apiVersion: v1 +metadata: + name: kube-dns-autoscaler + namespace: kube-system +--- +kind: ClusterRole +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: system:kube-dns-autoscaler +rules: + - apiGroups: [""] + resources: ["nodes"] + verbs: ["list", "watch"] + - apiGroups: [""] + resources: ["replicationcontrollers/scale"] + verbs: ["get", "update"] + - apiGroups: ["apps"] + resources: ["deployments/scale", "replicasets/scale"] + verbs: ["get", "update"] +# Remove the configmaps rule once below issue is fixed: +# kubernetes-incubator/cluster-proportional-autoscaler#16 + - apiGroups: [""] + resources: ["configmaps"] + verbs: ["get", "create"] +--- +kind: ClusterRoleBinding +apiVersion: rbac.authorization.k8s.io/v1 +metadata: + name: system:kube-dns-autoscaler +subjects: + - kind: ServiceAccount + name: kube-dns-autoscaler + namespace: kube-system +roleRef: + kind: ClusterRole + name: system:kube-dns-autoscaler + apiGroup: rbac.authorization.k8s.io + +--- apiVersion: apps/v1 kind: Deployment metadata: - name: dns-autoscaler + name: kube-dns-autoscaler namespace: kube-system labels: - k8s-app: dns-autoscaler + k8s-app: kube-dns-autoscaler + kubernetes.io/cluster-service: "true" spec: selector: matchLabels: - k8s-app: dns-autoscaler + k8s-app: kube-dns-autoscaler template: metadata: labels: - k8s-app: dns-autoscaler + k8s-app: kube-dns-autoscaler spec: + priorityClassName: system-cluster-critical + securityContext: + seccompProfile: + type: RuntimeDefault + supplementalGroups: [ 65534 ] + fsGroup: 65534 + nodeSelector: + kubernetes.io/os: linux containers: - name: autoscaler - image: registry.k8s.io/cluster-proportional-autoscaler-amd64:1.1.1 + image: registry.k8s.io/cpa/cluster-proportional-autoscaler:1.8.4 resources: requests: cpu: "20m" @@ -24,10 +73,15 @@ spec: command: - /cluster-proportional-autoscaler - --namespace=kube-system - - --configmap=dns-autoscaler + - --configmap=kube-dns-autoscaler + # Should keep target in sync with cluster/addons/dns/kube-dns.yaml.base - --target= # When cluster is using large nodes(with more cores), "coresPerReplica" should dominate. # If using small nodes, "nodesPerReplica" should dominate. - - --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"min":1}} + - --default-params={"linear":{"coresPerReplica":256,"nodesPerReplica":16,"preventSinglePointFailure":true,"includeUnschedulableNodes":true}} - --logtostderr=true - --v=2 + tolerations: + - key: "CriticalAddonsOnly" + operator: "Exists" + serviceAccountName: kube-dns-autoscaler diff --git a/content/ja/examples/admin/logging/two-files-counter-pod-agent-sidecar.yaml b/content/ja/examples/admin/logging/two-files-counter-pod-agent-sidecar.yaml index 1053cac577..a621a9fb2a 100644 --- a/content/ja/examples/admin/logging/two-files-counter-pod-agent-sidecar.yaml +++ b/content/ja/examples/admin/logging/two-files-counter-pod-agent-sidecar.yaml @@ -5,7 +5,7 @@ metadata: spec: containers: - name: count - image: busybox + image: busybox:1.28 args: - /bin/sh - -c diff --git a/content/ja/examples/application/php-apache.yaml b/content/ja/examples/application/php-apache.yaml index d29d2b9159..a194dce6f9 100644 --- a/content/ja/examples/application/php-apache.yaml +++ b/content/ja/examples/application/php-apache.yaml @@ -6,7 +6,6 @@ spec: selector: matchLabels: run: php-apache - replicas: 1 template: metadata: labels: diff --git a/content/ja/examples/application/zookeeper/zookeeper.yaml b/content/ja/examples/application/zookeeper/zookeeper.yaml index 4037f83dc8..0f3f6cf9d1 100644 --- a/content/ja/examples/application/zookeeper/zookeeper.yaml +++ b/content/ja/examples/application/zookeeper/zookeeper.yaml @@ -27,7 +27,7 @@ spec: selector: app: zk --- -apiVersion: policy/v1beta1 +apiVersion: policy/v1 kind: PodDisruptionBudget metadata: name: zk-pdb @@ -49,7 +49,7 @@ spec: replicas: 3 updateStrategy: type: RollingUpdate - podManagementPolicy: Parallel + podManagementPolicy: OrderedReady template: metadata: labels: diff --git a/content/ja/examples/pods/inject/dapi-volume-resources.yaml b/content/ja/examples/pods/inject/dapi-volume-resources.yaml index 9162b602f8..5b52bf8448 100644 --- a/content/ja/examples/pods/inject/dapi-volume-resources.yaml +++ b/content/ja/examples/pods/inject/dapi-volume-resources.yaml @@ -30,7 +30,6 @@ spec: volumeMounts: - name: podinfo mountPath: /etc/podinfo - readOnly: false volumes: - name: podinfo downwardAPI: diff --git a/content/ja/examples/pods/inject/dapi-volume.yaml b/content/ja/examples/pods/inject/dapi-volume.yaml index 78bad5e001..682098d27f 100644 --- a/content/ja/examples/pods/inject/dapi-volume.yaml +++ b/content/ja/examples/pods/inject/dapi-volume.yaml @@ -25,7 +25,6 @@ spec: volumeMounts: - name: podinfo mountPath: /etc/podinfo - readOnly: false volumes: - name: podinfo downwardAPI: diff --git a/content/ja/examples/pods/pod-configmap-env-var-valueFrom.yaml b/content/ja/examples/pods/pod-configmap-env-var-valueFrom.yaml index c5c66daea1..fa172abd37 100644 --- a/content/ja/examples/pods/pod-configmap-env-var-valueFrom.yaml +++ b/content/ja/examples/pods/pod-configmap-env-var-valueFrom.yaml @@ -6,7 +6,7 @@ spec: containers: - name: test-container image: registry.k8s.io/busybox - command: [ "/bin/sh", "-c", "echo $(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ] + command: [ "/bin/echo", "$(SPECIAL_LEVEL_KEY) $(SPECIAL_TYPE_KEY)" ] env: - name: SPECIAL_LEVEL_KEY valueFrom: diff --git a/content/ja/examples/pods/pod-with-node-affinity.yaml b/content/ja/examples/pods/pod-with-node-affinity.yaml index 549546dbf3..5fedc554bf 100644 --- a/content/ja/examples/pods/pod-with-node-affinity.yaml +++ b/content/ja/examples/pods/pod-with-node-affinity.yaml @@ -8,11 +8,11 @@ spec: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - - key: kubernetes.io/e2e-az-name + - key: topology.kubernetes.io/zone operator: In values: - - e2e-az1 - - e2e-az2 + - antarctica-east1 + - antarctica-west1 preferredDuringSchedulingIgnoredDuringExecution: - weight: 1 preference: diff --git a/content/ja/examples/pods/pod-with-pod-affinity.yaml b/content/ja/examples/pods/pod-with-pod-affinity.yaml index f5297b2656..1a4fd74fd7 100644 --- a/content/ja/examples/pods/pod-with-pod-affinity.yaml +++ b/content/ja/examples/pods/pod-with-pod-affinity.yaml @@ -23,7 +23,7 @@ spec: operator: In values: - S2 - topologyKey: kubernetes.io/hostname + topologyKey: topology.kubernetes.io/zone containers: - name: with-pod-affinity image: registry.k8s.io/pause:2.0 diff --git a/content/ja/examples/pods/probe/http-liveness.yaml b/content/ja/examples/pods/probe/http-liveness.yaml index 92e2fc5d96..48ca861c14 100644 --- a/content/ja/examples/pods/probe/http-liveness.yaml +++ b/content/ja/examples/pods/probe/http-liveness.yaml @@ -15,7 +15,7 @@ spec: path: /healthz port: 8080 httpHeaders: - - name: X-Custom-Header + - name: Custom-Header value: Awesome initialDelaySeconds: 3 periodSeconds: 3