Kubernetes up storage for a pod

4/13/2018

My pod jenkins nexus pod has run out of disk space and I need to up the persistent volume claim.

I can see the yaml file for this in the kubernetes dashboard, however when I try to change it I get - PersistentVolumeClaim "jenkins-x-nexus" is invalid: spec: Forbidden: field is immutable after creation

Deleting the pod and quickly trying to update the yaml doesn't work either.

Our version of kubernetes (1.8) doens't have kubectl stop, so is there a way to stop the replication controller in order to change the yaml?

-- Kaigo
google-kubernetes-engine
kubernetes

1 Answer

4/13/2018

Our version of kubernetes (1.8) doens't have kubectl stop, so is there a way to stop the replication controller in order to change the yaml?

You can scale RC to 0, and it will stop spawning pods.

I can see the yaml file for this in the kubernetes dashboard, however when I try to change it I get - PersistentVolumeClaim "jenkins-x-nexus" is invalid: spec: Forbidden: field is immutable after creation

That message means that you cannot change the size of your volume. There are several tickets on GitHub about that limitation, and regarding different types of volumes, that one for example.

So, to change size, you need to create a new bigger PVC and somehow migrate your data from old volume to the new one.

-- Anton Kostenko
Source: StackOverflow