DEV Community

Cover image for Limitations on config updates
Rohith V
Rohith V

Posted on

1 1

Limitations on config updates

Sample Scenario

Is it possible to make any change to the config file which is having a kind: Pod and use kubectl to that file, well lets see what happens if we try to change the container port.

We are having a config file named client-pod.yml file.

apiVersion: v1
kind: Pod
metadata:
  name: client-pod
  labels:
    component: web
spec:
  containers:
    - name: client
      image: some image name
      ports:
        - containerPort: 3000
Enter fullscreen mode Exit fullscreen mode

Now I update the containerPort field to 9999

apiVersion: v1
kind: Pod
metadata:
  name: client-pod
  labels:
    component: web
spec:
  containers:
    - name: client
      image: some image name
      ports:
        - containerPort: 9999
Enter fullscreen mode Exit fullscreen mode

After changing the port and if we feed this config into kubectl, kubectl apply -f client-pod.yml, the output will be as follows :

2

Yes we will be getting an error saying we can't change the fields other than the fields mentioned in the terminal, so in our case we cannot change the container port.

Conclusion

Limitations on Updating Config file
Can only change spec.containers[*].image
Can only change spec.initContainers[*].image
Can only change spec.activeDeadlineSeconds
Can only change spec.tolerations

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post →

Top comments (0)

AWS Q Developer image

Your AI Code Assistant

Implement features, document your code, or refactor your projects.
Built to handle large projects, Amazon Q Developer works alongside you from idea to production code.

Get started free in your IDE