You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 02_kubernetes_intro_for_infra_teams/Readme.md
+68Lines changed: 68 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -662,6 +662,74 @@ The IP address returned is the external IP address of the cluster, which is the
662
662
663
663
>Note that you can control egress traffic using Network Policies or by configuring an `Azure Firewall` or `NAT Gateway`.
664
664
665
+
## Scaling the application
666
+
667
+
Kubernetes allows you to scale your applications up or down easily. You can scale your application by changing the number of replicas in the Deployment resource.
668
+
669
+
To scale the Inspectorgadget application to 5 replicas, you can run the following command:
Note that autoscaling will hit the limits allowed by `max pods per node`.
711
+
712
+
```sh
713
+
kubectl get nodes -o=jsonpath='{.items[*].status.allocatable.pods}'
714
+
# 110
715
+
```
716
+
717
+
This should trigger the cluster autoscaler to add more nodes to the cluster to accommodate the new Pods. The cluster autoscaler will monitor the resource usage and scale the cluster up or down based on the demand.
718
+
719
+
Check the number of nodes in the cluster:
720
+
721
+
```sh
722
+
kubectl get nodes
723
+
```
724
+
725
+
Note how new nodes are being created.
726
+
727
+
## Auto scaling the cluster
728
+
729
+
You can manually set up the number of nodes on the cluster or you can enable the cluster autoscaler to automatically scale the number of nodes in the cluster based on the resource usage.
730
+
731
+
Explore these features in the Azure portal or using the Azure CLI. You can set the minimum and maximum number of nodes in the node pool, and the cluster autoscaler will automatically add or remove nodes based on the resource usage of the Pods in the cluster.
732
+
665
733
## Getting container logs
666
734
667
735
You can view the logs of a container running in a Pod using the `kubectl logs` command. For example, to view the logs of the Nginx container in the `nginx` Pod, you can run the following command:
0 commit comments