I was handed a Kubernetes cluster with no config files, and was not setup with helm. The author said they just created everything from the cmd line. It is a small/new cluster for a single API server with an nginx ingress controller. I know enough of Kubernetes to get around and was able to add a new web server, but now I need to get in deeper and update existing configs. Specifically, I want to enable prometheus metrics on the nginx controller, but I don't want to break anything.
Is there a standard way to retrieve the existing configurations (deployments, services, etc) from the cluster, make modifications, and apply them? Or is there a way to patch in updates to individual parts of the existing configuration without having to create a new yaml file?
I understand I can get the current config with something like this:
kubectl get services -n nginx -o yaml That output has additional fields like creationTimestamp, uid, etc, that I suppose I need to remove. Or can I just save the output exactly as is to a yaml file, make my modifications to enable prometheus, and then apply the config back to the controller? Will it ignore the kube-created fields? Is there a different approach I should be considering?
Secondly, should I store these configurations in a repository, or is this just how things are done?