Skip to content

Commit

Permalink
aks: use special kubelet/os config for granny deployments
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Apr 17, 2024
1 parent d7e1a0a commit d4e4b11
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions config/granny_aks_kubelet_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "allowedUnsafeSysctls": ["net.*"] }
13 changes: 13 additions & 0 deletions config/granny_aks_os_config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"sysctls": {
"netCoreRmemMax": 16777216,
"netCoreWmemMax": 16777216,
"netIpv4TcpRmem": "4096 87380 16777216",
"netIpv4TcpWmem": "4096 65536 16777216",
"netCoreNetdevMaxBacklog": "30000",
"netCoreRmemDefault": 16777216,
"netCoreWmemDefault": 16777216,
"netIpv4TcpMem": "16777216 16777216 16777216",
"netIpv4RouteFlush": 1
}
}
15 changes: 15 additions & 0 deletions tasks/cluster.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from invoke import task
from os.path import join
from subprocess import run
from tasks.util.env import (
AZURE_ACR_NAME,
Expand All @@ -8,6 +9,7 @@
AZURE_K8S_VM_SIZE,
AZURE_PUB_SSH_KEY,
AZURE_RESOURCE_GROUP,
CONFIG_DIR,
KUBECTL_BIN,
)
from tasks.util.version import get_k8s_version
Expand Down Expand Up @@ -46,12 +48,15 @@ def provision(
location=AZURE_K8S_REGION,
name=AZURE_K8S_CLUSTER_NAME,
sgx=False,
granny=True,
):
"""
Provision the AKS cluster
"""
k8s_ver = get_k8s_version()
sgx = sgx and (sgx.lower() != "false")
granny_kubelet_config = join(CONFIG_DIR, "granny_aks_kubelet_config.json")
granny_os_config = join(CONFIG_DIR, "granny_aks_os_config.json")

if sgx and "Standard_DC" not in vm:
print(
Expand All @@ -70,6 +75,16 @@ def provision(
"--ssh-key-value {}".format(AZURE_PUB_SSH_KEY),
"--location {}".format(location),
"--attach-acr {}".format(AZURE_ACR_NAME.split(".")[0]),
"{}".format(
"--kubelet-config {}".format(granny_kubelet_config)
if granny
else ""
),
"{}".format(
"--linux-os-config {}".format(granny_os_config)
if granny
else ""
),
"{}".format(
"--enable-addons confcom --enable-sgxquotehelper"
if sgx
Expand Down
1 change: 1 addition & 0 deletions tasks/util/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

BIN_DIR = join(PROJ_ROOT, "bin")
GLOBAL_BIN_DIR = "/usr/local/bin"
CONFIG_DIR = join(PROJ_ROOT, "config")

K9S_VERSION = "0.32.2"

Expand Down

0 comments on commit d4e4b11

Please sign in to comment.