Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{AKS} add support for updating kube-proxy configuration #5545

Merged
merged 6 commits into from
Nov 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/aks-preview/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Pending
+++++++

* Add custom transform for custom CA
* Support updating kube-proxy configuration with `az aks update --kube-proxy-config file.json`.

0.5.116
+++++++
Expand Down
3 changes: 3 additions & 0 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,9 @@
- name: --http-proxy-config
type: string
short-summary: HTTP Proxy configuration for this cluster.
- name: --kube-proxy-config
type: string
short-summary: kube-proxy configuration for this cluster.
- name: --enable-azure-keyvault-kms
type: bool
short-summary: Enable Azure KeyVault Key Management Service.
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ def load_arguments(self, _):
c.argument('load_balancer_backend_pool_type', validator=validate_load_balancer_backend_pool_type)
c.argument('nat_gateway_managed_outbound_ip_count', type=int, validator=validate_nat_gateway_managed_outbound_ip_count)
c.argument('nat_gateway_idle_timeout', type=int, validator=validate_nat_gateway_idle_timeout)
c.argument('kube_proxy_config')
c.argument('auto_upgrade_channel', arg_type=get_enum_type(auto_upgrade_channels))
c.argument('cluster_autoscaler_profile', nargs='+', options_list=["--cluster-autoscaler-profile", "--ca-profile"],
help="Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.")
Expand Down
1 change: 1 addition & 0 deletions src/aks-preview/azext_aks_preview/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -729,6 +729,7 @@ def aks_update(
load_balancer_backend_pool_type=None,
nat_gateway_managed_outbound_ip_count=None,
nat_gateway_idle_timeout=None,
kube_proxy_config=None,
auto_upgrade_channel=None,
cluster_autoscaler_profile=None,
uptime_sla=False,
Expand Down
18 changes: 18 additions & 0 deletions src/aks-preview/azext_aks_preview/managed_cluster_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2852,6 +2852,22 @@ def update_http_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:
mc.http_proxy_config = self.context.get_http_proxy_config()
return mc

def update_kube_proxy_config(self, mc: ManagedCluster) -> ManagedCluster:
"""Update kube proxy config for the ManagedCluster object.

:return: the ManagedCluster object
"""
self._ensure_mc(mc)

if not mc.network_profile:
raise UnknownError(
"Unexpectedly get an empty network profile in the process of updating kube-proxy config."
)

mc.network_profile.kube_proxy_config = self.context.get_kube_proxy_config()

return mc

def update_pod_security_policy(self, mc: ManagedCluster) -> ManagedCluster:
"""Update pod security policy for the ManagedCluster object.

Expand Down Expand Up @@ -3228,5 +3244,7 @@ def update_mc_profile_preview(self) -> ManagedCluster:
mc = self.update_linux_profile(mc)
# update outbound type
mc = self.update_outbound_type_in_network_profile(mc)
# update kube proxy config
mc = self.update_kube_proxy_config(mc)

return mc
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
"enabled": true,
"mode": "IPVS",
"ipvsConfig": {
"scheduler": "LeastConnection"
}
"mode": "IPTABLES"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"enabled": true,
"mode": "IPVS",
"ipvsConfig": {
"scheduler": "LeastConnection"
}
}

Large diffs are not rendered by default.

Loading