修改pod配置文件
[root@node-1-bak 10-statefulset]# kubectl edit pod/kube-apiserver-node-1-bak -n kube-system
- --insecure-port=8080
保存后报错:
# pods "kube-apiserver-node-1-bak" was not valid:
# * spec: Forbidden: pod updates may not change fields other than `spec.containers[*].image`, `spec.initContainers[*].image`, `spec.activeDeadlineSeconds` or `spec.tolerations` (only additions to existing tolerations)
# core.PodSpec{
# Volumes: []core.Volume{{Name: "ca-certs", VolumeSource: core.VolumeSource{HostPath: &core.HostPathVolumeSource{Path: "/etc/ssl/certs", Type: &"DirectoryOrCreate"}}}, {Name: "etc-pki", VolumeSource: core.VolumeSource{HostPath: &core.HostPathVolumeSource{Path: "/etc/pki", Type: &"DirectoryOrCreate"}}}, {Name: "etc-pki-ca-trust", VolumeSource: core.VolumeSource{HostPath: &core.HostPathVolumeSource{Path: "/etc/pki/ca-trust", Type: &""}}}, {Name: "etc-pki-tls", VolumeSource: core.VolumeSource{HostPath: &core.HostPathVolumeSource{Path: "/etc/pki/tls", Type: &""}}}, {Name: "etcd-certs-0", VolumeSource: core.VolumeSource{HostPath: &core.HostPathVolumeSource{Path: "/etc/ssl/etcd/ssl", Type: &"DirectoryOrCreate"}}}, {Name: "k8s-certs", VolumeSource: core.VolumeSource{HostPath: &core.HostPathVolumeSource{Path: "/etc/kubernetes/ssl", Type: &"DirectoryOrCreate"}}}},
# InitContainers: nil,
# Containers: []core.Container{
# {
# Name: "kube-apiserver",
# Image: "k8s.gcr.io/kube-apiserver:v1.19.7",
# Command: []string{
# ... // 17 identical elements
# "--event-ttl=1h0m0s",
# - "--insecure-port=8080",
# + "--insecure-port=0",
# "--kubelet-client-certificate=/etc/kubernetes/ssl/apiserver-kubelet-client.crt",
# "--kubelet-client-key=/etc/kubernetes/ssl/apiserver-kubelet-client.key",
# ... // 17 identical elements
# },
# Args: nil,
# WorkingDir: "",
# ... // 17 identical fields
# },
# },
# EphemeralContainers: nil,
# RestartPolicy: "Always",
# ... // 25 identical fields
# }
这个要怎么办呢?先停掉在重新创建么?