Fix metrics server resource allocation (#2955)

This commit is contained in:
Dotan Simha 2023-09-26 15:13:00 +03:00 committed by GitHub
parent 031fac3e85
commit 28ef158efb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,30 @@
import * as k8s from '@pulumi/kubernetes';
export function optimizeAzureCluster() {
/**
* The following configures the metrics server to use the correct resources limit:
* https://learn.microsoft.com/en-us/azure/aks/use-metrics-server-vertical-pod-autoscaler
*/
new k8s.core.v1.ConfigMap('metrics-server-config', {
metadata: {
name: 'metrics-server-config',
namespace: 'kube-system',
labels: {
'kubernetes.io/cluster-service': 'true',
'addonmanager.kubernetes.io/mode': 'EnsureExists',
},
},
data: {
NannyConfiguration: `
apiVersion: nannyconfig/v1alpha1
kind: NannyConfiguration
baseCPU: 200m
cpuPerNode: 3m
baseMemory: 200Mi
memoryPerNode: 24Mi`,
},
});
/**
* The following disabled Azure logging. We are not really using it.
*/