## 2 Fuzzy-Based Horizontal Scaling Proposal
The inputs \(x^{\text{rp}}(n)\) and \(x^{\text{rp}}(n)\) both have five membership functions in the triangular form, which are uniformly distributed between 0 and 1. The input \(m^{\text{p}}(n)\) has three membership functions, with trapezoidal shapes at the ends and a triangular function in the center uniformly distributed between 1 and \(m^{\text{p}}\text{max}\). The graphical representation of these membership functions can be observed in Figures 2-4. For the membership functions associated with the variable \(m^{\text{p}}(n)\), Figure 4 shows an  
The output \(d(n)\) is represented by seven membership functions, with trapezoidal shapes at the ends and triangular functions for the rest of the interval. These membership functions represent the different possibilities for incrementing or decrementing the number of replicas of the application. Figure 5 illustrates the membership functions used for \(d(n)\) for the case where \(k=5\). The linguistic terms associated with the membership functions of the variables \(x^{\mathrm{cpu}}(n)\) and \(x^{\mathrm{rp}}(n)\) are the same as illustrated in Figures 2 and 3: Very Low (VL), Low (L), Mean (M), High (H), and Very High (VH). The variable \(m^{\mathrm{P}}(n)\) uses the terms Low (L), Mean (M), and High (H) for its functions; see Figure 4. In the case of the output variable \(d(n)\), the linguistic terms are High Decrement (HD), Mean Decrement (MD), Low Decrement (LD), Zero (Z), Low Increment (LI), Mean Increment (MI), and High Increment (HI). The FHS fuzzy inference machine makes use of 75 production rules, which are presented in detail in Table 1.  
The fuzzy decision rules used in the FHS system were carefully crafted based on expert knowledge and understanding of the system's dynamics. These rules were designed to capture the essential behaviors and interactions within the K8s environment under various load conditions. While there are many rules, each plays a specific role in ensuring precise and responsive scaling decisions. The rules were generated through iterative testing and validation to ensure they effectively manage the loa  
Figure 4: Membership functions associated with the number of replicas \(m^{\mathrm{P}}(n)\); in this example, \(m^{\mathrm{P}}_{\mathrm{max}}=20\). Figure 5: Membership functions associated with the output variable \(d(n)\) representing the increase in the number of replicas of the application (\(k=5\)). \begin{table}
\begin{tabular}{r l} \hline \hline
**Number** & **Rule** \\ \hline  
Figure 6 uses a mosaic-type diagram to illustrate the mapping between input and output of the FCS for various values; these are uniformly distributed between 0 and 1 for the variables \(x^{\mathrm{cpu}}(n)\) and \(x^{\mathrm{rp}}(n)\) and between 1 and \(m^{\mathrm{p}}_{\mathrm{max}}=20\) for the variable \(m^{\mathrm{P}}(n)\). In the figure, the value of the output variable \(d(n)\) is rounded (\(\lfloor d(n)\rceil\)). For the fuzzy inference process, we use the minimum criterion for the AND operation (implication) and the maximum criterion for generating outputs. The fuzzy rules are applied using minimum implication, where the minimum value of the inputs determines the degree of rule activation. All conditions must be met to at least the minimum degree specified in order for a rule to be activated. When the rules are activated, their outputs are combined using the maximum criterion. This aggregation step takes the maximum value from the outputs of all activated rules, ensuring that the most significant contributions are considered in the final decision-making process. Finally, the defuzzification process is performed using the centroid method, which calculates the center of mass of the resulting fuzzy set to obtain a precise output value. This output value adjusts the system's number of replicas (pods). By employing the centroid method, the FHS system can provide a balanced and accurate representation of the fuzzy set, which translates into more precise and efficient scaling decisions.