Skip to content

Instantly share code, notes, and snippets.

@mehmetaydogduu
Last active August 7, 2023 15:56
Show Gist options
  • Save mehmetaydogduu/865512765f1697ba706174f45cb944b0 to your computer and use it in GitHub Desktop.
Save mehmetaydogduu/865512765f1697ba706174f45cb944b0 to your computer and use it in GitHub Desktop.
infinite-calls.yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: infinite-calls
labels:
app: infinite-calls
spec:
replicas: 1
selector:
matchLabels:
app: infinite-calls
template:
metadata:
name: infinite-calls
labels:
app: infinite-calls
spec:
containers:
- name: infinite-calls
image: busybox
command:
- /bin/sh
- -c
- "while true; do wget -q -O- http://php-apache; done"
# https://www.techtarget.com/searchitoperations/tutorial/Kubernetes-performance-testing-tutorial-Load-test-a-cluster
sudo yum install openssl
curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 > get_helm.sh
chmod 700 get_helm.sh
./get_helm.sh
kubectl apply -f https://github.com/kubernetes-sigs/metrics-server/releases/latest/download/components.yaml
kubectl get deployment metrics-server -n kube-system
minikube addons enable metrics-server
kubectl apply -f https://k8s.io/examples/application/php-apache.yaml
kubectl get pods
kubectl autoscale deployment php-apache --cpu-percent=80 --min=1 --max=4
kubectl get hpa
kubectl get hpa -w
kubectl describe hpa
kubectl apply -f https://gist.githubusercontent.com/mehmetaydogduu/865512765f1697ba706174f45cb944b0/raw/19f292cd6e33a258f2901d4ef1bc09778d5a6a79/f.yaml
kubectl get pods
kubectl scale deployment/infinite-calls --replicas 4
kubectl exec -it <container name> sh
ps
kubectl get services
kubectl port-forward svc/php-apache 80:80
kubectl scale deployment/infinite-calls --replicas 4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment