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

Add Istio egress CLI commands #8524

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

nshankar13
Copy link
Contributor

@nshankar13 nshankar13 commented Mar 3, 2025


This PR adds the CLI commands to az aks mesh for enable-egress-gateway and disable-egress-gateway. It also vendors the python Kubernetes client under src/aks-preview/azext_aks_preview/vendored_sdks/kubernetes. The Kubernetes client is used to create a StaticGatewayConfiguration custom resource prior to enabling the egress gateway for the live tests, as this is required on the RP side to enable an Istio egress gateway.

This checklist is used to make sure that common guidelines for a pull request are followed.

Related command

az aks mesh enable egress gateway

General Guidelines

  • Have you run azdev style <YOUR_EXT> locally? (pip install azdev required)
  • Have you run python scripts/ci/test_index.py -q locally? (pip install wheel==0.30.0 required)
  • My extension version conforms to the Extension version schema

For new extensions:

About Extension Publish

There is a pipeline to automatically build, upload and publish extension wheels.
Once your pull request is merged into main branch, a new pull request will be created to update src/index.json automatically.
You only need to update the version information in file setup.py and historical information in file HISTORY.rst in your PR but do not modify src/index.json.

Signed-off-by: nshankar <nshankar@microsoft.com>
Copy link

azure-client-tools-bot-prd bot commented Mar 3, 2025

⚠️Azure CLI Extensions Breaking Change Test
⚠️aks-preview
rule cmd_name rule_message suggest_message
⚠️ 1001 - CmdAdd aks mesh disable-egress-gateway cmd aks mesh disable-egress-gateway added
⚠️ 1001 - CmdAdd aks mesh enable-egress-gateway cmd aks mesh enable-egress-gateway added

Copy link

Hi @nshankar13,
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan
Copy link
Collaborator

yonzhan commented Mar 3, 2025

Thank you for your contribution! We will review the pull request and get back to you soon.

Copy link

github-actions bot commented Mar 3, 2025

The git hooks are available for azure-cli and azure-cli-extensions repos. They could help you run required checks before creating the PR.

Please sync the latest code with latest dev branch (for azure-cli) or main branch (for azure-cli-extensions).
After that please run the following commands to enable git hooks:

pip install azdev --upgrade
azdev setup -c <your azure-cli repo path> -r <your azure-cli-extensions repo path>

Signed-off-by: nshankar <nshankar@microsoft.com>
Copy link

github-actions bot commented Mar 3, 2025

Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Copy link
Member

@FumingZhang FumingZhang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the change generally looks good to me, please fix failed checks

/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/_params.py:2228:1: W293 blank line contains whitespace
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/_validators.py:857:1: E302 expected 2 blank lines, found 1
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/_validators.py:861:5: F841 local variable 'asm_egress_name_regex' is assigned to but never used
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/_validators.py:862:13: F821 undefined name 'asm_revision_regex'
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/_validators.py:864:56: F821 undefined name 'revision'
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/_validators.py:866:1: E302 expected 2 blank lines, found 1
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/custom.py:3144:1: E302 expected 2 blank lines, found 1
/mnt/vss/_work/1/s/src/aks-preview/azext_aks_preview/managed_cluster_decorator.py:2413:1: W293 blank line contains whitespace

  • FAIL - HIGH severity: missing_parameter_help
    Parameter: aks mesh disable-egress-gateway, egress_gateway_name - Missing help
    Parameter: aks mesh disable-egress-gateway, egress_gateway_namespace - Missing help
    Parameter: aks mesh enable-egress-gateway, egress_gateway_name - Missing help
    Parameter: aks mesh enable-egress-gateway, egress_gateway_namespace - Missing help

bypass in src/aks-preview/linter_exclusions.yml

  • FAIL - HIGH severity: option_length_too_long
    Parameter: aks mesh disable-egress-gateway, egress_gateway_namespace - The lengths of all options ['--egress-gateway-namespace'] are longer than threshold 22. Argument egress_gateway_namespace must have a short abbreviation.
    Parameter: aks mesh enable-egress-gateway, egress_gateway_namespace - The lengths of all options ['--egress-gateway-namespace'] are longer than threshold 22. Argument egress_gateway_namespace must have a short abbreviation.
    Parameter: aks mesh enable-egress-gateway, gateway_configuration_name - The lengths of all options ['--gateway-configuration-name'] are longer than threshold 22. Argument gateway_configuration_name must have a short abbreviation.

Comment on lines 16 to 18
13.0.0b9
+++++++
* Add `enable-egress-gateway` and `disable-egress-gateway` to the `az aks mesh` command.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please include the notes under section Pending (several lines above).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I include under pending and 13.0.0b9 or just pending?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the comment below

@@ -12542,6 +12542,174 @@ def test_aks_azure_service_mesh_enable_disable(
],
)

@AllowLargeResponse()
@AKSCustomResourceGroupPreparer(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Queued live test to validate the change. Please commit the corresponding recording file (find from pipeline artifact) to src/aks-preview/azext_aks_preview/tests/latest/recordings if the test passed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Signed-off-by: nshankar <nshankar@microsoft.com>
Comment on lines 13 to 18
+++++++
* Vendor new SDK and bump API version to 2024-10-02-preview.

13.0.0b9
+++++++
* Add `enable-egress-gateway` and `disable-egress-gateway` to the `az aks mesh` command.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
+++++++
* Vendor new SDK and bump API version to 2024-10-02-preview.
13.0.0b9
+++++++
* Add `enable-egress-gateway` and `disable-egress-gateway` to the `az aks mesh` command.
+++++++
13.0.0b9
+++++++
* Vendor new SDK and bump API version to 2024-10-02-preview.
* Add `enable-egress-gateway` and `disable-egress-gateway` to the `az aks mesh` command.

I meant something like this

Comment on lines 16 to 18
13.0.0b9
+++++++
* Add `enable-egress-gateway` and `disable-egress-gateway` to the `az aks mesh` command.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see the comment below

Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
"istio_egressgateway_name",
validator=validate_asm_egress_name,
required=True,
options_list=["--istio-eg-gtw-name"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • FAIL - HIGH severity: faulty_help_example_parameters_rule
    Help-Entry: aks mesh disable-egress-gateway -
    There is a violation:
    "az aks mesh disable-egress-gateway --resource-group MyResourceGroup --name MyManagedCluster --istio-egressgateway-name my-istio-egress-1 --istio-egressgateway-namespace my-namespace-1" is not a valid command.
    the following arguments are required: --istio-eg-gtw-name.

FAIL - HIGH severity: unrecognized_help_parameter_rule
Help-Entry: aks mesh disable-egress-gateway - The following parameter help names are invalid: --istio-eg-gtw-name --istio-egressgateway-name | --istio-eg-gtw-ns --istio-egressgateway-namespace

missing the other option form (--istio-egressgateway-name) here?

Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
@@ -0,0 +1,33 @@
# ref: https://docs.gitlab.com/ee/ci/README.html
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would say it's not necessary to include the sample, doc, test, ci related things in this vendored SDK.

Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Signed-off-by: nshankar <nshankar@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AKS Auto-Assign Auto assign by bot
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants