Skip to content

Commit

Permalink
doc: readme update for backdoor deployment (#1006)
Browse files Browse the repository at this point in the history
[comment]: # (Note that your PR title should follow the conventional
commit format: https://conventionalcommits.org/en/v1.0.0/#summary)
# PR Description

[comment]: # (The below checklist is for PRs adding new features. If a
box is not checked, add a reason why it's not needed.)
# New Feature Checklist

- [ ] List telemetry added about the feature.
- [ ] Link to the one-pager about the feature.
- [ ] List any tasks necessary for release (3P docs, AKS RP chart
changes, etc.) after merging the PR.
- [ ] Attach results of scale and perf testing.

[comment]: # (The below checklist is for code changes. Not all boxes
necessarily need to be checked. Build, doc, and template changes do not
need to fill out the checklist.)
# Tests Checklist

- [ ] Have end-to-end Ginkgo tests been run on your cluster and passed?
To bootstrap your cluster to run the tests, follow [these
instructions](/otelcollector/test/README.md#bootstrap-a-dev-cluster-to-run-ginkgo-tests).
  - Labels used when running the tests on your cluster:
    - [ ] `operator`
    - [ ] `windows`
    - [ ] `arm64`
    - [ ] `arc-extension`
    - [ ] `fips`
- [ ] Have new tests been added? For features, have tests been added for
this feature? For fixes, is there a test that could have caught this
issue and could validate that the fix works?
  - [ ] Is a new scrape job needed?
- [ ] The scrape job was added to the folder
[test-cluster-yamls](/otelcollector/test/test-cluster-yamls/) in the
correct configmap or as a CR.
  - [ ] Was a new test label added?
- [ ] A string constant for the label was added to
[constants.go](/otelcollector/test/utils/constants.go).
- [ ] The label and description was added to the [test
README](/otelcollector/test/README.md).
- [ ] The label was added to this [PR
checklist](/.github/pull_request_template).
- [ ] The label was added as needed to
[testkube-test-crs.yaml](/otelcollector/test/testkube/testkube-test-crs.yaml).
  - [ ] Are additional API server permissions needed for the new tests?
- [ ] These permissions have been added to
[api-server-permissions.yaml](/otelcollector/test/testkube/api-server-permissions.yaml).
  - [ ] Was a new test suite (a new folder under `/tests`) added?
- [ ] The new test suite is included in
[testkube-test-crs.yaml](/otelcollector/test/testkube/testkube-test-crs.yaml).
  • Loading branch information
bragi92 authored Oct 25, 2024
1 parent bcd2d5c commit 75ad587
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 13 deletions.
20 changes: 8 additions & 12 deletions otelcollector/deploy/addon-chart/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
Use cli to enable the addon and then disable the addon.
**Enable addon** -
```
az aks update --enable-azuremonitormetrics -n <cluster-name> -g <cluster-resource-group>
az aks update --enable-azure-monitor-metrics -n <cluster-name> -g <cluster-resource-group>
```

**Disable addon** -
```
az aks update --disable-azuremonitormetrics -n <cluster-name> -g <cluster-resource-group>
az aks update --disable-azure-monitor-metrics -n <cluster-name> -g <cluster-resource-group>
```
We need this step because we need to get the secret created for the addon-token-adapter to serve, which is only created when the addon is enabled.

Expand All @@ -16,15 +16,17 @@ We need this step because we need to get the secret created for the addon-token-
Instructions on how to deploy ARM template -
https://learn.microsoft.com/en-us/azure/azure-monitor/containers/container-insights-prometheus-metrics-addon?tabs=resource-manager#download-and-edit-template-and-parameter-file

In the ARM template, comment out the section that enables the addon (with name - **"azuremonitormetrics-profile-"**(Lines 147 to 187), please comment the section acccordingly if template is updated)
In the ARM template, comment out the section that enables the addon (with name - **"azureMonitorProfile"**(Lines 156 to 196), please comment the section acccordingly if template is updated)

### **Step 3: Go to addon-chart directory**
```
cd prometheus-collector\otelcollector\deploy\addon-chart
```
### **Step 4: Update the chart/values file accordingly based on what needs to be tested with your backdoor deployment**

Charts and Values for the addon are in the folder azure-monitor-metrics-addon/
Update, local_testing_aks.ps1 within the azure-monitor-metrics-addon/ folder with the apporpritate ImageTag, Cluster Region and Cluster Resource ID (lines 9 to 11). Run the powershell file to generate the Chart and Values from the template files.

If you do not run the script and manually generate the Chart, Values yaml files then please do the following :

Values.yaml has some settings that need to be replaced, that are specific to your cluster. Please replace them before installing the helm chart.
- global.commonGlobals.Region
Expand All @@ -36,18 +38,12 @@ Values.yaml has some settings that need to be replaced, that are specific to you
Repository: https://msazure.visualstudio.com/CloudNativeCompute/_git/aks-rp?path=/ccp/charts/addon-charts/azure-monitor-metrics-addon/templates/ama-metrics-daemonset.yaml&version=GBrashmi/prom-addon-arm64&line=136&lineEnd=136&lineStartColumn=56&lineEndColumn=85&lineStyle=plain&_a=contents
ImageTag: https://msazure.visualstudio.com/CloudNativeCompute/_git/aks-rp?path=/ccp/charts/kube-control-plane/templates/_images.tpl&version=GBrashmi/prom-addon-arm64&line=530&lineEnd=530&lineStartColumn=28&lineEndColumn=53&lineStyle=plain&_a=contents


### **Step 5: Test out with Operator mode turned on**

This is an interim step needed until the operator changes roll out globally to make sure the changes work well with the new mode.
The value TargetAllocatorEnabled is set to false by default, this needs to be set to true to test out with the operator mode turned on.

### **Step 6: Install Helm chart**
### **Step 5: Install Helm chart**
```
helm install ama-metrics azure-monitor-metrics-addon/ --values azure-monitor-metrics-addon/values.yaml
```

### **Step 7: Uninstall helm chart**
### **Step 6: Uninstall helm chart**
```
helm uninstall ama-metrics
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ $valuesTemplateContent | Out-File -FilePath $valuesOutputPath
$chartTemplateContent = $chartTemplateContent -replace '\$\{HELM_CHART_NAME\}', 'ama-metrics'
$chartTemplateContent = $chartTemplateContent -replace '\$\{IMAGE_TAG\}', $ImageTag
# Remove the dependencies section
$chartTemplateContent = $chartTemplateContent -replace '(?s)dependencies:\s*-\s*name:\s*prometheus-node-exporter\s*version:\s*"4\.26\.0"\s*repository:\s*oci://\$\{MCR_REGISTRY\}\$\{MCR_REPOSITORY_HELM_DEPENDENCIES\}\s*condition:\s*AzureMonitorMetrics\.ArcExtension\s*', ''
$chartTemplateContent = $chartTemplateContent -replace '(?s)dependencies:\s*-\s*name:\s*prometheus-node-exporter\s*version:\s*"4\.39\.0"\s*repository:\s*oci://\$\{MCR_REGISTRY\}\$\{MCR_REPOSITORY_HELM_DEPENDENCIES\}\s*condition:\s*AzureMonitorMetrics\.ArcExtension\s*', ''


# Replace placeholders in values-template.yaml
Expand Down

0 comments on commit 75ad587

Please sign in to comment.