#!/bin/bash
# ================================================================
# Copyright (C) 2022 www.361way.com site All rights reserved.
#
# Filename :a.sh
# Author :yangbk <itybku@139.com>
# Create Time :2022-10-18 10:31
# Description :
# ================================================================
for (( i = 0; i < 10; i++ )); do
#statements
echo $i
let port=$i+30000
echo $port
# replace the variable in the YAML file , and then running the kubectl commmand
kubectl apply -f template.yaml
done

Remember to check for updates!