Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 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
4 changes: 4 additions & 0 deletions src/command_modules/azure-cli-acs/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
Release History
===============

2.3.20
++++++
* adding customer-admin-group-id flag to az osa create
Copy link
Contributor

Choose a reason for hiding this comment

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

please move to the top

Copy link
Member

Choose a reason for hiding this comment

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

thanks, moved to top as 2.3.22 and bumped version


2.3.19
++++++
* ignore listen-address argument to "az aks browse" if kubectl doesn't support it
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,11 +648,16 @@
- name: --subnet-prefix
type: string
short-summary: The CIDR used on the Subnet into which to deploy the cluster.
- name: --customer-admin-group-id
type: string
short-summary: The ID of an Azure Active Directory Group that memberships will get synced into the OpenShift group "osa-customer-admins". If not specified, no cluster admin access will be granted.
Copy link
Contributor

Choose a reason for hiding this comment

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

i believe it should be the object id of the AAD group? If yes, please make it clear

Copy link
Member

Choose a reason for hiding this comment

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

updated description



examples:
- name: Create an OpenShift cluster and auto create an AAD Client
text: az openshift create -g MyResourceGroup -n MyManagedCluster --fqdn {FQDN}
- name: Create an OpenShift cluster and auto create an AAD Client and setup cluster admin group
text: az openshift create -g MyResourceGroup -n MyManagedCluster --fqdn {FQDN} --customer-admin-group-id {GROUP_ID}
Copy link
Member

Choose a reason for hiding this comment

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

This is going to be incompatible with PR #9083 which removes FQDN.

Choose a reason for hiding this comment

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

@tjprescott FQDN is not being removed. Its being made optional. PR #9083 will be done on top of this PR.

- name: Create an OpenShift cluster with 5 compute nodes and a custom AAD Client.
text: az openshift create -g MyResourceGroup -n MyManagedCluster --fqdn {FQDN} --aad-client-app-id {APP_ID} --aad-client-app-secret {APP_SECRET} --aad-tenant-id {TENANT_ID} --compute-count 5
- name: Create an Openshift cluster using a custom vnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ def load_arguments(self, _):
with self.argument_context('openshift create') as c:
c.argument('name', validator=validate_linux_host_name)
c.argument('compute_vm_size', options_list=['--compute-vm-size', '-s'])
c.argument('customer_admin_group_id', options_list=['--customer-admin-group-id'])


def _get_default_install_location(exe_name):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2243,7 +2243,8 @@ def _ensure_osa_aad(cli_ctx,
aad_client_app_secret=None,
aad_tenant_id=None,
identifier=None,
name=None, update=False):
name=None, update=False,
customer_admin_group_id=None):
rbac_client = get_graph_rbac_management_client(cli_ctx)
if not aad_client_app_id:
if not aad_client_app_secret and update:
Expand All @@ -2253,9 +2254,14 @@ def _ensure_osa_aad(cli_ctx,
# Delegate Sign In and Read User Profile permissions on Windows Azure Active Directory API
resource_access = ResourceAccess(id="311a71cc-e848-46a1-bdf8-97ff7156d8e6",
additional_properties=None, type="Scope")
required_osa_aad_access = RequiredResourceAccess(resource_access=[resource_access],
# Read directory permissions on Windows Azure Active Directory API
directory_access = ResourceAccess(id="5778995a-e1bf-45b8-affa-663a9f3f4d04",
Copy link
Member

Choose a reason for hiding this comment

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

What is this hard-coded ID?

Copy link

@amanohar amanohar Apr 18, 2019

Choose a reason for hiding this comment

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

What is this hard-coded ID?

@tjprescott these are scope GUIDs for programmatic use and represent various permissions: https://docs.microsoft.com/en-us/graph/permissions-reference. Currently there isn't a straightforward documentation from AAD for this and this is obtained by looking at currently configured apps in AAD.

additional_properties=None, type="Role")

required_osa_aad_access = RequiredResourceAccess(resource_access=[resource_access, directory_access],
additional_properties=None,
resource_app_id="00000002-0000-0000-c000-000000000000")

list_aad_filtered = list(rbac_client.applications.list(filter="identifierUris/any(s:s eq '{}')"
.format(reply_url)))
if update:
Expand Down Expand Up @@ -2291,7 +2297,8 @@ def _ensure_osa_aad(cli_ctx,
client_id=aad_client_app_id,
secret=aad_client_app_secret,
tenant_id=aad_tenant_id,
kind='AADIdentityProvider')
kind='AADIdentityProvider',
customer_admin_group_id=customer_admin_group_id)


def _ensure_service_principal(cli_ctx,
Expand Down Expand Up @@ -2483,7 +2490,8 @@ def openshift_create(cmd, client, resource_group_name, name, # pylint: disable=
subnet_prefix="10.0.0.0/24",
vnet_peer=None,
tags=None,
no_wait=False):
no_wait=False,
customer_admin_group_id=None):

if location is None:
location = _get_rg_location(cmd.cli_ctx, resource_group_name)
Expand All @@ -2499,7 +2507,7 @@ def openshift_create(cmd, client, resource_group_name, name, # pylint: disable=

agent_infra_pool_profile = OpenShiftManagedClusterAgentPoolProfile(
name='infra', # Must be 12 chars or less before ACS RP adds to it
count=int(2),
count=int(3),
Copy link
Member

Choose a reason for hiding this comment

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

Does this change the default node pool count from 2 to 3? That seems like a significant change (not related to this PR). Maybe it should be mentioned separately in the release notes.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, we agreed on this to switch from 2 to 3

vm_size="Standard_D4s_v3",
os_type="Linux",
role=OpenShiftAgentPoolProfileRole.infra,
Expand Down Expand Up @@ -2528,7 +2536,8 @@ def openshift_create(cmd, client, resource_group_name, name, # pylint: disable=
aad_client_app_id=aad_client_app_id,
aad_client_app_secret=aad_client_app_secret,
aad_tenant_id=aad_tenant_id, identifier=fqdn,
name=name, update=update_aad_secret)
name=name, update=update_aad_secret,
customer_admin_group_id=customer_admin_group_id)
identity_providers.append(
OpenShiftManagedClusterIdentityProvider(
name='Azure AD',
Expand Down
2 changes: 1 addition & 1 deletion src/command_modules/azure-cli-acs/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

DEPENDENCIES = [
'azure-mgmt-authorization==0.50.0',
'azure-mgmt-containerservice==4.4.0',
'azure-mgmt-containerservice==5.1.0',
'azure-mgmt-compute==4.4.0',
'azure-graphrbac==0.60.0',
'azure-cli-core',
Expand Down