Skip to content

Instantly share code, notes, and snippets.

@stnet253
Last active December 7, 2020 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stnet253/cf311e6cbf0b7c899a1c8ec69240a3ab to your computer and use it in GitHub Desktop.
Save stnet253/cf311e6cbf0b7c899a1c8ec69240a3ab to your computer and use it in GitHub Desktop.
sh add_hap.sh 3001
.
├── README
└── sh
├── add_hap.sh
├── game-gs3001-hpa.yaml
└── tmp
└── game-gsxxxx-hpa.yaml
2 directories, 4 files
#!/bin/bash
if [ -n "$1" ];then
cp ./tmp/game-gsxxxx-hpa.yaml game-gs$1-hpa.yaml
sed -i '' "s/xxxx/$1/g" game-gs$1-hpa.yaml
else
echo "It's NULL,Please key in config gorup"
echo "$0 3001 "
fi
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
name: game-gsxxxx-hpa
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: game-gsxxxx
minReplicas: 1
maxReplicas: 2
targetCPUUtilizationPercentage: 80
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment