Perhaps I can clarify a bit.
Assuming you only have a single node what you are seeing with unallocated replicas is normal behavior AND you are not actually required to fix anything but you will see Yellow health.
What @HiteshSingh suggested was to set the replicas to 0 on existing indices not the template which will be used when new indices are created. It looks like You tried to apply the setting to the template
.. which you can but will need to use the correct syntax
From what it looks to me you are using metricbeat and agent , these have built in built template s.
All in all your cluster and replicas are operating as the should and really the Yellow status is to remind you that with only one node you could have data loss.
Perhaps take a look at this thread
Hope this helps