0

I have a k8s cluster and I have to update metrics-server (in the kube-system) namespace. I've tried to:

kubectl apply -n kube-system -f my-updated-metrics-server.yaml

and

kubectl replace -n kube-system -f my-updated-metrics-server.yaml

without success. What happens is that the deployment gets updated but then after a while (10-15 min), it gets to the previous status (before the apply/replace commands).

any thoughts?

UPDATED (as requested)

$ kubectl get ns |grep -iE 'argo|flux'
$
Kasper
  • 685
  • 2
  • 11
  • 30
  • can you add output of `kubectl get ns |grep -iE 'argo|flux'` to the question ? – P.... Feb 07 '23 at 20:32
  • done. but what is that for? – Kasper Feb 07 '23 at 20:36
  • Looking for namespaces matching `argo` and `flux` doesn't tell you whether or not the cluster is managed using one of these tools -- e.g., we manage multiple clusters with a single instance of ArgoCD, so there's no "argocd" namespace on any of the managed clusters. And on the cluster actually running ArgoCD, the namespace is "openshift-gitops". That's all just a long-winded way of saying that it *looks* as if your deployment may be managed using some automated tooling; do you know how it was originally applied? Do you have any sort of CD/gitops workflow that deploys manifests to your cluster? – larsks Feb 07 '23 at 20:45
  • @larsks makes sense; I did some oversight here – P.... Feb 07 '23 at 20:47
  • oh yes, I use helm chart @larks – Kasper Feb 07 '23 at 20:52
  • A helm chart won't normally cause automatic replacement...unless you have some sort of automated workflow that is re-deploying the chart periodically. But if you're deploying with a Helm chart, you're generally better off updating the chart and re-installing it rather than trying to patch the generated resources. – larsks Feb 07 '23 at 20:53

0 Answers0