Skip to content

Commit 2435c8f

Browse files
jonathan-innisyuyue9284Yue Yuliakaz
authored
[k8s-configuration] Release v1.3.0 with deployed-object support (Azure#4163)
* Create pull.yml * Update pull.yml * Update azure-pipelines.yml * Initial commit of k8s-extension * Update CODEOWNERS * Update azure-pipelines.yml * Create pull.yml * Update pull.yml * Update pull.yml * Update pipelines file * Update k8s-configuration name * Update test script params * Update pipeline file * Remove codeowners * Update pipelines file * Update CODEOWNERS * Update private preview pipelines * Remove open service mesh from public release * Update pipeline files * Update custom pipelines files * Add publish step to k8s-configuration * Update pipeline to publish extension * Update public extension pipeline * Change condition variable * Update pipeline naming * Add version to public preview/private preview * Update pipelines * Add different testing based on private branch * Add annotations to extension model * Update k8s-custom-pipelines.yml * Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13) * Update sdks with updated swagger spec * Update version and history rst * Reorder release history timeline * Fix ExtensionInstanceForCreate for import * remove py2 bdist support * Add custom table formatting * Remove unnecessary files * Fix style issues * Fix branch based on comments * Update identity piece manually * Don't handle defaults at the CLI level * Remove defaults from CLI client * Check null target namespace with namespace scope * Update style * Add cassandra operator and location to model * Stage Public Version of k8s-extension 0.2.0 for official release (#15) * Create pull.yml * Update pull.yml * Update azure-pipelines.yml * Initial commit of k8s-extension * Update pipelines file * Update CODEOWNERS * Update private preview pipelines * Remove open service mesh from public release * Update pipeline files * Update public extension pipeline * Change condition variable * Add version to public preview/private preview * Update pipelines * Add different testing based on private branch * Add annotations to extension model * Update k8s-custom-pipelines.yml * Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13) * Update sdks with updated swagger spec * Update version and history rst * Reorder release history timeline * Fix ExtensionInstanceForCreate for import * remove py2 bdist support * Add custom table formatting * Remove unnecessary files * Fix style issues * Fix branch based on comments * Update identity piece manually * Don't handle defaults at the CLI level * Remove defaults from CLI client * Check null target namespace with namespace scope * Update style * Add cassandra operator and location to model Co-authored-by: action@github.com <Action - Fork Sync> * Remove custom pipelines file * Update extension description, remove private const * Update pipeline file * Disable check ref docs * Disable refs docs * Update to include better create warning logs and remove update context (#20) * Update to include better create warning logs and remove update context * Remove help text for update * Fix spelling error * Update message * Fix k8s-extension conflict with private version * Fix style errors * Fix filename * add customization for microsoft.azureml.kubernetes (#23) * add customization for microsoft.azureml.kubernetes * Update release history Co-authored-by: Yue Yu <yuyu3@microsoft.com> Co-authored-by: jonathan-innis <jonathan.innis.ji@gmail.com> * Add E2E Testing from Separate branch into internal code (#26) * Add internal e2e testing * Change to testing folder * Inference CLI validation for Scoring FE (#24) * cli validation starter * added the call to the fe validation function * nodeport validation not required * test fix Co-authored-by: Jonathan Innis <jonathan.innis.ji@gmail.com> * legal warning added (#27) * Remove deprecated method logger.warn * Update k8s-custom-pipelines.yml for Azure Pipelines * Update k8s-custom-pipelines.yml for Azure Pipelines * Add Azure Defender to E2E testing (#28) * Add azure defender testing to e2e * Remove the debug flag * Add configuration testing * Fix pipeline failures * Make test script more intuitive * Remove parameter from testing * Add some debug * Fix wrong location for k8s config whl * Fix pip install upgrade issue * Fix pip install upgrade issue * Add Check for Provider Registration and Refactor (#19) * Add check for provider registration and refactor * Fix bug in checking registration * Add license header to utils * Update private key check and error messaging * Update based on refactoring * Fix failing tests * Add provider registration check * Create a test for uppercase url, address comments * Add blank line to fix style check * Testing increase to ubuntu-latest * Update k8s-configuration Models to Track2 (Azure#63) * Update models to track2 * Increase k8s-configuration version number * Update kind version * Change error to warning because of DSA failure * Upgrade helm operator chart version (Azure#75) * Pin helm version * Bump version * Migrate pipeline (Azure#90) * Disable updates on configuration tests (Azure#89) * Release k8s-configuration v1.2.0 for Flux v2 Public Preview (Azure#86) * Scaffold out the k8s-config package * Base implementation of CLI commands * Add create scenario and cleanup in consts * Add help text to commands, params * Add other clients to client factory * Automatically installing the flux extension * Move flux and extension into modules * Updated the versioned sdks * Push working command for testing * Update to multi api versioned sdk * Support other extension methods * Fix nullity check * Add source control provider * Add scc commands * Add defer logic for create with cache * Use default extension with identity * Fix identity creation * Add kustomization caching * Add formatters * Add scc provider * Add help text for k8s-config fluxv1 * Add help text for extension * Allow force delete of extension and fluxconfiguration * Add location to the extension model * Update with latest from k8s-extension * Add k8s-config testing * Add license header * Fix all style issues * Update codeowners file * Validate data before checking cluster compliance * No kustomizations warning * Fix identity issue in 2020-07-01 * Fix k8s regex * Fix configuration name regex validation * Fix name length validation * Adding some validation warnings * Add protected settings to request * Exclude private test path * Add suspend functionality * Add correct values to build Kustomization * Add no_wait * Fix style issues * Use base64 encoded httpsUser * Fix formatting error and base64 encoding error * Fix style issues * Fix force * Updated help text * Style fixes * Increase namespace maximum len * Add managed cluster support to k8s-config * Custom confirmation when prune is enabled * Add flux commands to existing k8s-configuration * Remove extension provider from CLI * Fix style issues * Override extension variables * Strip newlines from known_hosts file * Update help text and validators * Strip newlines from known hosts * Add provisioning state check for flux extension * Pin helm version * Remove validation from create command * Add patch support with new SDK * Add implementation for CRUD of source and kustomization * Fix errors on patch * Fix some bugs in patching properties * Add fixes for patch in k8s-configuraiton * Change duration formatting in table output * Add validation and conversion for durations * Bump verison and fix typo * Fix bug with dependencies * Fix linter and style issues * Fix delete prune check * Add flux testing * Create separate jobs for scenarios * Update error text * Fix filepath suggestion from CLI team * Fix unneeded file edit * Add a Deployed Object List to the Flux CLI (Azure#91) * Enable a deployed object list on the CLI * Show detail when extension install fails * Bump version * Remove unneeded files * Update deployed object format (Azure#93) * Fix help text for consistency Co-authored-by: action@github.com <Action - Fork Sync> Co-authored-by: yuyue9284 <15863499+yuyue9284@users.noreply.github.com> Co-authored-by: Yue Yu <yuyu3@microsoft.com> Co-authored-by: Lia Kazakova <58274127+liakaz@users.noreply.github.com>
1 parent b45ca40 commit 2435c8f

9 files changed

Lines changed: 226 additions & 67 deletions

File tree

src/k8s-configuration/HISTORY.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
Release History
44
===============
55

6+
1.3.0
7+
++++++++++++++++++
8+
* Add `deployed-object` command group for showing deployed Flux objects from configuration
9+
* Show extension error when `microsoft.flux` extension is in a failed state
10+
611
1.2.0
712
++++++++++++++++++
813
* Add Flux v2 support with command subgroups

src/k8s-configuration/azext_k8s_configuration/_help.py

Lines changed: 103 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,16 @@
66

77
from knack.help_files import helps # pylint: disable=unused-import
88

9-
helps['k8s-configuration'] = """
9+
helps[
10+
"k8s-configuration"
11+
] = """
1012
type: group
1113
short-summary: Commands to manage resources from Microsoft.KubernetesConfiguration.
1214
"""
1315

14-
helps['k8s-configuration create'] = """
16+
helps[
17+
"k8s-configuration create"
18+
] = """
1519
type: command
1620
short-summary: Create a Flux v1 Kubernetes configuration (This command is for Flux v1, to use the newer Flux v2, run "az k8s-configuration flux create").
1721
examples:
@@ -26,7 +30,9 @@
2630
--ssh-known-hosts '' --ssh-known-hosts-file ''
2731
"""
2832

29-
helps['k8s-configuration list'] = """
33+
helps[
34+
"k8s-configuration list"
35+
] = """
3036
type: command
3137
short-summary: List Flux v1 Kubernetes configurations (This command is for Flux v1, to use the newer Flux v2, run "az k8s-configuration flux list").
3238
examples:
@@ -36,7 +42,9 @@
3642
--cluster-type connectedClusters
3743
"""
3844

39-
helps['k8s-configuration delete'] = """
45+
helps[
46+
"k8s-configuration delete"
47+
] = """
4048
type: command
4149
short-summary: Delete a Flux v1 Kubernetes configuration (This command is for Flux v1, to use the newer Flux v2, run "az k8s-configuration flux delete").
4250
examples:
@@ -46,7 +54,9 @@
4654
--cluster-type connectedClusters --name MyConfigurationName
4755
"""
4856

49-
helps['k8s-configuration show'] = """
57+
helps[
58+
"k8s-configuration show"
59+
] = """
5060
type: command
5161
short-summary: Show details of a Flux v1 Kubernetes configuration (This command is for Flux v1, to use the newer Flux v2, run "az k8s-configuration flux show").
5262
examples:
@@ -56,16 +66,20 @@
5666
--cluster-type connectedClusters --name MyConfigurationName
5767
"""
5868

59-
helps['k8s-configuration flux'] = """
69+
helps[
70+
"k8s-configuration flux"
71+
] = """
6072
type: group
6173
short-summary: Commands to manage Flux v2 Kubernetes configurations.
6274
"""
6375

64-
helps['k8s-configuration flux create'] = """
76+
helps[
77+
"k8s-configuration flux create"
78+
] = """
6579
type: command
66-
short-summary: Create a Kubernetes Flux v2 Configuration.
80+
short-summary: Create a Flux v2 Kubernetes configuration.
6781
examples:
68-
- name: Create a Kubernetes v2 Flux Configuration
82+
- name: Create a Flux v2 Kubernetes configuration
6983
text: |-
7084
az k8s-configuration flux create --resource-group my-resource-group \\
7185
--cluster-name mycluster --cluster-type connectedClusters \\
@@ -74,103 +88,155 @@
7488
--branch main --kustomization name=my-kustomization
7589
"""
7690

77-
helps['k8s-configuration flux update'] = """
91+
helps[
92+
"k8s-configuration flux update"
93+
] = """
7894
type: command
79-
short-summary: Update a Kubernetes Flux v2 Configuration.
95+
short-summary: Update a Flux v2 Kubernetes configuration.
8096
examples:
81-
- name: Update a Kubernetes v2 Flux Configuration
97+
- name: Update a Flux v2 Kubernetes configuration
8298
text: |-
8399
az k8s-configuration flux update --resource-group my-resource-group \\
84100
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \\
85101
--url https://github.com/Azure/arc-k8s-demo --branch main \\
86102
--kustomization name=my-kustomization path=./my/new-path
87103
"""
88104

89-
helps['k8s-configuration flux list'] = """
105+
helps[
106+
"k8s-configuration flux list"
107+
] = """
90108
type: command
91-
short-summary: List Kubernetes Flux v2 Configurations.
109+
short-summary: List all Flux v2 Kubernetes configurations.
92110
examples:
93-
- name: List all Kubernetes Flux v2 Configurations on a cluster
111+
- name: List Flux v2 Kubernetes configurations on a cluster
94112
text: |-
95113
az k8s-configuration flux list --resource-group my-resource-group \\
96114
--cluster-name mycluster --cluster-type connectedClusters
97115
"""
98116

99-
helps['k8s-configuration flux show'] = """
117+
helps[
118+
"k8s-configuration flux show"
119+
] = """
100120
type: command
101-
short-summary: Show a Kubernetes Flux v2 Configuration.
121+
short-summary: Show a Flux v2 Kubernetes configuration.
102122
examples:
103-
- name: Show details of a Kubernetes Flux v2 Configuration
123+
- name: Show details of a Flux v2 Kubernetes configuration
104124
text: |-
105125
az k8s-configuration flux show --resource-group my-resource-group \\
106126
--cluster-name mycluster --cluster-type connectedClusters --name myconfig
107127
"""
108128

109-
helps['k8s-configuration flux delete'] = """
129+
helps[
130+
"k8s-configuration flux delete"
131+
] = """
110132
type: command
111-
short-summary: Delete a Kubernetes Flux v2 Configuration.
133+
short-summary: Delete a Flux v2 Kubernetes configuration.
112134
examples:
113-
- name: Delete an existing Kubernetes Flux v2 Configuration
135+
- name: Delete an existing Flux v2 Kubernetes configuration
114136
text: |-
115137
az k8s-configuration flux delete --resource-group my-resource-group \\
116138
--cluster-name mycluster --cluster-type connectedClusters --name myconfig
117139
"""
118140

119-
helps['k8s-configuration flux kustomization'] = """
141+
helps[
142+
"k8s-configuration flux kustomization"
143+
] = """
120144
type: group
121145
short-summary: Commands to manage Kustomizations associated with Flux v2 Kubernetes configurations.
122146
"""
123147

124-
helps['k8s-configuration flux kustomization create'] = """
148+
helps[
149+
"k8s-configuration flux kustomization create"
150+
] = """
125151
type: command
126-
short-summary: Create a Kustomization associated with a Kubernetes Flux v2 Configuration.
152+
short-summary: Create a Kustomization associated with a Flux v2 Kubernetes configuration.
127153
examples:
128-
- name: Create a Kustomization associated wiht a Kubernetes v2 Flux Configuration
154+
- name: Create a Kustomization associated with a Flux v2 Kubernetes configuration
129155
text: |-
130156
az k8s-configuration flux kustomization create --resource-group my-resource-group \\
131157
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \\
132158
--kustomization-name my-kustomization-2 --path ./my/path --prune --force
133159
"""
134160

135-
helps['k8s-configuration flux kustomization update'] = """
161+
helps[
162+
"k8s-configuration flux kustomization update"
163+
] = """
136164
type: command
137-
short-summary: Update a Kustomization associated with a Kubernetes Flux v2 Configuration.
165+
short-summary: Update a Kustomization associated with a Flux v2 Kubernetes configuration.
138166
examples:
139-
- name: Update a Kustomization associated with a Kubernetes v2 Flux Configuration
167+
- name: Update a Kustomization associated with a Flux v2 Kubernetes configuration
140168
text: |-
141169
az k8s-configuration flux kustomization update --resource-group my-resource-group \\
142170
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \\
143171
--kustomization-name my-kustomization --path ./my/new-path --prune --force
144172
"""
145173

146-
helps['k8s-configuration flux kustomization list'] = """
174+
helps[
175+
"k8s-configuration flux kustomization list"
176+
] = """
147177
type: command
148-
short-summary: List Kustomizations associated with a Kubernetes Flux v2 Configuration.
178+
short-summary: List Kustomizations associated with a Flux v2 Kubernetes configuration.
149179
examples:
150-
- name: List all Kustomizations associated with a Kubernetes Flux v2 Configuration on a cluster
180+
- name: List all Kustomizations associated with a Flux v2 Kubernetes configuration
151181
text: |-
152182
az k8s-configuration flux kustomization list --resource-group my-resource-group \\
153183
--cluster-name mycluster --name myconfig --cluster-type connectedClusters
154184
"""
155185

156-
helps['k8s-configuration flux kustomization show'] = """
186+
helps[
187+
"k8s-configuration flux kustomization show"
188+
] = """
157189
type: command
158-
short-summary: Show a Kustomization associated with a Flux v2 Configuration.
190+
short-summary: Show a Kustomization associated with a Flux v2 Kubernetes configuration.
159191
examples:
160-
- name: Show details of a Kustomization associated with a Kubernetes Flux v2 Configuration
192+
- name: Show details of a Kustomization associated with a Flux v2 Kubernetes configuration
161193
text: |-
162194
az k8s-configuration flux kustomization show --resource-group my-resource-group \\
163195
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \\
164196
--kustomization-name my-kustomization
165197
"""
166198

167-
helps['k8s-configuration flux kustomization delete'] = """
199+
helps[
200+
"k8s-configuration flux kustomization delete"
201+
] = """
168202
type: command
169-
short-summary: Delete a Kustomization associated with a Kubernetes Flux v2 Configuration.
203+
short-summary: Delete a Kustomization associated with a Flux v2 Kubernetes configuration.
170204
examples:
171-
- name: Delete an existing Kustomization associated with a Kubernetes Flux v2 Configuration
205+
- name: Delete an existing Kustomization associated with a Flux v2 Kubernetes configuration
172206
text: |-
173207
az k8s-configuration flux kustomization delete --resource-group my-resource-group \\
174208
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \\
175209
--kustomization-name my-kustomization
176210
"""
211+
212+
helps[
213+
"k8s-configuration flux deployed-object"
214+
] = """
215+
type: group
216+
short-summary: Commands to see deployed objects associated with Flux v2 Kubernetes configurations.
217+
"""
218+
219+
helps[
220+
"k8s-configuration flux deployed-object list"
221+
] = """
222+
type: command
223+
short-summary: List deployed objects associated with a Flux v2 Kubernetes configuration.
224+
examples:
225+
- name: List all deployed objects associated with a Flux v2 Kubernetes configuration
226+
text: |-
227+
az k8s-configuration flux deployed-object list --resource-group my-resource-group \\
228+
--cluster-name mycluster --name myconfig --cluster-type connectedClusters
229+
"""
230+
231+
helps[
232+
"k8s-configuration flux deployed-object show"
233+
] = """
234+
type: command
235+
short-summary: Show a deployed object associated with a Flux v2 Kubernetes configuration.
236+
examples:
237+
- name: Show details of a deployed object associated with a Flux v2 Kubernetes configuration
238+
text: |-
239+
az k8s-configuration flux deployed-object show --resource-group my-resource-group \\
240+
--cluster-name mycluster --cluster-type connectedClusters --name myconfig \\
241+
--object-name my-object --object-namespace my-namespace --object-kind GitRepository
242+
"""

src/k8s-configuration/azext_k8s_configuration/_params.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,15 @@ def load_arguments(self, _):
118118
options_list=['--yes', '-y'],
119119
help='Do not prompt for confirmation')
120120

121+
with self.argument_context('k8s-configuration flux deployed-object show') as c:
122+
c.argument('object_name',
123+
help='Name of the object deployed by the configuration on the cluster.')
124+
c.argument('object_namespace',
125+
help='Namespace of the object deployed by the configuration on the cluster.')
126+
c.argument('object_kind',
127+
arg_type=get_enum_type(['GitRepository', 'Bucket', 'HelmRepository', 'HelmChart', 'HelmRelease', 'Kustomization']),
128+
help='Kind of the object deployed by the configuration on the cluster.')
129+
121130
with self.argument_context('k8s-configuration') as c:
122131
c.argument('name',
123132
options_list=['--name', '-n'],

src/k8s-configuration/azext_k8s_configuration/commands.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010
k8s_configuration_sourcecontrol_client
1111
)
1212
from .format import (
13+
fluxconfig_deployed_object_list_table_format,
14+
fluxconfig_deployed_object_show_table_format,
1315
fluxconfig_list_table_format,
1416
fluxconfig_show_table_format,
1517
fluxconfig_kustomization_list_table_format,
@@ -44,6 +46,10 @@ def load_command_table(self, _):
4446
g.custom_command('list', 'flux_config_list_kustomization', table_transformer=fluxconfig_kustomization_list_table_format)
4547
g.custom_show_command('show', 'flux_config_show_kustomization', table_transformer=fluxconfig_kustomization_show_table_format)
4648

49+
with self.command_group('k8s-configuration flux deployed-object', k8s_configuration_fluxconfig_sdk, client_factory=k8s_configuration_fluxconfig_client, is_preview=True) as g:
50+
g.custom_command('list', 'flux_config_list_deployed_object', table_transformer=fluxconfig_deployed_object_list_table_format)
51+
g.custom_show_command('show', 'flux_config_show_deployed_object', table_transformer=fluxconfig_deployed_object_show_table_format)
52+
4753
with self.command_group('k8s-configuration', k8s_configuration_sourcecontrol_sdk, client_factory=k8s_configuration_sourcecontrol_client) as g:
4854
g.custom_command('create', 'sourcecontrol_create', deprecate_info=self.deprecate(redirect='k8s-configuration flux create'))
4955
g.custom_command('list', 'sourcecontrol_list', table_transformer=sourcecontrol_list_table_format, deprecate_info=self.deprecate(redirect='k8s-configuration flux list'))

src/k8s-configuration/azext_k8s_configuration/consts.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
SHOW_KUSTOMIZATION_NO_EXIST_ERROR = "Error! Kustomization with name '{0}' does not exist on configuration '{1}'."
6565
SHOW_KUSTOMIZATION_NO_EXIST_HELP = "You can view all kustomizations on a configuration with 'az k8s-configuration flux kustomization list'"
6666

67+
SHOW_DEPLOYED_OBJECT_NO_EXIST_ERROR = "Error! Deployed object with name '{0}', namespace '{1}', and kind '{2}' does not exist on configuration '{3}'."
68+
SHOW_DEPLOYED_OBJECT_NO_EXIST_HELP = "You can view all deployed objects on a configuration with 'az k8s-configuration flux deployed-object list'"
69+
6770
SSH_PRIVATE_KEY_WITH_HTTP_URL_ERROR = "Error! An --ssh-private-key cannot be used with an http(s) url"
6871
SSH_PRIVATE_KEY_WITH_HTTP_URL_HELP = "Verify the url provided is a valid ssh url and not an http(s) url"
6972

src/k8s-configuration/azext_k8s_configuration/custom.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,20 @@ def flux_config_show_kustomization(cmd, client, resource_group_name, cluster_typ
121121
return provider.show_kustomization(resource_group_name, cluster_type, cluster_name, name, kustomization_name)
122122

123123

124+
def flux_config_list_deployed_object(cmd, client, resource_group_name, cluster_type, cluster_name, name):
125+
126+
provider = FluxConfigurationProvider(cmd)
127+
return provider.list_deployed_object(resource_group_name, cluster_type, cluster_name, name)
128+
129+
130+
def flux_config_show_deployed_object(cmd, client, resource_group_name, cluster_type, cluster_name, name,
131+
object_name, object_namespace, object_kind):
132+
133+
provider = FluxConfigurationProvider(cmd)
134+
return provider.show_deployed_object(resource_group_name, cluster_type, cluster_name, name,
135+
object_name, object_namespace, object_kind)
136+
137+
124138
def flux_config_delete(cmd, client, resource_group_name, cluster_type,
125139
cluster_name, name, force=False, no_wait=False, yes=False):
126140
provider = FluxConfigurationProvider(cmd)

0 commit comments

Comments
 (0)