-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Openshift/azure monitoring cli #10775
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -896,6 +896,9 @@ | |
- name: --customer-admin-group-id | ||
type: string | ||
short-summary: The Object 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. | ||
- name: --workspace-resource-id | ||
type: string | ||
short-summary: The resource ID of an existing Log Analytics Workspace to use for storing monitoring data. | ||
|
||
|
||
examples: | ||
|
@@ -907,6 +910,8 @@ | |
text: az openshift create -g MyResourceGroup -n MyManagedCluster --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 | ||
text: az openshift create -g MyResourceGroup -n MyManagedCluster --vnet-peer "/subscriptions/0000000-0000-0000-0000-000000000000/resourceGroups/openshift-vnet/providers/Microsoft.Network/virtualNetworks/test" | ||
- name: Create an Openshift cluster with Log Analytics monitoring enabled | ||
text: az openshift create -g MyResourceGroup -n MyManagedCluster --workspace-resource-id {WORKSPACE_RESOURCE_ID} | ||
""" | ||
troy0820 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
||
helps['openshift delete'] = """ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,8 @@ | |
from azure.mgmt.containerservice.v2019_04_30.models import OpenShiftRouterProfile | ||
from azure.mgmt.containerservice.v2019_04_30.models import OpenShiftManagedClusterAuthProfile | ||
from azure.mgmt.containerservice.v2019_04_30.models import NetworkProfile | ||
from azure.mgmt.containerservice.v2019_09_30_preview.models import OpenShiftManagedCluster as OpenShiftManagedClusterMonitor # pylint: disable=line-too-long | ||
from azure.mgmt.containerservice.v2019_09_30_preview.models import OpenShiftManagedClusterMonitorProfile | ||
|
||
from ._client_factory import cf_container_services | ||
from ._client_factory import cf_resource_groups | ||
|
@@ -3124,6 +3126,7 @@ def openshift_create(cmd, client, resource_group_name, name, # pylint: disable= | |
vnet_peer=None, | ||
tags=None, | ||
no_wait=False, | ||
workspace_resource_id=None, | ||
customer_admin_group_id=None): | ||
|
||
if location is None: | ||
|
@@ -3194,17 +3197,37 @@ def openshift_create(cmd, client, resource_group_name, name, # pylint: disable= | |
namespace='Microsoft.Network', type='virtualNetwork', | ||
name=vnet_peer | ||
) | ||
if workspace_resource_id is not None: | ||
|
||
workspace_resource_id = workspace_resource_id.strip() | ||
if not workspace_resource_id.startswith('/'): | ||
workspace_resource_id = '/' + workspace_resource_id | ||
if workspace_resource_id.endswith('/'): | ||
workspace_resource_id = workspace_resource_id.rstrip('/') | ||
monitor_profile = OpenShiftManagedClusterMonitorProfile(enabled=True, workspace_resource_id=workspace_resource_id) # pylint: disable=line-too-long | ||
else: | ||
monitor_profile = None | ||
|
||
network_profile = NetworkProfile(vnet_cidr=vnet_prefix, peer_vnet_id=vnet_peer) | ||
|
||
osamc = OpenShiftManagedCluster( | ||
location=location, tags=tags, | ||
open_shift_version="v3.11", | ||
network_profile=network_profile, | ||
auth_profile=auth_profile, | ||
agent_pool_profiles=agent_pool_profiles, | ||
master_pool_profile=agent_master_pool_profile, | ||
router_profiles=[default_router_profile]) | ||
if monitor_profile is not None: | ||
osamc = OpenShiftManagedClusterMonitor( | ||
location=location, tags=tags, | ||
open_shift_version="v3.11", | ||
network_profile=network_profile, | ||
auth_profile=auth_profile, | ||
agent_pool_profiles=agent_pool_profiles, | ||
master_pool_profile=agent_master_pool_profile, | ||
router_profiles=[default_router_profile], | ||
monitor_profile=monitor_profile) | ||
else: | ||
osamc = OpenShiftManagedCluster( | ||
location=location, tags=tags, | ||
open_shift_version="v3.11", | ||
network_profile=network_profile, | ||
auth_profile=auth_profile, | ||
agent_pool_profiles=agent_pool_profiles, | ||
master_pool_profile=agent_master_pool_profile, | ||
router_profiles=[default_router_profile]) | ||
|
||
try: | ||
# long_running_operation_timeout=300 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would something like
--loganalytics-workspace-resource-id
be better here? I know it's a lot to type. Don't mind whether it's loganalytics or monitoring or some other name.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To reduce complexity, I'm okay with the long
--loganalytics-workspace-resource-id
name. I can change it to that to provide a concise naming convention.