deployment icon indicating copy to clipboard operation
deployment copied to clipboard

kubernetes rollback to kube-dns doesn't work on k8s 1.16.2

Open fenidik opened this issue 6 years ago • 2 comments

./rollback.sh | kubectl apply -f -

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6904  100  6904    0     0  18312      0 --:--:-- --:--:-- --:--:-- 18312
Warning: kubectl apply should be used on resource created by either kubectl create --save-config or kubectl apply
service/kube-dns configured
serviceaccount/kube-dns created
configmap/kube-dns created
Error from server (BadRequest): error when creating "STDIN": Deployment in version "v1" cannot be handled as a Deployment: v1.Deployment.Spec: v1.DeploymentSpec.Template: v1.PodTemplateSpec.Spec: v1.PodSpec.Containers: []v1.Container: v1.Container.Resources: v1.ResourceRequirements.Requests: Limits: unmarshalerDecoder: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$', error found in #10 byte of ...|__LIMIT__"},"request|..., bigger context ...|limits":{"memory":"__PILLAR__DNS__MEMORY__LIMIT__"},"requests":{"cpu":"100m","memory":"70Mi"}},"secu|...

kubectl version

Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.8", GitCommit:"211047e9a1922595eaa3a1127ed365e9299a6c23", GitTreeState:"clean", BuildDate:"2019-10-15T12:11:03Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.2", GitCommit:"c97fe5036ef3df2967d086711e6c0c405941e14b", GitTreeState:"clean", BuildDate:"2019-10-15T19:09:08Z", GoVersion:"go1.12.10", Compiler:"gc", Platform:"linux/amd64"}

fenidik avatar Jan 17 '20 14:01 fenidik

seems because of __PILLAR__DNS__MEMORY__LIMIT__ in https://raw.githubusercontent.com/kubernetes/kubernetes/master/cluster/addons/dns/kube-dns/kube-dns.yaml.base

fenidik avatar Jan 17 '20 14:01 fenidik

Yeah, the line ..

https://github.com/coredns/deployment/blob/abfaf3277258ebc1b95e59ff180b7e184769ec7d/kubernetes/rollback.sh#L46

... needs to be updated - but not sure what value would go in there to replace it.

That the script appears to be pulling the latest template from master, and not the one from the version of k8s that is installed is potentially problematic. Instead, perhaps, deploy.sh should save the old deployment to a local file, then rollback can simply roll back to that.

chrisohaver avatar Jan 17 '20 14:01 chrisohaver

Closing, since the kube-dns migration scripts have been deprecated.

chrisohaver avatar Aug 11 '23 18:08 chrisohaver