you can just run with –dry-run=client option to generate yaml file. Which is then you can add any other elements or delete
if you pass –env variables in the command even that also will added to the yaml file .
run –env env=prod nginx –image=nginx –dry-run=client -o yaml
root@master:/tmp# k run --env env=prod nginx --image=nginx --dry-run=client -o yaml
apiVersion: v1
kind: Pod
metadata:
creationTimestamp: null
labels:
run: nginx
name: nginx
spec:
containers:
- env:
- name: env
value: prod
image: nginx
name: nginx
resources: {}
dnsPolicy: ClusterFirst
restartPolicy: Always
status: {}
root@master:/tmp#