apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
  name: microblog-hpa # horizontal pod autoscaling
spec:
  maxReplicas: 5 # define max replica count
  minReplicas: 1  # define min replica count
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: microblog
  targetCPUUtilizationPercentage: 20 # target CPU utilization


# https://docs.microsoft.com/en-us/azure/aks/tutorial-kubernetes-scale?tabs=azure-cli
# https://www.tutorialspoint.com/apache_bench/apache_bench_quick_guide.htm


# kan manuellt sätta upp 3 noders.
# kubectl scale --replicas=3 deployment/microblog
# kubectl get pods
# kubectl scale --replicas=2 deployment/microblog
# kubectl get pods

# aktivera automatisk scaling
# kubectl apply -f 08-autoscale.yml
# kubectl get pods
# kubectl get hpa


# logga in och plocka fram session från nätverk och coockies.
# ab -kn 10000 -c 1000  \
# -C session=.eJwljktqA0EMRO_Say8ktVofX2boj0SCQwIzySr47m5w7argFe-_HHnG9VHu2b-uuJXjc5V7SVYX6o7eU9ByGBB3pV4R2FJWaxGo1MSVe51qnXqGq4JxBY00r00gwwB3YtIQ6ZPQwEdO4yZLU32gS8jE1aYvz2quS1aWLfJ3xfm2wV3ndebx-_OI7z1sMvZdKjkZBlCrFQbzhMpavfliV4Qszxdx_j2f.Yaov-g.PwZ3-drlHZP99LI9cLKWyUJJhY8 \
# https://arnesson.tech/explore

# kolla att saker ökar


# nämner 4 olika sätt att scale https://2bcloud.io/azure-auto-scaling-why-and-how/
