Template export --> apply --> with kubectl get -o yaml or helm

good morning i hope you can help me get up to speed quickly on kubernets.

Please answer the following questions

A1) the command kubectl get -o yaml gives me the configuration. Unfortunately the output already contains values and additional information

Now my question is there a way to convert this output so that I can use it as a templet for kubectl apply -f

E.g. I want to export a deployment change the name and container and apply again.

do you have experience with this maybe with kubectl or helm

A2: Do you know a way to define a replicaset and deployment for an already running pod ? I would like to add an existing running pod into a RS or deployment.
Or i would like to define a rs and deployment for the pod afterwards

At the moment I think I have to change matchLabels: or


The output from -o yaml shows you the current state of the objects in your cluster. There’s really quite a bit to this.

This section of the documentation details information about manifests and kustomize, which is a core dependency for working with something like helm.

If you’re just starting off with Kubernetes, I recommend getting familiar with the types of workloads, going through the section on the left side menu.

After workloads, learning about you’re capable of deploying running apps into Kubernetes. From here I would recommend going through the rest of the concepts section. If you would like to focus on some specific things in order, I would prioritize like this: ConfigMaps. Secrets, Services, and then figure out PersistentVolumeClaims.

For all of this, understanding how kubectl works is probably important too.