You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-arc/kubernetes/connect-cluster.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ az provider show -n Microsoft.Kubernetes -o table
65
65
az provider show -n Microsoft.KubernetesConfiguration -o table
66
66
```
67
67
68
-
## Install CLI extensions
68
+
## Install Azure CLI extensions
69
69
70
70
Install the `connectedk8s` extension, which helps you connect Kubernetes clusters to Azure:
71
71
@@ -199,7 +199,7 @@ Azure Arc enabled Kubernetes consists of a few agents (operators) that run in yo
199
199
200
200
## Delete a connected cluster
201
201
202
-
You can delete a `Microsoft.Kubernetes/connectedcluster` resource using the CLI or Azure portal.
202
+
You can delete a `Microsoft.Kubernetes/connectedcluster` resource using the Azure CLI or Azure portal.
203
203
204
204
The Azure CLI command `az connectedk8s delete` removes the `Microsoft.Kubernetes/connectedCluster` resource in Azure. The Azure CLI deletes any associated `sourcecontrolconfiguration` resources in Azure. The Azure CLI uses helm uninstall to remove the agents in the cluster.
When a cluster is onboarded to Azure, the agents running in your cluster must authenticate to Azure Resource Manager as part of registration. The `connectedk8s` CLI extension has automated Service Principal creation. However, there may be a few scenarios where the CLI automation does not work:
18
+
When a cluster is onboarded to Azure, the agents running in your cluster must authenticate to Azure Resource Manager as part of registration. The `connectedk8s`Azure CLI extension has automated Service Principal creation. However, there may be a few scenarios where the CLI automation does not work:
19
19
20
20
* Your organization generally restricts the creation of Service Principals
21
21
* The user onboarding the cluster does not have sufficient permissions to create Service Principals
22
22
23
-
Instead, let's create the Service Principal out of band, and then pass the principal to the CLI extension.
23
+
Instead, let's create the Service Principal out of band, and then pass the principal to the Azure CLI extension.
Azure Arc and Azure IoT Edge complement each other's capabilities quite well. Azure Arc provides mechanisms for cluster operators to the configure the foundational components of a cluster as well as apply and enforce cluster policies. And IoT Edge allows application operators to remotely deploy and manage the workloads at scale with convenient cloud ingestion and bi-directional communication primitives. The diagram below illustrates this:
20
20
21
-

21
+

22
22
23
23
## Pre-requisites
24
24
@@ -34,7 +34,7 @@ Azure Arc and Azure IoT Edge complement each other's capabilities quite well. Az
* Linux distros for the cluster (master & worker) nodes – Ubuntu (18.04 LTS and 16.04 LTS)
22
22
* Minimum Contributor RBAC role permission on the Azure subscription of the Azure Arc enabled Kubernetes cluster
23
23
* Fully Qualified Azure Resource ID of the Azure Arc enabled Kubernetes cluster
@@ -91,11 +91,11 @@ Refer to https://docs.microsoft.com/azure/azure-monitor/insights/container-insig
91
91
92
92
## User interface
93
93
94
-
Navigate to https://aka.ms/azmon-containers-azurearc to view the Onboarded Cluster
94
+
Navigate to https://aka.ms/azmon-containers-azurearc to view the Onboarded Cluster.
95
95
96
96
## Disable Monitoring
97
97
98
-
If you would like to disable monitoring due to some reason, you can just simply delete the Azure Monitor for containers HELM chart to stop collecting and ingesting monitoring data to Azure Monitor for containers backend
98
+
If you would like to disable monitoring due to some reason, you can just simply delete the Azure Monitor for containers HELM chart to stop collecting and ingesting monitoring data to Azure Monitor for containers backend.
This document provides some common troubleshooting scenarios with connectivity, permissions, and agents.
17
+
16
18
## General troubleshooting
17
19
18
-
### az CLI setup
20
+
### Azure CLI set up
19
21
Before using az connectedk8s or az k8sconfiguration CLI commands, assure that az is set to work against the correct Azure subscription.
20
22
21
23
```console
@@ -65,7 +67,7 @@ Connecting clusters to Azure requires access to both an Azure subscription and `
65
67
66
68
### Insufficient cluster permissions
67
69
68
-
If the provided kubeconfig file does not have sufficient permissions to install the Azure Arc agents, the CLI command will return an error attempting to call the Kubernetes API.
70
+
If the provided kubeconfig file does not have sufficient permissions to install the Azure Arc agents, the Azure CLI command will return an error attempting to call the Kubernetes API.
69
71
70
72
```console
71
73
$ az connectedk8s connect --resource-group AzureArc --name AzureArcCluster
@@ -80,7 +82,7 @@ Cluster owner should use a Kubernetes user with cluster administrator permission
80
82
81
83
### Installation timeouts
82
84
83
-
Azure Arc agent installation requires running a set of containers on the target cluster. If the cluster is running over a slow internet connection the container image pull may take longer than the CLI timeouts.
85
+
Azure Arc agent installation requires running a set of containers on the target cluster. If the cluster is running over a slow internet connection the container image pull may take longer than the Azure CLI timeouts.
84
86
85
87
```console
86
88
$ az connectedk8s connect --resource-group AzureArc --name AzureArcCluster
@@ -195,9 +197,3 @@ metadata:
195
197
resourceVersion: ""
196
198
selfLink: ""
197
199
```
198
-
199
-
### Source control configurations remain on my cluster
200
-
201
-
## Next steps
202
-
203
-
*[Use Azure Policy to govern cluster configuration](./use-azure-policy.md)
Copy file name to clipboardExpand all lines: articles/azure-arc/kubernetes/use-azure-policy.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,7 +29,7 @@ If you are using multiple Git repos as the sources of truth for each cluster (fo
29
29
6. In the **Policy rule** edit box, copy/paste the contents of this [example policy definition](https://raw.githubusercontent.com/Azure/arc-k8s-demo/master/policy/Ensure-GitOps-configuration-for-Kubernetes-cluster.json).
30
30
7.**Save**.
31
31
32
-
Note that this step of creating a custom policy definition will not be needed once the work is completed to make this a built-in policy.
32
+
This step for creating a custom policy definition will not be needed once the work is completed to make this a built-in policy.
33
33
34
34
## Create a policy assignment
35
35
@@ -40,12 +40,12 @@ Note that this step of creating a custom policy definition will not be needed on
40
40
5. If you want to exclude any resources from the policy scope, then set **Exclusions**.
41
41
6. Give the policy assignment a **Name** and **Description** that you can use to identify it easily.
42
42
7. Ensure that **Policy enforcement** is set to *Enabled*.
43
-
8.Click**Next**.
43
+
8.Select**Next**.
44
44
9. Set parameter values that will be used during the creation of the `sourceControlConfiguration`.
45
-
10.Click**Next**.
45
+
10.Select**Next**.
46
46
11. Enable **Create a remediation task**.
47
47
12. Assure that **Create a managed identity** is checked, and that the identity will have **Contributor** permissions. See [this doc](https://docs.microsoft.com/azure/governance/policy/assign-policy-portal) and [the comment in this doc](https://docs.microsoft.com/azure/governance/policy/how-to/remediate-resources) for more information on the permissions you need.
48
-
13.**Review + create**
48
+
13.Select **Review + create**.
49
49
50
50
After the policy assignment is created, for any new `connectedCluster` resource (or `managedCluster` resource with the GitOps agents installed) that is located within the scope of the assignment, the `sourceControlConfiguration` will be applied. For existing clusters, you will need to manually run a remediation task. It typically takes from 10-20 minutes for the policy assignment to take effect.
# Use GitOps for an Azure Arc-enabled configuration (Preview)
15
15
16
-
## Overview
17
-
18
16
This architecture uses a GitOps workflow to configure the cluster and deploy applications. The configuration is described declaratively in .yaml files and stored in Git. An agent watches the Git repo for changes and applies them. The same agent also periodically assures that the cluster state matches the state declared in the Git repo and returns the cluster to the desired state if any unmanaged changes have occurred.
19
17
20
18
The connection between your cluster and one or more Git repositories is tracked in Azure Resource Manager as a `sourceControlConfiguration` extension resource. The `sourceControlConfiguration` resource properties represent where and how Kubernetes resources should flow from Git to your cluster. The `sourceControlConfiguration` data is stored encrypted at rest in a CosmosDb database to ensure data confidentiality.
@@ -33,14 +31,12 @@ This getting started guide will walk you through applying a set of configuration
33
31
34
32
The example repository is structured around the persona of a cluster operator who would like to provision a few namespaces, deploy a common workload, and provide some team-specific configuration. Using this repository creates the following resources on your cluster:
*The `config-agent` polls Azure for new or updated `sourceControlConfiguration` every 30 seconds. This is the maximum time it will take for the `config-agent` to pick up a new or updated configuration.
43
-
*If you are associating a private repository, assure that you also complete the steps in [Apply configuration from a private git repository](https://github.com/Azure/azure-arc-kubernetes-preview/blob/master/docs/use-gitops-in-connected-cluster.md#apply-configuration-from-a-private-git-repository)
38
+
The `config-agent` polls Azure for new or updated `sourceControlConfiguration` every 30 seconds. This is the maximum time it will take for the `config-agent` to pick up a new or updated configuration.
39
+
If you are associating a private repository, assure that you also complete the steps in [Apply configuration from a private git repository](https://github.com/Azure/azure-arc-kubernetes-preview/blob/master/docs/use-gitops-in-connected-cluster.md#apply-configuration-from-a-private-git-repository)
44
40
45
41
### Using Azure CLI
46
42
@@ -102,13 +98,13 @@ Here are the supported scenarios for the value of --repository-url parameter.
102
98
| Scenario | Format | Description |
103
99
| ------------- | ------------- | ------------- |
104
100
| Private GitHub repo - SSH |[email protected]:username/repo | SSH keypair generated by Flux. User must add the public key to the GitHub account as Deploy Key. |
105
-
| Public GitHub repo |http://github.com/username/repo or git://github.com/username/repo | Public Git repo |
101
+
| Public GitHub repo |`http://github.com/username/repo` or git://github.com/username/repo | Public Git repo |
106
102
107
103
These scenarios are supported by Flux but not by sourceControlConfiguration yet.
108
104
109
105
| Scenario | Format | Description |
110
106
| ------------- | ------------- | ------------- |
111
-
| Private GitHub repo - HTTPS |https://github.com/username/repo| Flux does not generate SSH keypair. [Instructions](https://docs.fluxcd.io/en/1.17.0/guides/use-git-https.html)|
107
+
| Private GitHub repo - HTTPS |`https://github.com/username/repo`| Flux does not generate SSH keypair. [Instructions](https://docs.fluxcd.io/en/1.17.0/guides/use-git-https.html)|
| Private GitHub repo - SSH (bring your own key) |[email protected]:username/repo |[Use your own SSH keypair](https://docs.fluxcd.io/en/1.17.0/guides/provide-own-ssh-key.html)|
114
110
@@ -129,17 +125,17 @@ To customize the creation of configuration, here are a few additional parameters
129
125
130
126
Options supported in --operator-params
131
127
132
-
||Option | Description |
133
-
| ------------- | ------------- | ------------- |
134
-
|1. |--git-branch | Branch of git repo to use for Kubernetes manifests. Default is 'master'. |
135
-
|2. |--git-path | Relative path within the Git repo for Flux to locate Kubernetes manifests. |
136
-
|3. |--git-readonly | Git repo will be considered read-only; Flux will not attempt to write to it. |
137
-
|4. |--manifest-generation | If enabled, Flux will look for .flux.yaml and run Kustomize or other manifest generators. |
138
-
|5. |--git-poll-interval | Period at which to poll Git repo for new commits. Default is '5m' (5 minutes). |
139
-
|6. |--sync-garbage-collection | If enabled, Flux will delete resources that it created, but are no longer present in Git. |
140
-
|7. |--git-label | Label to keep track of sync progress, used to tag the Git branch. Default is 'flux-sync'. |
141
-
|8. |--git-user | Username for git commit. |
142
-
|9. |--git-email | Email to use for git commit. |
128
+
| Option | Description |
129
+
| ------------- | ------------- |
130
+
| --git-branch | Branch of git repo to use for Kubernetes manifests. Default is 'master'. |
131
+
| --git-path | Relative path within the Git repo for Flux to locate Kubernetes manifests. |
132
+
| --git-readonly | Git repo will be considered read-only; Flux will not attempt to write to it. |
133
+
| --manifest-generation | If enabled, Flux will look for .flux.yaml and run Kustomize or other manifest generators. |
134
+
| --git-poll-interval | Period at which to poll Git repo for new commits. Default is '5m' (5 minutes). |
135
+
| --sync-garbage-collection | If enabled, Flux will delete resources that it created, but are no longer present in Git. |
136
+
| --git-label | Label to keep track of sync progress, used to tag the Git branch. Default is 'flux-sync'. |
137
+
| --git-user | Username for git commit. |
138
+
| --git-email | Email to use for git commit. |
143
139
144
140
* If '--git-user' or '--git-email' are not set (which means that you don't want Flux to write to the repo), then --git-readonly will automatically be set (if you have not already set it).
145
141
@@ -292,7 +288,7 @@ kubectl -n itops get all
292
288
293
289
## Delete a configuration
294
290
295
-
You can delete a `sourceControlConfiguration` using the CLI or Azure portal. After you initiate the delete command, the `sourceControlConfiguration` resource will be deleted immediately in Azure, but it can take up to 1 hour for full deletion of the associated objects from the cluster (we have a backlog item to shorten this). If the `sourceControlConfiguration` was created with namespace scope, that namespace will not be deleted from the cluster (to avoid breaking any other resources that may have been created in that namespace).
291
+
You can delete a `sourceControlConfiguration` using the Azure CLI or Azure portal. After you initiate the delete command, the `sourceControlConfiguration` resource will be deleted immediately in Azure, but it can take up to 1 hour for full deletion of the associated objects from the cluster (we have a backlog item to shorten this). If the `sourceControlConfiguration` was created with namespace scope, that namespace will not be deleted from the cluster (to avoid breaking any other resources that may have been created in that namespace).
296
292
297
293
Note that any changes to the cluster that were the result of deployments from the tracked git repo are not deleted when the `sourceControlConfiguration` is deleted.
0 commit comments