Skip to content

Commit f69f68e

Browse files
Markdown fixes for docs (#1642)
1 parent dd55e83 commit f69f68e

38 files changed

+438
-332
lines changed

docs/annotations.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# Annotations
22

3-
.. note::
4-
[Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
5-
6-
A list of corresponding translations from AGIC to Application Gateway for Containers may be found [here](https://learn.microsoft.com/azure/application-gateway/for-containers/migrate-from-agic-to-agc).
3+
> **_NOTE:_** [Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment. A list of corresponding translations from AGIC to Application Gateway for Containers may be found [here](https://learn.microsoft.com/azure/application-gateway/for-containers/migrate-from-agic-to-agc).
74
85
## Introductions
96

docs/developers/build.md

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Building the controller
22

33
* [Running it locally](#running-it-locally)
4-
* [Pre-requisite](#pre-requisite)
5-
* [Obtain Azure Credentials](#obtain-azure-credentials)
6-
* [Deploy Application Gateway and AKS](#deploy-application-gateway-and-aks)
7-
* [Using startup script](#using-startup-script)
8-
* [Visual Studio Code (F5 debugging)](#visual-studio-code-f5-debugging)
4+
* [Pre-requisite](#pre-requisite)
5+
* [Obtain Azure Credentials](#obtain-azure-credentials)
6+
* [Deploy Application Gateway and AKS](#deploy-application-gateway-and-aks)
7+
* [Using startup script](#using-startup-script)
8+
* [Visual Studio Code (F5 debugging)](#visual-studio-code-f5-debugging)
99
* [Run on a cluster using a Dev Release](#create-a-dev-release)
1010
* [CMake options](#cmake-options)
1111

@@ -14,6 +14,7 @@
1414
This section outlines the environment variables and files necessary to successfully compile and run the Go binary, then connect it to an [Azure Kubernetes Service](https://docs.microsoft.com/en-us/azure/aks/intro-kubernetes).
1515

1616
### Pre-requisite
17+
1718
* [go >= 1.13](https://golang.org/dl/)
1819
* OpenSSL
1920

@@ -45,6 +46,7 @@ The file will contain a JSON blob with the following shape:
4546
```
4647

4748
### Deploy Application Gateway and AKS
49+
4850
To deploy a fresh setup, please follow the steps for template deployment in the [greenfield](../setup/install-new.md) documentation.
4951

5052
### Using startup script
@@ -54,10 +56,13 @@ In the `scripts` directory you will find `start.sh`. This script builds and runs
5456
Steps to run ingress controller:
5557

5658
1. Get your cluster's credentials
59+
5760
```
5861
az aks get-credentials --name <cluster-name> --resource-group <group>
5962
```
63+
6064
1. Configure: `cp .env.example .env` and modify the environment variables in `.env` to match your config. Here is an example:
65+
6166
```
6267
#!/bin/bash
6368
export AZURE_AUTH_LOCATION="$HOME/.azure/azureAuth.json"
@@ -68,7 +73,9 @@ Steps to run ingress controller:
6873
6974
export APPGW_VERBOSITY_LEVEL="9"
7075
```
76+
7177
1. Run: `./scripts/start.sh`
78+
7279
```
7380
Cleanup: delete /home/vsonline/go/src/github.com/Azure/application-gateway-kubernetes-ingress/bin
7481
Compiling...
@@ -83,7 +90,9 @@ Steps to run ingress controller:
8390
```
8491
8592
### Visual Studio Code (F5 debugging)
93+
8694
You can also setup vscode to run the project with `F5` and use breakpoint debugging. For this, you need to setup your `launch.json` file within `.vscode` folder.
95+
8796
```json
8897
{
8998
"version": "0.2.0",
@@ -109,11 +118,13 @@ You can also setup vscode to run the project with `F5` and use breakpoint debugg
109118
```
110119

111120
## Create a Dev Release
121+
112122
To test your changes on a cluster, you can use the [`Dev Release`](https://dev.azure.com/azure/application-gateway-kubernetes-ingress/_release?_a=releases&view=mine&definitionId=12) pipeline. Just select the build version from the drop-down list which matches the build in your PR or against your commit in the main branch.
113123

114124
![dev release pipeline](../images/dev-release.png)
115125

116126
`Dev Release` generates a new docker image and helm package for your changes. Once the pipeline completes, use helm to install the release on your AKS cluster.
127+
117128
```bash
118129
# add the staging helm repository
119130
helm repo add staging https://appgwingress.blob.core.windows.net/ingress-azure-helm-package-staging/
@@ -140,16 +151,16 @@ You can also find the `version` by opening your build in the `Merge Builds` pipe
140151

141152
This is a CMake-based project. Build targets include:
142153

143-
- `ALL_BUILD` (default target) builds `appgw-ingress` and `dockerize` target
144-
- `devenv` builds a docker image with configured development environment
145-
- `vendor` installs dependency using `go mod` in a docker container with image from `devenv` target
146-
- `appgw-ingress` builds the binary for this controller in a docker container with image from `devenv` target
147-
- `dockerize` builds a docker image with the binary from `appgw-ingress` target
148-
- `dockerpush` pushes the docker image to a container registry with prefix defined in CMake variable `<deployment_push_prefix>`
154+
* `ALL_BUILD` (default target) builds `appgw-ingress` and `dockerize` target
155+
* `devenv` builds a docker image with configured development environment
156+
* `vendor` installs dependency using `go mod` in a docker container with image from `devenv` target
157+
* `appgw-ingress` builds the binary for this controller in a docker container with image from `devenv` target
158+
* `dockerize` builds a docker image with the binary from `appgw-ingress` target
159+
* `dockerpush` pushes the docker image to a container registry with prefix defined in CMake variable `<deployment_push_prefix>`
149160

150161
To run the CMake targets:
151162

152163
1. `mkdir build && cd build` creates and enters a build directory
153164
2. `cmake ..` generates project configuration in the build directory
154165
3. `cmake --build .` to build the default target,
155-
or `cmake --build . --target <target_name>` to specify a target to run from above
166+
or `cmake --build . --target <target_name>` to specify a target to run from above

docs/developers/contribute.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ This is a Golang project. You can find the build instructions of the project in
44

55
This project welcomes contributions and suggestions. Most contributions require you to agree to a
66
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
7-
the rights to use your contribution. For details, visit https://cla.microsoft.com.
7+
the rights to use your contribution. For details, visit [https://cla.microsoft.com](https://cla.microsoft.com).
88

99
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide
1010
a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions

docs/developers/design.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
This document is the detailed design and architecture of the Application Gateway Ingress Controller (AGIC) being built in this repository.
66

7-
8-
97
## Overview
108

119
Application Gateway Ingress Controller (AGIC) is a Kubernetes application, which makes it possible for [Azure Kubernetes Service (AKS)](https://azure.microsoft.com/en-us/services/kubernetes-service/) customers to leverage Azure's native [Application Gateway](https://azure.microsoft.com/en-us/services/application-gateway/) L7 load-balancer to expose cloud software to the Internet. AGIC monitors the Kubernetes cluster it is hosted on and continuously updates an App Gateway, so that selected services are exposed to the Internet.
@@ -17,22 +15,24 @@ The Ingress Controller runs in its own pod on the customer’s AKS. AGIC monitor
1715
## High-level architecture
1816

1917
The AGIC is composed of the following three sub components:
18+
2019
1. [K8S Context and Informers](#1-k8s-context-and-informers) - handles events from the cluster and alerts the worker
2120
2. [Worker](#2-worker) - handles events coming from the informer and perform relevant actions
2221
3. [Application Gateway Config Builder](#3-application-gateway-config-builder) - generates the new gateway configuration
2322

24-
2523
![components relationship](../images/component-diagram.png)
2624

2725
## Components
2826

2927
Let's take a look at each component:
3028

3129
### 1. K8s Context and Informers
30+
3231
When any change is applied on the k8s cluster by the user, AGIC needs to listen to these changes in order to update the corresponding configuration on the Application Gateway.
3332
We use the kubernetes informers for this purpose which is a standard for watching resources on the K8S API server.
3433

3534
When AGIC starts, it [sets up informers](../pkg/k8scontext/context.go) for watching following resources:
35+
3636
1. [Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/): This is the top-level resource that AGIC monitors. It provides information about the layer-7 routing rules that need to be configured on the App Gateway.
3737
1. [Service](https://kubernetes.io/docs/concepts/services-networking/service/): Service provides an abstraction over the pods to expose as a network service. AGIC uses the service as logical grouping of pods to extract the IP addresses through the endpoints object created automatically along with the Service.
3838
1. [Endpoints](https://kubernetes.io/docs/concepts/services-networking/endpoint-slices/): Endpoints provides information about Pod IP Addresses behind a service and is used to populate AppGW's backend pool.
@@ -43,17 +43,20 @@ When AGIC starts, it [sets up informers](../pkg/k8scontext/context.go) for watch
4343
When starting the informers, AGIC also provides event handlers for each for create/update/delete operations on the resource. This handler is responsible for enqueuing an event .
4444

4545
### 2. Worker
46+
4647
[Worker](../../pkg/worker.go) is responsible for processing the events and performing updates.
4748

4849
When Worker's `Run` function is called, it starts as a separate thread and waits on the `Work` channel. When an informers add an event to the channel, worker dequeues the event and checks whether the event is noise or is relevant. Events that are coming from unwatched namespaces and unreferenced pods/endpoints are skipped to reduce the churn. If the the last worker loop was run less than 1 second ago, it sleeps for the remainder and wakes up to space out the updates.
4950
After this, worker starts draining the rest of the events and calling the `ProcessEvent` function to process the event.
5051

5152
`ProcessEvent` function does the following:
53+
5254
1. Check if the Application Gateway is in `Running` or `Starting` operational state.
5355
1. Updates all ingress resources with public/private IP address of the App Gateway.
5456
1. Generate new config and update the Application Gateway.
5557

5658
### 3. Application Gateway Config Builder
59+
5760
This [component](../../pkg/appgw/configbuilder.go) is responsible for using the information in the local kubernetes cache and generating the corresponding Application Gateway configuration as an output.
5861

5962
Worker invokes the `Build` on this component which then generates various gateways sub-resources starting from leaf sub-resources like `probes`, `http settings` up to the `request routing rules`.
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
# Application Gateway Ingress Controller Development Guide
2+
23
Welcome to the Application Gateway Ingress Controller development guide!
34

45
## Table of contents
6+
57
- [Understanding the architecture](design.md)
68
- [Building and running the controller](build.md)
79
- [Installing the latest nightly build](nightly.md)
810
- [Running tests](test.md)
9-
- [Contribution Guidelines](contribute.md)
11+
- [Contribution Guidelines](contribute.md)

docs/developers/nightly.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,29 @@
33
To install the latest nightly release,
44

55
1. Add the nightly helm repository
6-
```
6+
7+
```bash
78
helm repo add agic-nightly https://appgwingress.blob.core.windows.net/ingress-azure-helm-package-staging/
89
helm repo update
910
```
1011

11-
2. Check the available version
12+
1. Check the available version
1213

1314
**Latest version**: ![nightly release (latest by date)](https://img.shields.io/badge/dynamic/yaml?url=https://appgwingress.blob.core.windows.net/ingress-azure-helm-package-staging/index.yaml&label=nightly&query=entries[%22ingress-azure%22][0].appVersion&color=green)
14-
15+
1516
or
16-
17+
1718
You can look up the version in the repo using helm.
18-
```
19+
20+
```bash
1921
helm search repo agic-nightly
2022
```
2123

22-
2. Install using the same helm command by using the staging repository.
23-
```
24+
1. Install using the same helm command by using the staging repository.
25+
26+
```bash
2427
helm install ingress-azure \
2528
-f helm-config.yaml \
2629
agic-nightly/ingress-azure \
2730
--version <version>
28-
```
31+
```

docs/developers/test.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,30 @@
55
* [Testing Tips](#testing-tips)
66

77
## Unit Tests
8+
89
As is the convention in go, unit tests for the `.go` file you want to test live in the same folder and end with `_test.go`.
910
We use the `ginkgo`/`gomega` testing framework for writing the tests.
1011

1112
To execute the tests, use
13+
1214
```bash
1315
go test -v -tags unittest ./...
1416
```
1517

1618
## E2E Tests
19+
1720
E2E tests are going to test the specific scenarios with a real AKS and App Gateway setup with AGIC installed on it.
1821

1922
E2E tests are automatically run every day 3 AM in the morning using an [E2E pipeline](https://dev.azure.com/azure/application-gateway-kubernetes-ingress/_release?_a=releases&view=mine&definitionId=14).
2023

2124
If you have cluster with AGIC installed, you can run e2e tests simply by:
25+
2226
```bash
2327
go test -v -tags e2e ./...
2428
```
2529

2630
You can also execute the `run-e2e.sh` which is used in the E2E pipeline to invoke the tests. This script will install AGIC with the version provided.
31+
2732
```bash
2833
export version="<agic-version>"
2934
export applicationGatewayId="<resource-id>"
@@ -34,8 +39,10 @@ export identityClientId="<agic-identity-client-id>"
3439
```
3540

3641
## Testing Tips
42+
3743
* If you just want to run a specific set of tests, then an easy way is add `F` (Focus) to the `It`, `Context`, `Describe` directive in the test.
3844
For example:
45+
3946
```go
4047
FContext("Test obtaining a single certificate for an existing host", func() {
4148
cb := newConfigBuilderFixture(nil)
@@ -51,4 +58,4 @@ export identityClientId="<agic-identity-client-id>"
5158
Expect(*actualSecretID).To(Equal(expectedSecret))
5259
})
5360
})
54-
```
61+
```

docs/faq.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Frequrently Asked Questions: [WIP]
22

3-
.. note::
4-
[Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
3+
> **_NOTE:_** [Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
54
65
* [What is an Ingress Controller](#what-is-an-ingress-controller)
76
* [Can single ingress controller instance manage multiple Application Gateway](#can-single-ingress-controller-instance-manage-multiple-application-gateway)

docs/features/agic-reconcile.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
11
## Reconcile scenario (BETA)
22

3-
.. note::
4-
[Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
3+
> **_NOTE:_** [Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
54
6-
When an Application Gateway is deployed through ARM template, a requirement is that the gateway configuration should contain a probe, listener, rule, backend pool and backend http setting. When such a template is re-deployed with minor changes (for example to WAF rules) on Gateway that is being controlled by AGIC, all the AGIC written rules are removed. Given such change on Application Gateway doesn’t trigger any events on AGIC, AGIC doesn’t reconcile the gateway back to the expected state.
5+
When an Application Gateway is deployed through ARM template, a requirement is that the gateway configuration should contain a probe, listener, rule, backend pool and backend http setting. When such a template is re-deployed with minor changes (for example to WAF rules) on Gateway that is being controlled by AGIC, all the AGIC written rules are removed. Given such change on Application Gateway doesn’t trigger any events on AGIC, AGIC doesn’t reconcile the gateway back to the expected state.
76

87
## Solution
8+
99
To address the problem above, AGIC periodically checks if the latest gateway configuration is different from what it cached, and reconcile if needed to make gateway configuration is eventual correct.
1010

1111
## How to configure reconcile
12+
1213
There are two ways to configure AGIC reconcile via helm, and to use the new feature, make sure the AGIC version is at least at 1.2.0-rc1
1314

1415
### Configure inside helm values.yaml
16+
1517
`reconcilePeriodSeconds: 30`, it means AGIC checks the reconciling in every 30 seconds.
1618
Acceptable values are between 30 and 300.
1719

1820
### Configure from helm command line
21+
1922
Configure from helm install command(first time install) and helm upgrade command, helm version is v3
23+
2024
```bash
2125
# helm fresh install
2226
helm intall <releaseName> -f helm-config.yaml application-gateway-kubernetes-ingress/ingress-azure --version 1.2.0-rc3 --set reconcilePeriodSeconds=30

docs/features/appgw-ssl-certificate.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
### Prerequisites
22

3-
.. note::
4-
[Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
3+
> **_NOTE:_** [Application Gateway for Containers](https://aka.ms/agc) has been released, which introduces numerous performance, resilience, and feature changes. Please consider leveraging Application Gateway for Containers for your next deployment.
54
65
This documents assumes you already have the following Azure tools and resources installed:
6+
77
- [AKS](https://azure.microsoft.com/en-us/services/kubernetes-service/) with [Advanced Networking](https://docs.microsoft.com/en-us/azure/aks/configure-azure-cni) enabled
88
- [App Gateway v2](https://docs.microsoft.com/en-us/azure/application-gateway/create-zone-redundant) in the same virtual network as AKS
99
- [AAD Pod Identity](https://github.com/Azure/aad-pod-identity) installed on your AKS cluster
@@ -12,12 +12,15 @@ This documents assumes you already have the following Azure tools and resources
1212
Please use [Greenfield Deployment](https://github.com/Azure/application-gateway-kubernetes-ingress/blob/master/docs/setup/install-new.md) to install nonexistents.
1313

1414
To use the new feature, make sure the AGIC version is at least at 1.2.0-rc3
15+
1516
```bash
1617
helm install application-gateway-kubernetes-ingress/ingress-azure -f helm-config.yaml --version 1.2.0-rc3 --generate-name
1718
```
1819

1920
## Create a certificate and configure the certificate to AppGw
21+
2022
The certificate below should only be used for testing purpose.
23+
2124
```bash
2225
appgwName=""
2326
resgp=""
@@ -44,6 +47,7 @@ az network application-gateway ssl-cert create \
4447
```
4548

4649
## Configure certificate from Key Vault to AppGw
50+
4751
To configfure certificate from key vault to Application Gateway, an user-assigned managed identity will need to be created and assigned to AppGw, the managed identity will need to have GET secret access to KeyVault.
4852

4953
```bash
@@ -107,6 +111,7 @@ az network application-gateway ssl-cert create \
107111
```
108112

109113
## Testing the key vault certificate on Ingress
114+
110115
Since we have certificate from Key Vault configured in Application Gateway, we can then add the new annotation `appgw.ingress.kubernetes.io/appgw-ssl-certificate: mykvsslcert` in Kubernetes ingress to enable the feature.
111116

112117
```bash

0 commit comments

Comments
 (0)