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} Update v2 managed cluster decorator - part 3 #4989

Merged
merged 9 commits into from
Jun 15, 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
27 changes: 15 additions & 12 deletions src/aks-preview/azext_aks_preview/_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,9 +190,6 @@
- name: --disable-rbac
type: bool
short-summary: Disable Kubernetes Role-Based Access Control.
- name: --enable-rbac -r
type: bool
short-summary: "Enable Kubernetes Role-Based Access Control. Default: enabled."
- name: --max-pods -m
type: int
short-summary: The maximum number of pods deployable to a node.
Expand Down Expand Up @@ -263,9 +260,6 @@
- name: --max-count
type: int
short-summary: Maximum nodes count used for autoscaler, when "--enable-cluster-autoscaler" specified. Please specify the value in the range of [1, 1000].
- name: --cluster-autoscaler-profile
type: list
short-summary: Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.
- name: --vm-set-type
type: string
short-summary: Agent pool vm set type. VirtualMachineScaleSets or AvailabilitySet.
Expand Down Expand Up @@ -324,9 +318,6 @@
- name: --appgw-name
type: string
short-summary: Name of the application gateway to create/use in the node resource group. Use with ingress-azure addon.
- name: --appgw-subnet-prefix
type: string
short-summary: Subnet Prefix to use for a new subnet created to deploy the Application Gateway. Use with ingress-azure addon.
- name: --appgw-subnet-cidr
type: string
short-summary: Subnet CIDR to use for a new subnet created to deploy the Application Gateway. Use with ingress-azure addon.
Expand Down Expand Up @@ -450,6 +441,12 @@
- name: --enable-keda
type: bool
short-summary: Enable KEDA workload auto-scaler.
- name: --enable-defender
type: bool
short-summary: Enable Microsoft Defender security profile.
- name: --defender-config
type: string
short-summary: Path to JSON file containing Microsoft Defender profile configurations.
examples:
- name: Create a Kubernetes cluster with an existing SSH public key.
text: az aks create -g MyResourceGroup -n MyManagedCluster --ssh-key-value /path/to/publickey
Expand Down Expand Up @@ -574,9 +571,6 @@
- name: --no-uptime-sla
type: bool
short-summary: Change a paid managed cluster to a free one.
- name: --cluster-autoscaler-profile
type: list
short-summary: Space-separated list of key=value pairs for configuring cluster autoscaler. Pass an empty string to clear the profile.
- name: --load-balancer-managed-outbound-ip-count
type: int
short-summary: Load balancer managed outbound IP count.
Expand Down Expand Up @@ -770,6 +764,15 @@
- name: --disable-keda
type: bool
short-summary: Disable KEDA workload auto-scaler.
- name: --enable-defender
type: bool
short-summary: Enable Microsoft Defender security profile.
- name: --disable-defender
type: bool
short-summary: Disable defender profile.
- name: --defender-config
type: string
short-summary: Path to JSON file containing Microsoft Defender profile configurations.
examples:
- name: Reconcile the cluster back to its current state.
text: az aks update -g MyResourceGroup -n MyManagedCluster
Expand Down
255 changes: 121 additions & 134 deletions src/aks-preview/azext_aks_preview/_params.py

Large diffs are not rendered by default.

12 changes: 11 additions & 1 deletion src/aks-preview/azext_aks_preview/_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

from knack.log import get_logger

from azure.cli.core.azclierror import InvalidArgumentValueError, ArgumentUsageError
from azure.cli.core.azclierror import InvalidArgumentValueError, ArgumentUsageError, RequiredArgumentMissingError
from azure.cli.core.commands.validators import validate_tag
from azure.cli.core.util import CLIError
import azure.cli.core.keys as keys
Expand Down Expand Up @@ -593,3 +593,13 @@ def validate_enable_custom_ca_trust(namespace):
if hasattr(namespace, 'os_type') and namespace.os_type != "Linux":
raise ArgumentUsageError(
'--enable_custom_ca_trust can only be set for Linux nodepools')


def validate_defender_config_parameter(namespace):
if namespace.defender_config and not namespace.enable_defender:
raise RequiredArgumentMissingError("Please specify --enable-defnder")


def validate_defender_disable_and_enable_parameters(namespace):
if namespace.disable_defender and namespace.enable_defender:
raise ArgumentUsageError('Providing both --disable-defender and --enable-defender flags is invalid')
Loading