Olá pessoal! Estou com esse problema aqui ao inserir a porta ao Pod.
pod-02.yaml
apiVersion: v1
kind: Pod
metadata:
name: pod-2
labels:
app: segundo-pod
spec:
containers:
- name: container-pod-2
image: nginx:latest
ports:
- containerPort: 80
Segue o erro:
The Pod "pod-2" is invalid: 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: "default-token-5hcr7", VolumeSource: core.VolumeSource{Secret: &core.SecretVolumeSource{SecretName: "default-token-5hcr7", DefaultMode: &420}}}},
InitContainers: nil,
Containers: []core.Container{
{
- Name: "container-pod-2",
+ Name: "pod-2",
Image: "nginx:latest",
Command: nil,
Args: nil,
WorkingDir: "",
- Ports: []core.ContainerPort{{ContainerPort: 80, Protocol: "TCP"}},
+ Ports: nil,
EnvFrom: nil,
Env: nil,
Resources: core.ResourceRequirements{},
- VolumeMounts: nil,
+ VolumeMounts: []core.VolumeMount{
+ {
+ Name: "default-token-5hcr7",
+ ReadOnly: true,
+ MountPath: "/var/run/secrets/kubernetes.io/serviceaccount",
+ },
+ },
VolumeDevices: nil,
LivenessProbe: nil,
... // 10 identical fields
},
},
EphemeralContainers: nil,
RestartPolicy: "Always",
... // 25 identical fields
}